Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Jan 2008 19:46:16 +0000
From:      Roy Marples <roy@marples.name>
To:        freebsd-current@freebsd.org
Subject:   #define _XOPEN_SOURCE breaks userland applications
Message-ID:  <1199216776.25213.10.camel@localhost>

next in thread | raw e-mail | index | archive | help
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;




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1199216776.25213.10.camel>