|
root / base / motif / patches / 0001-xmfuncs-strings-h-macro-mangling.patch
0001-xmfuncs-strings-h-macro-mangling.patch Diff 20 lines 994 B
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
--- a/lib/Xm/Xmfuncs.h
+++ b/lib/Xm/Xmfuncs.h
@@ -41,6 +41,16 @@
 #else
 #if (__STDC__ && !defined(X_NOT_STDC_ENV) && !defined(sun) && !defined(macII) && !defined(apollo)) || defined(SVR4) || defined(hpux) || defined(_IBMR2) || defined(_SEQUENT_)
 #include <string.h>
+/* HAMMERHEAD: pull in <strings.h> here, BEFORE bcopy/bzero/bcmp become
+ * function-like macros below. Otherwise X11/Xos.h's later (guarded, so
+ * normally a no-op) `#include <strings.h>` is the FIRST time these
+ * prototypes are seen, and the macro substitution mangles the illumos
+ * `extern int bcmp(const void *, const void *, size_t);` declarations
+ * into invalid syntax ("expected declaration specifiers ... before '('
+ * token"). Pre-including here means strings.h's own guard (_STRINGS_H)
+ * makes X11/Xos.h's later include a safe no-op.
+ */
+#include <strings.h>
 #define _XFUNCS_H_INCLUDED_STRING_H
 #define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
 #define bzero(b,len) memset(b, 0, (size_t)(len))