1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/common/uposixdefs.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,73 @@ 1.4 +/* 1.5 +******************************************************************************* 1.6 +* Copyright (C) 2011-2012, International Business Machines 1.7 +* Corporation and others. All Rights Reserved. 1.8 +******************************************************************************* 1.9 +* file name: uposixdefs.h 1.10 +* encoding: US-ASCII 1.11 +* tab size: 8 (not used) 1.12 +* indentation:4 1.13 +* 1.14 +* created on: 2011jul25 1.15 +* created by: Markus W. Scherer 1.16 +* 1.17 +* Common definitions for implementation files working with POSIX functions. 1.18 +* *Important*: #include this file before any other header files! 1.19 +*/ 1.20 + 1.21 +#ifndef __UPOSIXDEFS_H__ 1.22 +#define __UPOSIXDEFS_H__ 1.23 + 1.24 +/* 1.25 + * Define _XOPEN_SOURCE for access to POSIX functions. 1.26 + * 1.27 + * We cannot use U_PLATFORM from platform.h/utypes.h because 1.28 + * "The Open Group Base Specifications" 1.29 + * chapter "2.2 The Compilation Environment" says: 1.30 + * "In the compilation of an application that #defines a feature test macro 1.31 + * specified by IEEE Std 1003.1-2001, 1.32 + * no header defined by IEEE Std 1003.1-2001 shall be included prior to 1.33 + * the definition of the feature test macro." 1.34 + */ 1.35 +#ifdef _XOPEN_SOURCE 1.36 + /* Use the predefined value. */ 1.37 +#else 1.38 + /* 1.39 + * Version 6.0: 1.40 + * The Open Group Base Specifications Issue 6 (IEEE Std 1003.1, 2004 Edition) 1.41 + * also known as 1.42 + * SUSv3 = Open Group Single UNIX Specification, Version 3 (UNIX03) 1.43 + * 1.44 + * Note: This definition used to be in C source code (e.g., putil.c) 1.45 + * and define _XOPEN_SOURCE to different values depending on __STDC_VERSION__. 1.46 + * In C++ source code (e.g., putil.cpp), __STDC_VERSION__ is not defined at all. 1.47 + */ 1.48 +# define _XOPEN_SOURCE 600 1.49 +#endif 1.50 + 1.51 +/* 1.52 + * Make sure things like readlink and such functions work. 1.53 + * Poorly upgraded Solaris machines can't have this defined. 1.54 + * Cleanly installed Solaris can use this #define. 1.55 + * 1.56 + * z/OS needs this definition for timeval and to get usleep. 1.57 + */ 1.58 +#if !defined(_XOPEN_SOURCE_EXTENDED) 1.59 +# define _XOPEN_SOURCE_EXTENDED 1 1.60 +#endif 1.61 + 1.62 +/* 1.63 + * There is an issue with turning on _XOPEN_SOURCE_EXTENDED on certain platforms. 1.64 + * A compatibility issue exists between turning on _XOPEN_SOURCE_EXTENDED and using 1.65 + * standard C++ string class. As a result, standard C++ string class needs to be 1.66 + * turned off for the follwing platforms: 1.67 + * -AIX/VACPP 1.68 + * -Solaris/GCC 1.69 + */ 1.70 +#if (U_PLATFORM == U_PF_AIX && !defined(__GNUC__)) || (U_PLATFORM == U_PF_SOLARIS && defined(__GNUC__)) 1.71 +# if _XOPEN_SOURCE_EXTENDED && !defined(U_HAVE_STD_STRING) 1.72 +# define U_HAVE_STD_STRING 0 1.73 +# endif 1.74 +#endif 1.75 + 1.76 +#endif /* __UPOSIXDEFS_H__ */