]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/uposixdefs.h
2 *******************************************************************************
3 * Copyright (C) 2011-2015, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 *******************************************************************************
6 * file name: uposixdefs.h
8 * tab size: 8 (not used)
11 * created on: 2011jul25
12 * created by: Markus W. Scherer
14 * Common definitions for implementation files working with POSIX functions.
15 * *Important*: #include this file before any other header files!
18 #ifndef __UPOSIXDEFS_H__
19 #define __UPOSIXDEFS_H__
22 * Define _XOPEN_SOURCE for access to POSIX functions.
24 * We cannot use U_PLATFORM from platform.h/utypes.h because
25 * "The Open Group Base Specifications"
26 * chapter "2.2 The Compilation Environment" says:
27 * "In the compilation of an application that #defines a feature test macro
28 * specified by IEEE Std 1003.1-2001,
29 * no header defined by IEEE Std 1003.1-2001 shall be included prior to
30 * the definition of the feature test macro."
33 /* Use the predefined value. */
37 * The Open Group Base Specifications Issue 6 (IEEE Std 1003.1, 2004 Edition)
39 * SUSv3 = Open Group Single UNIX Specification, Version 3 (UNIX03)
41 * Note: This definition used to be in C source code (e.g., putil.c)
42 * and define _XOPEN_SOURCE to different values depending on __STDC_VERSION__.
43 * In C++ source code (e.g., putil.cpp), __STDC_VERSION__ is not defined at all.
45 # define _XOPEN_SOURCE 600
49 * Make sure things like readlink and such functions work.
50 * Poorly upgraded Solaris machines can't have this defined.
51 * Cleanly installed Solaris can use this #define.
53 * z/OS needs this definition for timeval and to get usleep.
55 #if !defined(_XOPEN_SOURCE_EXTENDED)
56 # define _XOPEN_SOURCE_EXTENDED 1
60 * There is an issue with turning on _XOPEN_SOURCE_EXTENDED on certain platforms.
61 * A compatibility issue exists between turning on _XOPEN_SOURCE_EXTENDED and using
62 * standard C++ string class. As a result, standard C++ string class needs to be
63 * turned off for the follwing platforms:
67 #if (U_PLATFORM == U_PF_AIX && !defined(__GNUC__)) || (U_PLATFORM == U_PF_SOLARIS && defined(__GNUC__))
68 # if _XOPEN_SOURCE_EXTENDED && !defined(U_HAVE_STD_STRING)
69 # define U_HAVE_STD_STRING 0
73 #endif /* __UPOSIXDEFS_H__ */