Code

Include strings.h instead of defining _BSD_SOURCE to get strcasecmp.
authorSebastian Harl <sh@tokkee.org>
Thu, 25 Feb 2016 20:35:53 +0000 (21:35 +0100)
committerSebastian Harl <sh@tokkee.org>
Thu, 25 Feb 2016 20:35:53 +0000 (21:35 +0100)
_BSD_SOURCE is deprecated in favor of _DEFAULT_SOURCE but also it's not
needed for strcasecmp() when including strings.h in addition to string.h.

configure.ac
src/core/memstore.c
src/core/object.c
src/plugins/backend/collectd/unixsock.c
src/plugins/backend/mk-livestatus.c
src/plugins/timeseries/rrdtool.c
src/utils/avltree.c

index 95394ebd839bbd146fe90df994693d348b4c6721..85e39c36c1a440164a3e5b31950a329d1e40bf91 100644 (file)
@@ -122,11 +122,6 @@ if test "x$enable_standards" = "xyes"; then
        AC_DEFINE([_THREAD_SAFE], 1,
                        [Define to enable reentrant interfaces.])
 
-       dnl GNU libc defines strcasecmp() only when using _BSD_SOURCE even though
-       dnl the function is conforming to POSIX.1-2001 as well. Let's weaken
-       dnl strict standards compliance a bit to work around this.
-       AC_DEFINE([_BSD_SOURCE], 1, [Define to enable 4.3BSD support.])
-
        for flag in -std=c99; do
                AC_MSG_CHECKING([whether $CC accepts $flag])
 
index 244982777cfb38fc82b5b99e8e8cf1c645e56b91..05c879bf8e14abf0456d368a59689fde3cf04316 100644 (file)
@@ -42,6 +42,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 
 #include <pthread.h>
 
index c39faf4aed2c89f684a3e2c0c947b0eba7fe2d18..dfa06551cb62c1353b59d827ea5333c8e7f30187 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 
 /*
  * private types
index 65b05845814ec6e66601cda58bc829a279956f37..73bca12e0c8691e939b9dcc3e4018216bfdf9dc1 100644 (file)
@@ -44,6 +44,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 
 SDB_PLUGIN_MAGIC;
 
index d1126db92a2e02f14835056f1d994b6c3fa2e8f5..cd8bbd0fc79d395e1d9b8fbb407020e4893dc105 100644 (file)
@@ -44,6 +44,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 
 SDB_PLUGIN_MAGIC;
 
index 7d6c30b68ff236d6b59dc417fce56706fe63dde0..73f22afade0744de1460ae563dacb1fedb20ca95 100644 (file)
@@ -37,6 +37,8 @@
 
 #include <errno.h>
 #include <stdlib.h>
+#include <string.h>
+#include <strings.h>
 #include <rrd.h>
 #ifdef HAVE_RRD_CLIENT_H
 #      include <rrd_client.h>
index 87db2f78d0e9b8e7c1eee042af3f32de0c697887..f0987f54fdba41cce4f8fd85b9a7b11eb435f86c 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <pthread.h>
 
 /*