VirtualBox

Changeset 153 in kBuild for branches/GNU/src/gmake/misc.c


Ignore:
Timestamp:
Sep 8, 2004 2:43:30 AM (20 years ago)
Author:
bird
Message:

GNU Make 3.81beta1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gmake/misc.c

    r54 r153  
    3131   VA_END macros used here since we have multiple print functions.  */
    3232
    33 #if HAVE_VPRINTF || HAVE_DOPRNT
    34 # define HAVE_STDVARARGS 1
    35 # if __STDC__
     33#if USE_VARIADIC
     34# if HAVE_STDARG_H
    3635#  include <stdarg.h>
    3736#  define VA_START(args, lastarg) va_start(args, lastarg)
     
    4746# define VA_END(args) va_end(args)
    4847#else
    49 /* # undef HAVE_STDVARARGS */
     48/* We can't use any variadic interface! */
    5049# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
    5150# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
     
    211210
    212211void
    213 #if __STDC__ && HAVE_STDVARARGS
     212#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
    214213message (int prefix, const char *fmt, ...)
    215214#else
     
    220219#endif
    221220{
    222 #if HAVE_STDVARARGS
     221#if USE_VARIADIC
    223222  va_list args;
    224223#endif
     
    247246
    248247void
    249 #if __STDC__ && HAVE_STDVARARGS
     248#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
    250249error (const struct floc *flocp, const char *fmt, ...)
    251250#else
     
    256255#endif
    257256{
    258 #if HAVE_STDVARARGS
     257#if USE_VARIADIC
    259258  va_list args;
    260259#endif
     
    280279
    281280void
    282 #if __STDC__ && HAVE_STDVARARGS
     281#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
    283282fatal (const struct floc *flocp, const char *fmt, ...)
    284283#else
     
    289288#endif
    290289{
    291 #if HAVE_STDVARARGS
     290#if USE_VARIADIC
    292291  va_list args;
    293292#endif
     
    363362xmalloc (unsigned int size)
    364363{
    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);
    366366  if (result == 0)
    367367    fatal (NILF, _("virtual memory exhausted"));
     
    376376
    377377  /* Some older implementations of realloc() don't conform to ANSI.  */
     378  if (! size)
     379    size = 1;
    378380  result = ptr ? realloc (ptr, size) : malloc (size);
    379381  if (result == 0)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette