use proper _XOPEN_SOURCE instead of __USE_UNIX98 to enable needed thread features on glibc

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29897 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2010-03-10 17:37:00 +00:00
parent 5e196f549a
commit 19e49c3314
4 changed files with 30 additions and 8 deletions

View file

@ -10,7 +10,9 @@
2010-03-10 Riccardo Mottola <rmottola@users.sf.net>
* /Source/ObjectiveC2/sync.m : use proper _XOPEN_SOURCE
* /Source/ObjectiveC2/sync.m,
* /Source/NSZone.h,
* /Source/GSPThread.h : use proper _XOPEN_SOURCE
instead of __USE_UNIX98 to enable needed thread features on glibc
2010-03-08 Roland Schwingel <roland.schwingel@onevision.de>

View file

@ -25,13 +25,17 @@
/*
* Since glibc does not enable Unix98 extensions by default, we need to tell it
* to do so explicitly. Whether that support is switched on by _XOPEN_SOURCE or
* by __USE_UNIX98 depends on whether <features.h> has already been included or
* will be included by pthread.h. Hence both flags need to be set here. This
* shouldn't be be a problem with other libcs.
* to do so explicitly. That support is switched on by _XOPEN_SOURCE and
* __USE_UNIX98 is an internal flag which can cause trouble if enabled alone.
* For safety we enable this only on linux and hurd where glibc is likely.
* We include features.h explicitely to avoid weird problems.
*/
#define _XOPEN_SOURCE 500
#define __USE_UNIX98
#if defined __linux__ || defined __hurd__
# ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE 600
# endif
#endif
#include <pthread.h>
/*

View file

@ -26,7 +26,13 @@
// This file uses some SUS'98 extensions, so we need to tell glibc not to hide
// them. Other platforms have more sensible libcs, which just default to being
// standards-compliant.
#define _XOPEN_SOURCE 500
#if defined __linux__ || defined __hurd__
# ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE 600
# endif
#endif
#include <pthread.h>
#import "GNUstepBase/GSConfig.h"
#define gs_cond_t pthread_cond_t

View file

@ -86,6 +86,16 @@
#define IN_NSZONE_M 1
/* we define _XOPEN_SOURCE to get all the necessary pthread attributes
* and we need to define it here and not just in GSPThread.h because
* GLIBC is so picky with defines */
#if defined __linux__ || defined __hurd__
# ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE 600
# endif
#endif
#import "common.h"
#include <stddef.h>
#include <string.h>