summaryrefslogtreecommitdiff
path: root/lib/strnlen.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-06-18 18:16:54 +0000
committerJim Meyering <jim@meyering.net>2000-06-18 18:16:54 +0000
commit570ad2486a1ebbb80301ec1ab05d4a2e61265564 (patch)
tree8a8234c13aa391c9b73f52d5ff541fdd47197459 /lib/strnlen.c
parent1b63505cf90487584196b710344a26c10061e561 (diff)
downloadcoreutils-570ad2486a1ebbb80301ec1ab05d4a2e61265564.tar.xz
Include memory.h, string.h, and/or strings.h as needed.
(this snippet comes from src/system.h).
Diffstat (limited to 'lib/strnlen.c')
-rw-r--r--lib/strnlen.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/strnlen.c b/lib/strnlen.c
index f5681ca38..556d2d55c 100644
--- a/lib/strnlen.c
+++ b/lib/strnlen.c
@@ -21,7 +21,14 @@
# include <config.h>
#endif
-#include <string.h>
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#else
+# include <strings.h>
+#endif
#ifndef HAVE_DECL_MEMCHR
"this configure-time declaration test was not run"