#define _XOPEN_SOURCE breaks userland applications

Roy Marples roy at marples.name
Tue Jan 1 11:46:48 PST 2008


Hi

Consider the following

#define _XOPEN_SOURCE 600
#include <sys/file.h>
int main(void)
{
  return 0;
}

Gives the following when compiled

> gcc x.c
In file included from x.c:2:
/usr/include/sys/file.h:162: error: expected specifier-qualifier-list
before 'u_int'

The error was caused by this patch
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/sys/types.h.diff?r1=1.73;r2=1.74;f=h
No CVS comment as to why the change was needed

I propose that the first part of the patch is reverted, as follows

Thanks

Roy

--- src/sys/sys/types.h    2008-01-01 18:52:26.000000000 +0000
+++ src.orig/sys/sys/types.h   2008-01-01 19:20:21.000000000 +0000
@@ -46,7 +46,7 @@

 #include <sys/_pthreadtypes.h>

-#if __BSD_VISIBLE 
+#ifndef _POSIX_SOURCE
 typedef        unsigned char   u_char;
 typedef        unsigned short  u_short;
 typedef        unsigned int    u_int;



More information about the freebsd-current mailing list