summaryrefslogtreecommitdiffstats
path: root/src/util/sss_utf8.c
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-12-09 22:06:40 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-03-14 14:16:33 +0100
commitfa0938a6e3cb928602633c3da0b909deb269369d (patch)
tree6ebe9d9b79752f29a6587eaf5bb296d1e76b3837 /src/util/sss_utf8.c
parent2bdadc5274df42738b97045cd01cd63d3651daf9 (diff)
downloadsssd-fa0938a6e3cb928602633c3da0b909deb269369d.tar.gz
sssd-fa0938a6e3cb928602633c3da0b909deb269369d.tar.xz
sssd-fa0938a6e3cb928602633c3da0b909deb269369d.zip
Use pattern #elif defined(identifier)
We had in source code following pattern #elif HAVE_<name> It worked because undefined identifier(in some cases) was evaluated to 0. But we do not care about value of HAVE_SOMETHING. We just need to know whether identifier was defined. There is not equivalent to #ifdef (short for of #if definded) We need to use long form: #elif defined HAVE_<name> It causes also compiler warning with enabled compiler flag -Wundef. Reviewed-by: Pavel Reichl <preichl@redhat.com>
Diffstat (limited to 'src/util/sss_utf8.c')
-rw-r--r--src/util/sss_utf8.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util/sss_utf8.c b/src/util/sss_utf8.c
index 695230826..7ba11ca75 100644
--- a/src/util/sss_utf8.c
+++ b/src/util/sss_utf8.c
@@ -36,7 +36,7 @@ void sss_utf8_free(void *ptr)
{
return free(ptr);
}
-#elif HAVE_GLIB2
+#elif defined(HAVE_GLIB2)
void sss_utf8_free(void *ptr)
{
return g_free(ptr);
@@ -57,7 +57,7 @@ uint8_t *sss_utf8_tolower(const uint8_t *s, size_t len, size_t *_nlen)
if (_nlen) *_nlen = llen;
return lower;
}
-#elif HAVE_GLIB2
+#elif defined(HAVE_GLIB2)
uint8_t *sss_utf8_tolower(const uint8_t *s, size_t len, size_t *_nlen)
{
gchar *glower;
@@ -94,7 +94,7 @@ bool sss_utf8_check(const uint8_t *s, size_t n)
return false;
}
-#elif HAVE_GLIB2
+#elif defined(HAVE_GLIB2)
bool sss_utf8_check(const uint8_t *s, size_t n)
{
return g_utf8_validate((const gchar *)s, n, NULL);
@@ -141,7 +141,7 @@ errno_t sss_utf8_case_eq(const uint8_t *s1, const uint8_t *s2)
return ENOMATCH;
}
-#elif HAVE_GLIB2
+#elif defined(HAVE_GLIB2)
errno_t sss_utf8_case_eq(const uint8_t *s1, const uint8_t *s2)
{
gchar *gs1;