#define _XOPEN_SOURCE breaks userland applications

From: Roy Marples <roy_at_marples.name>
Date: Tue, 01 Jan 2008 19:46:16 +0000
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
_at__at_ -46,7 +46,7 _at__at_

 #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;
Received on Tue Jan 01 2008 - 18:46:48 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:24 UTC