X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Feealloc.h;h=0fce8c1adceef7a68b5c4cc987bd835291cc3e26;hb=1276a2c5f24c0c932426aca9c899fa524d2443f2;hp=806900e397c11db4cb4270d0f4964839448e8095;hpb=f3854f3e839144a3f747e4a68f8c5f9413b9c225;p=gnulib.git diff --git a/lib/eealloc.h b/lib/eealloc.h index 806900e39..0fce8c1ad 100644 --- a/lib/eealloc.h +++ b/lib/eealloc.h @@ -1,5 +1,5 @@ /* Memory allocation with expensive empty allocations. - Copyright (C) 2003, 2008, 2010 Free Software Foundation, Inc. + Copyright (C) 2003, 2008, 2010-2014 Free Software Foundation, Inc. Written by Bruno Haible , 2003, based on prior work by Jim Meyering. @@ -31,18 +31,26 @@ #include +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef EEALLOC_INLINE +# define EEALLOC_INLINE _GL_INLINE +#endif + #if MALLOC_0_IS_NONNULL # define eemalloc malloc #else # if __GNUC__ >= 3 -static inline void *eemalloc (size_t n) +EEALLOC_INLINE void *eemalloc (size_t n) __attribute__ ((__malloc__)) # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) __attribute__ ((__alloc_size__ (1))) # endif ; # endif -static inline void * +EEALLOC_INLINE void * eemalloc (size_t n) { /* If n is zero, allocate a 1-byte block. */ @@ -56,10 +64,10 @@ eemalloc (size_t n) # define eerealloc realloc #else # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) -static inline void *eerealloc (void *p, size_t n) +EEALLOC_INLINE void *eerealloc (void *p, size_t n) __attribute__ ((__alloc_size__ (2))); # endif -static inline void * +EEALLOC_INLINE void * eerealloc (void *p, size_t n) { /* If n is zero, allocate or keep a 1-byte block. */ @@ -76,4 +84,6 @@ eerealloc (void *p, size_t n) eenrealloc (void *p, size_t n, size_t s) - like eerealloc (p, n * s) If this would be useful in your application. please speak up. */ +_GL_INLINE_HEADER_END + #endif /* _EEALLOC_H */