X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/cf817883664ae517071752b2851c2ce96eb2de29..12e59929e245bea0ff6c222eb006866affcaf649:/popt/system.h diff --git a/popt/system.h b/popt/system.h index 8d62df85..50cecaf5 100644 --- a/popt/system.h +++ b/popt/system.h @@ -85,7 +85,7 @@ char *alloca(size_t size); # endif # endif # endif -#elif defined(__GNUC__) && defined(__STRICT_ANSI__) +#elif !defined(alloca) #define alloca __builtin_alloca #endif @@ -98,13 +98,15 @@ size_t strlcat(char *d, const char *s, size_t bufsize); #endif #if HAVE_MCHECK_H && defined(__GNUC__) -#define vmefail() (fprintf(stderr, "virtual memory exhausted.\n"), exit(EXIT_FAILURE), NULL) static inline char * xstrdup(const char *s) { size_t memsize = strlen(s) + 1; char *ptr = malloc(memsize); - if (!ptr) vmefail(); + if (!ptr) { + fprintf(stderr, "virtual memory exhausted.\n"); + exit(EXIT_FAILURE); + } strlcpy(ptr, s, memsize); return ptr; }