mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-15 21:44:36 +03:00
Refactor __attribute__ usage
Use internal macros for compatibility with non GNUC compilers.
This commit is contained in:

committed by
cgzones

parent
f4602f7b4e
commit
7107d1db0b
10
XAlloc.h
10
XAlloc.h
@ -31,14 +31,6 @@ void* xRealloc(void* ptr, size_t size);
|
||||
# define xStrdup(str_) (assert(str_), xStrdup_(str_))
|
||||
#endif
|
||||
|
||||
#ifndef __has_attribute // Clang's macro
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
#if (__has_attribute(nonnull) || \
|
||||
((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)))
|
||||
char* xStrdup_(const char* str) __attribute__((nonnull));
|
||||
#endif // __has_attribute(nonnull) || GNU C 3.3 or later
|
||||
|
||||
char* xStrdup_(const char* str);
|
||||
char* xStrdup_(const char* str) ATTR_NONNULL;
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user