Ignore:
Timestamp:
Sep 19, 2015, 10:35:03 PM (10 years ago)
Author:
bird
Message:

electric.*: Made it work with recent gcc versions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/electric.h

    r2591 r2798  
    3737void *xrealloc (void *, unsigned int);
    3838char *xstrdup (const char *);
     39#ifdef __GNUC__
     40void *xmalloc_size_t (size_t size);
     41void *xcalloc_size_t (size_t size, size_t items);
     42void *xrealloc_size_t (void *ptr, size_t size);
     43#endif
    3944
     45
     46#undef  free
    4047#define free(a)         xfree(a)
    41 #define calloc(a,b)     xcalloc((a) * (b))
    42 #define malloc(a)       xmalloc(a)
    43 #define realloc(a,b)    xrealloc((a),(b))
     48#undef  strdup
    4449#define strdup(a)       xstrdup(a)
     50
     51#undef  calloc
     52#undef  malloc
     53#undef  realloc
     54#ifdef __GNUC__
     55# define calloc(a,b)     xcalloc_size_t(a,b)
     56# define malloc(a)       xmalloc_size_t(a)
     57# define realloc(a,b)    xrealloc_size_t(a,b)
     58#else
     59# define calloc(a,b)     xcalloc((a) * (b))
     60# define malloc(a)       xmalloc(a)
     61# define realloc(a,b)    xrealloc((a),(b))
     62#endif
    4563
    4664#endif
Note: See TracChangeset for help on using the changeset viewer.