kBuild/kBuild-c99.patch

151 lines
3.2 KiB
Diff

Do not treat <strings.h> as an umbrella header for <string.h>
The two are distinct on GNU/Linux.
Also add missing #include <string.h> in some files.
diff --git a/src/sed/lib/getline.c b/src/sed/lib/getline.c
index 4cb9d45b..f39c363f 100644
--- a/src/sed/lib/getline.c
+++ b/src/sed/lib/getline.c
@@ -9,10 +9,10 @@
#include <stdio.h>
#undef getline /* bird */
+#include <string.h>
+
#ifdef HAVE_STRINGS_H
# include <strings.h>
-#else
-# include <string.h>
#endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDLIB_H
diff --git a/src/sed/lib/mkstemp.c b/src/sed/lib/mkstemp.c
index 5b00205c..f36f7ca4 100644
--- a/src/sed/lib/mkstemp.c
+++ b/src/sed/lib/mkstemp.c
@@ -2,10 +2,10 @@
#include "config.h"
#endif
+#include <string.h>
+
#ifdef HAVE_STRINGS_H
# include <strings.h>
-#else
-# include <string.h>
#endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDLIB_H
diff --git a/src/sed/lib/utils.c b/src/sed/lib/utils.c
index 41c61aaf..48a8b57f 100644
--- a/src/sed/lib/utils.c
+++ b/src/sed/lib/utils.c
@@ -25,10 +25,10 @@
extern int errno;
#endif
+#include <string.h>
+
#ifdef HAVE_STRINGS_H
# include <strings.h>
-#else
-# include <string.h>
#endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDLIB_H
diff --git a/src/sed/sed/compile.c b/src/sed/sed/compile.c
index 0ecc2fe2..064bb350 100644
--- a/src/sed/sed/compile.c
+++ b/src/sed/sed/compile.c
@@ -22,14 +22,13 @@
#include "strverscmp.h"
#include <stdio.h>
#include <ctype.h>
+#include <string.h>
#ifdef HAVE_STRINGS_H
# include <strings.h>
# ifdef HAVE_MEMORY_H
# include <memory.h>
# endif
-#else
-# include <string.h>
#endif /* HAVE_STRINGS_H */
#ifdef HAVE_STDLIB_H
diff --git a/src/sed/sed/execute.c b/src/sed/sed/execute.c
index c9038f4f..09080b5b 100644
--- a/src/sed/sed/execute.c
+++ b/src/sed/sed/execute.c
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <ctype.h>
+#include <string.h>
#include <errno.h>
#ifndef errno
@@ -46,8 +47,6 @@ extern int errno;
#ifdef HAVE_STRINGS_H
# include <strings.h>
-#else
-# include <string.h>
#endif /*HAVE_STRINGS_H*/
#ifdef HAVE_MEMORY_H
# include <memory.h>
diff --git a/src/sed/sed/fmt.c b/src/sed/sed/fmt.c
index 64600a06..4374070e 100644
--- a/src/sed/sed/fmt.c
+++ b/src/sed/sed/fmt.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
+#include <string.h>
#if HAVE_LIMITS_H
# include <limits.h>
diff --git a/src/sed/sed/mbcs.c b/src/sed/sed/mbcs.c
index 37565472..79e3f843 100644
--- a/src/sed/sed/mbcs.c
+++ b/src/sed/sed/mbcs.c
@@ -17,6 +17,7 @@
#include "sed.h"
#include <stdlib.h>
+#include <string.h>
int mb_cur_max;
diff --git a/src/sed/sed/regexp.c b/src/sed/sed/regexp.c
index d4e7437c..a007494d 100644
--- a/src/sed/sed/regexp.c
+++ b/src/sed/sed/regexp.c
@@ -19,6 +19,7 @@
#include <ctype.h>
#include <stdio.h>
+#include <string.h>
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
diff --git a/src/sed/sed/sed.c b/src/sed/sed/sed.c
index b3bc2ea2..3829e2c6 100644
--- a/src/sed/sed/sed.c
+++ b/src/sed/sed/sed.c
@@ -22,12 +22,10 @@
#include "sed.h"
-
#include <stdio.h>
+#include <string.h>
#ifdef HAVE_STRINGS_H
# include <strings.h>
-#else
-# include <string.h>
#endif /*HAVE_STRINGS_H*/
#ifdef HAVE_MEMORY_H
# include <memory.h>