#define _XOPEN_SOURCE breaks userland applications

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


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
No CVS comment as to why the change was needed

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



--- 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>

+#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