diff options
author | Daniel Lange <DLange@git.local> | 2020-08-27 07:48:11 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2020-08-27 07:48:11 +0200 |
commit | 7a637ff1dea1a02a42e55aa79f03a9e85a576207 (patch) | |
tree | 3d12e9808eb554ad8017fcd9059864f92d51d104 /XAlloc.h | |
parent | dfb05211d32675faebac6fd76ef58d9e303a90e7 (diff) | |
parent | f3147ea2d1598914c2db53e8cfb34c8ff81e2ff4 (diff) | |
download | debian_htop-7a637ff1dea1a02a42e55aa79f03a9e85a576207.tar.gz debian_htop-7a637ff1dea1a02a42e55aa79f03a9e85a576207.tar.bz2 debian_htop-7a637ff1dea1a02a42e55aa79f03a9e85a576207.zip |
Update upstream source from tag 'upstream/3.0.0'
Update to upstream version '3.0.0'
with Debian dir 8c9e99b342a3fc4208a5abe239b39578f8563a2c
Diffstat (limited to 'XAlloc.h')
-rw-r--r-- | XAlloc.h | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -11,11 +11,17 @@ #include <assert.h> #include <stdlib.h> -void* xMalloc(size_t size); +extern void fail(void); -void* xCalloc(size_t nmemb, size_t size); +extern void* xMalloc(size_t size); -void* xRealloc(void* ptr, size_t size); +extern void* xCalloc(size_t nmemb, size_t size); + +extern void* xRealloc(void* ptr, size_t size); + +#undef xAsprintf + +#define xAsprintf(strp, fmt, ...) do { int _r=asprintf(strp, fmt, __VA_ARGS__); if (_r < 0) { fail(); } } while(0) #define xSnprintf(fmt, len, ...) do { int _l=len; int _n=snprintf(fmt, _l, __VA_ARGS__); if (!(_n > -1 && _n < _l)) { curs_set(1); endwin(); err(1, NULL); } } while(0) @@ -32,9 +38,9 @@ void* xRealloc(void* ptr, size_t size); #endif #if (__has_attribute(nonnull) || \ ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))) -char* xStrdup_(const char* str) __attribute__((nonnull)); +extern char* xStrdup_(const char* str) __attribute__((nonnull)); #endif // __has_attribute(nonnull) || GNU C 3.3 or later -char* xStrdup_(const char* str); +extern char* xStrdup_(const char* str); #endif |