]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/uposixdefs.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 *******************************************************************************
5 * Copyright (C) 2011-2015, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 *******************************************************************************
8 * file name: uposixdefs.h
10 * tab size: 8 (not used)
13 * created on: 2011jul25
14 * created by: Markus W. Scherer
16 * Common definitions for implementation files working with POSIX functions.
17 * *Important*: #include this file before any other header files!
20 #ifndef __UPOSIXDEFS_H__
21 #define __UPOSIXDEFS_H__
24 * Define _XOPEN_SOURCE for access to POSIX functions.
26 * We cannot use U_PLATFORM from platform.h/utypes.h because
27 * "The Open Group Base Specifications"
28 * chapter "2.2 The Compilation Environment" says:
29 * "In the compilation of an application that #defines a feature test macro
30 * specified by IEEE Std 1003.1-2001,
31 * no header defined by IEEE Std 1003.1-2001 shall be included prior to
32 * the definition of the feature test macro."
35 /* Use the predefined value. */
39 * The Open Group Base Specifications Issue 6 (IEEE Std 1003.1, 2004 Edition)
41 * SUSv3 = Open Group Single UNIX Specification, Version 3 (UNIX03)
43 * Note: This definition used to be in C source code (e.g., putil.c)
44 * and define _XOPEN_SOURCE to different values depending on __STDC_VERSION__.
45 * In C++ source code (e.g., putil.cpp), __STDC_VERSION__ is not defined at all.
47 # define _XOPEN_SOURCE 600
51 * Make sure things like readlink and such functions work.
52 * Poorly upgraded Solaris machines can't have this defined.
53 * Cleanly installed Solaris can use this #define.
55 * z/OS needs this definition for timeval and to get usleep.
57 #if !defined(_XOPEN_SOURCE_EXTENDED) && defined(__TOS_MVS__)
58 # define _XOPEN_SOURCE_EXTENDED 1
63 * "...it is invalid to compile an XPG6 or a POSIX.1-2001 application with anything other
64 * than a c99 or later compiler."
65 * Apparently C++11 is not "or later". Work around this.
67 #if defined(__cplusplus) && (defined(sun) || defined(__sun)) && !defined (_STDC_C99)
71 #endif /* __UPOSIXDEFS_H__ */