Use gcc to find places needing a a_tokenize call.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
This commit is contained in:
Pierre Habouzit 2008-06-23 00:51:50 +02:00 committed by Julien Danjou
parent 8d7f45d76a
commit 7b7af60dcd
1 changed files with 10 additions and 1 deletions

View File

@ -227,6 +227,15 @@ static inline int a_strcmp(const char *a, const char *b)
{ {
return strcmp(NONULL(a), NONULL(b)); return strcmp(NONULL(a), NONULL(b));
} }
#ifdef __GNUC__
#define a_strcmp(a, b) \
({ \
__builtin_choose_expr(__builtin_constant_p(a) || __builtin_constant_p(b), \
(void)({__asm__(".warning \"you may want to use a_tokenize here\"");}), \
(void)0); \
(a_strcmp)((a), (b)); \
})
#endif
/** \brief \c NULL resistant strcasecmp. /** \brief \c NULL resistant strcasecmp.
* \param[in] a the first string. * \param[in] a the first string.