From 01745ec4fc361b6d88245789370f422a97208570 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Fri, 20 Oct 2006 18:57:55 +0000 Subject: [PATCH] ICU-5469 Improve usage of _XOPEN_SOURCE_EXTENDED X-SVN-Rev: 20540 --- icu4c/source/common/putil.c | 17 ++++++++++------- icu4c/source/config/mh-os390 | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/icu4c/source/common/putil.c b/icu4c/source/common/putil.c index 5bec2b9ca65..9be437ff254 100644 --- a/icu4c/source/common/putil.c +++ b/icu4c/source/common/putil.c @@ -38,20 +38,15 @@ /* Define _XOPEN_SOURCE for Solaris and friends. */ /* NetBSD needs it to be >= 4 */ -#ifndef _XOPEN_SOURCE +#if !defined(_XOPEN_SOURCE) #if __STDC_VERSION__ >= 199901L -/* It is invalid to compile an XPG3, XPG4, XPG4v2 or XPG5 application using c99 */ +/* It is invalid to compile an XPG3, XPG4, XPG4v2 or XPG5 application using c99 on Solaris */ #define _XOPEN_SOURCE 600 #else #define _XOPEN_SOURCE 4 #endif #endif -/* Make sure things like readlink and such functions work. */ -#ifndef _XOPEN_SOURCE_EXTENDED -#define _XOPEN_SOURCE_EXTENDED 1 -#endif - /* include ICU headers */ #include "unicode/utypes.h" #include "unicode/putil.h" @@ -64,6 +59,14 @@ #include "locmap.h" #include "ucln_cmn.h" +/* Make sure things like readlink and such functions work. +Poorly upgraded Solaris machines can't have this defined. +Cleanly installed Solaris can use this #define. +*/ +#if !defined(_XOPEN_SOURCE_EXTENDED) && !defined(U_SOLARIS) +#define _XOPEN_SOURCE_EXTENDED 1 +#endif + /* Include standard headers. */ #include #include diff --git a/icu4c/source/config/mh-os390 b/icu4c/source/config/mh-os390 index 201e22e79da..d3268666150 100644 --- a/icu4c/source/config/mh-os390 +++ b/icu4c/source/config/mh-os390 @@ -58,7 +58,7 @@ SHAREDLIBCXXFLAGS = -Wc,expo # -+ means accept any file extension as a C++ file. By default only .C is accepted. CFLAGS += -Wc,'langlvl(extended),spill(2000),ros,dll' $(ICU_IEEE) CXXFLAGS += -Wc,'langlvl(extended),spill(2000),ros,dll' $(ICU_IEEE) -+ -DEFS += -D_XOPEN_SOURCE_EXTENDED -D_MSE_PROTOS +DEFS += -D_MSE_PROTOS ARFLAGS = -cr ifeq (${OS390_XPLINK}, 1)