Changeset 153 in kBuild for branches/GNU/src/gmake/misc.c
- Timestamp:
- Sep 8, 2004 2:43:30 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gmake/misc.c
r54 r153 31 31 VA_END macros used here since we have multiple print functions. */ 32 32 33 #if HAVE_VPRINTF || HAVE_DOPRNT 34 # define HAVE_STDVARARGS 1 35 # if __STDC__ 33 #if USE_VARIADIC 34 # if HAVE_STDARG_H 36 35 # include <stdarg.h> 37 36 # define VA_START(args, lastarg) va_start(args, lastarg) … … 47 46 # define VA_END(args) va_end(args) 48 47 #else 49 /* # undef HAVE_STDVARARGS*/48 /* We can't use any variadic interface! */ 50 49 # define va_alist a1, a2, a3, a4, a5, a6, a7, a8 51 50 # define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; … … 211 210 212 211 void 213 #if __STDC__ && HAVE_STDVARARGS212 #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H 214 213 message (int prefix, const char *fmt, ...) 215 214 #else … … 220 219 #endif 221 220 { 222 #if HAVE_STDVARARGS221 #if USE_VARIADIC 223 222 va_list args; 224 223 #endif … … 247 246 248 247 void 249 #if __STDC__ && HAVE_STDVARARGS248 #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H 250 249 error (const struct floc *flocp, const char *fmt, ...) 251 250 #else … … 256 255 #endif 257 256 { 258 #if HAVE_STDVARARGS257 #if USE_VARIADIC 259 258 va_list args; 260 259 #endif … … 280 279 281 280 void 282 #if __STDC__ && HAVE_STDVARARGS281 #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H 283 282 fatal (const struct floc *flocp, const char *fmt, ...) 284 283 #else … … 289 288 #endif 290 289 { 291 #if HAVE_STDVARARGS290 #if USE_VARIADIC 292 291 va_list args; 293 292 #endif … … 363 362 xmalloc (unsigned int size) 364 363 { 365 char *result = (char *) malloc (size); 364 /* Make sure we don't allocate 0, for pre-ANSI libraries. */ 365 char *result = (char *) malloc (size ? size : 1); 366 366 if (result == 0) 367 367 fatal (NILF, _("virtual memory exhausted")); … … 376 376 377 377 /* Some older implementations of realloc() don't conform to ANSI. */ 378 if (! size) 379 size = 1; 378 380 result = ptr ? realloc (ptr, size) : malloc (size); 379 381 if (result == 0)
Note:
See TracChangeset
for help on using the changeset viewer.