Eric Howe wrote on 1/15/10 10:49 AM:
S_IFDIR comes from stat.h, right? Is there some sort of _POSIX_SOURCE,
_BSD_SOURCE, _XOPEN_SOURCE, ... macro magic needed to make things behave? I
used to have to play around with various combinations of defining and
undefining various *_SOURCE flags back in my portable C days, different
combinations for different systems of course. This problem smells like GCC is
being stricter than we want it to be and it needs to be told to loosen up.

Just a wild guess.

It was a good guess.

I found the following necessary to compile KS trunk with -std=c99 on Linux. Seems like the #define statements ought to be part of what Charmonizer writes to charmony.h, based on arch/os detection. Is that right, Marvin? If it is, I can prepare a patch.

Index: perl/xs/XSBind.h
===================================================================
--- perl/xs/XSBind.h    (revision 5692)
+++ perl/xs/XSBind.h    (working copy)
@@ -8,6 +8,8 @@
 extern "C" {
 #endif

+#define _XOPEN_SOURCE
+
 #include "charmony.h"
 #include "KinoSearch/Object/Obj.h"
 #include "KinoSearch/Object/ByteBuf.h"
Index: core/KinoSearch/Store/FSDirHandle.c
===================================================================
--- core/KinoSearch/Store/FSDirHandle.c (revision 5692)
+++ core/KinoSearch/Store/FSDirHandle.c (working copy)
@@ -1,4 +1,7 @@
 #define C_KINO_FSDIRHANDLE
+#define _XOPEN_SOURCE
+#define _BSD_SOURCE
+
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
Index: core/KinoSearch/Store/FSFolder.c
===================================================================
--- core/KinoSearch/Store/FSFolder.c    (revision 5692)
+++ core/KinoSearch/Store/FSFolder.c    (working copy)
@@ -1,4 +1,7 @@
 #define C_KINO_FSFOLDER
+#define _XOPEN_SOURCE
+#define _BSD_SOURCE
+
 #include "KinoSearch/Util/ToolSet.h"

 #include <ctype.h>




--
Peter Karman  .  http://peknet.com/  .  [email protected]

Reply via email to