diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-03-18 16:56:14 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-03-18 16:56:14 +0100 |
commit | 9f6bfcaf9985dd9f6911c95b5df95e1d72a63f0f (patch) | |
tree | 2a9984e56e95b822d38d638f12659944c86de0fe /src/sciteco.h | |
parent | 9886eaf7fd5170bb037df177848c6b5c7df745c2 (diff) | |
download | sciteco-9f6bfcaf9985dd9f6911c95b5df95e1d72a63f0f.tar.gz |
make sure a (void*)0 is used as sentinels
since including glib.h on LLVM-Clang (32-bit) results in NULL being
redefined to 0 and compiler warnings being emitted when NULL is used
as sentinels
Diffstat (limited to 'src/sciteco.h')
-rw-r--r-- | src/sciteco.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sciteco.h b/src/sciteco.h index f22842c..b7f92fd 100644 --- a/src/sciteco.h +++ b/src/sciteco.h @@ -46,6 +46,12 @@ namespace Flags { extern sig_atomic_t sigint_occurred; +/* + * for sentinels: NULL might not be defined as a + * pointer type (LLVM/CLang) + */ +#define NIL ((void *)0) + #define INIT_PRIO(X) __attribute__((init_priority(X))) #define PRIO_INTERFACE 1000 #define PRIO_SYMBOLS 1000 @@ -69,7 +75,7 @@ static inline void append(gchar *&str1, const gchar *str2) { /* FIXME: optimize */ - gchar *new_str = g_strconcat(str1 ? : "", str2, NULL); + gchar *new_str = g_strconcat(str1 ? : "", str2, NIL); g_free(str1); str1 = new_str; } |