]> git.saurik.com Git - apple/icu.git/blame - icuSources/common/unicode/platform.h.in
ICU-461.12.tar.gz
[apple/icu.git] / icuSources / common / unicode / platform.h.in
CommitLineData
b75a7d8f 1/*
374ca955 2******************************************************************************
b75a7d8f 3*
729e4ab9 4* Copyright (C) 1997-2010, International Business Machines
b75a7d8f
A
5* Corporation and others. All Rights Reserved.
6*
374ca955 7******************************************************************************
b75a7d8f 8*
729e4ab9
A
9* Note: autoconf creates platform.h from platform.h.in at configure time.
10*
11******************************************************************************
12*
b75a7d8f
A
13* FILE NAME : platform.h
14*
15* Date Name Description
16* 05/13/98 nos Creation (content moved here from ptypes.h).
17* 03/02/99 stephen Added AS400 support.
18* 03/30/99 stephen Added Linux support.
19* 04/13/99 stephen Reworked for autoconf.
374ca955 20******************************************************************************
b75a7d8f
A
21*/
22
729e4ab9
A
23#ifndef _PLATFORM_H
24#define _PLATFORM_H
25
73c04bcf
A
26/**
27 * \file
28 * \brief Basic types for the platform
29 */
30
729e4ab9
A
31/* This file should be included before uvernum.h. */
32#if defined(UVERNUM_H)
33# error Do not include unicode/uvernum.h before #including unicode/platform.h. Instead of unicode/uvernum.h, #include unicode/uversion.h
34#endif
35
36/**
37 * Determine wheter to enable auto cleanup of libraries.
38 * @internal
39 */
40#ifndef UCLN_NO_AUTO_CLEANUP
41#define UCLN_NO_AUTO_CLEANUP @UCLN_NO_AUTO_CLEANUP@
42#endif
43
44/* Need platform.h when using CYGWINMSVC to get definitions above. Ignore everything else. */
45#ifndef CYGWINMSVC
46
47/** Define the platform we're on. */
b75a7d8f
A
48#ifndef @platform@
49#define @platform@
50#endif
51
729e4ab9
A
52/**
53 * \def U_HAVE_DIRENT_H
54 * Define whether dirent.h is available
55 * @internal
56 */
57#ifndef U_HAVE_DIRENT_H
58#define U_HAVE_DIRENT_H @U_HAVE_DIRENT_H@
59#endif
60
61/** Define whether inttypes.h is available */
b75a7d8f
A
62#ifndef U_HAVE_INTTYPES_H
63#define U_HAVE_INTTYPES_H @U_HAVE_INTTYPES_H@
64#endif
65
729e4ab9 66/**
b75a7d8f 67 * Define what support for C++ streams is available.
729e4ab9 68 * If U_IOSTREAM_SOURCE is set to 199711, then <iostream> is available
b75a7d8f
A
69 * (1997711 is the date the ISO/IEC C++ FDIS was published), and then
70 * one should qualify streams using the std namespace in ICU header
71 * files.
729e4ab9 72 * If U_IOSTREAM_SOURCE is set to 198506, then <iostream.h> is
b75a7d8f
A
73 * available instead (198506 is the date when Stroustrup published
74 * "An Extensible I/O Facility for C++" at the summer USENIX conference).
75 * If U_IOSTREAM_SOURCE is 0, then C++ streams are not available and
76 * support for them will be silently suppressed in ICU.
77 *
78 */
79
80#ifndef U_IOSTREAM_SOURCE
81#define U_IOSTREAM_SOURCE @U_IOSTREAM_SOURCE@
82#endif
83
729e4ab9
A
84/**
85 * \def U_HAVE_STD_STRING
86 * Define whether the standard C++ (STL) <string> header is available.
87 * For platforms that do not use platform.h and do not define this constant
88 * in their platform-specific headers, std_string.h defaults
89 * U_HAVE_STD_STRING to 1.
90 * @internal
91 */
92#ifndef U_HAVE_STD_STRING
93#define U_HAVE_STD_STRING @U_HAVE_STD_STRING@
94#endif
95
96/** @{ Determines whether specific types are available */
b75a7d8f
A
97#ifndef U_HAVE_INT8_T
98#define U_HAVE_INT8_T @HAVE_INT8_T@
99#endif
100
101#ifndef U_HAVE_UINT8_T
102#define U_HAVE_UINT8_T @HAVE_UINT8_T@
103#endif
104
105#ifndef U_HAVE_INT16_T
106#define U_HAVE_INT16_T @HAVE_INT16_T@
107#endif
108
109#ifndef U_HAVE_UINT16_T
110#define U_HAVE_UINT16_T @HAVE_UINT16_T@
111#endif
112
113#ifndef U_HAVE_INT32_T
114#define U_HAVE_INT32_T @HAVE_INT32_T@
115#endif
116
117#ifndef U_HAVE_UINT32_T
118#define U_HAVE_UINT32_T @HAVE_UINT32_T@
119#endif
120
121#ifndef U_HAVE_INT64_T
122#define U_HAVE_INT64_T @HAVE_INT64_T@
123#endif
124
125#ifndef U_HAVE_UINT64_T
126#define U_HAVE_UINT64_T @HAVE_UINT64_T@
127#endif
128
729e4ab9 129/** @} */
b75a7d8f 130
374ca955 131/*===========================================================================*/
729e4ab9 132/** @{ Compiler and environment features */
374ca955
A
133/*===========================================================================*/
134
135/* Define whether namespace is supported */
136#ifndef U_HAVE_NAMESPACE
137#define U_HAVE_NAMESPACE @U_HAVE_NAMESPACE@
138#endif
139
140/* Determines the endianness of the platform
141 It's done this way in case multiple architectures are being built at once.
142 For example, Darwin supports fat binaries, which can be both PPC and x86 based. */
143#if defined(BYTE_ORDER) && defined(BIG_ENDIAN)
144#define U_IS_BIG_ENDIAN (BYTE_ORDER == BIG_ENDIAN)
145#else
146#define U_IS_BIG_ENDIAN @U_IS_BIG_ENDIAN@
147#endif
148
149/* 1 or 0 to enable or disable threads. If undefined, default is: enable threads. */
729e4ab9 150#ifndef ICU_USE_THREADS
374ca955 151#define ICU_USE_THREADS @ICU_USE_THREADS@
729e4ab9 152#endif
374ca955 153
46f4442e
A
154/* On strong memory model CPUs (e.g. x86 CPUs), we use a safe & quick double check lock. */
155#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
156#define UMTX_STRONG_MEMORY_MODEL 1
157#endif
158
374ca955
A
159#ifndef U_DEBUG
160#define U_DEBUG @ENABLE_DEBUG@
161#endif
162
163#ifndef U_RELEASE
164#define U_RELEASE @ENABLE_RELEASE@
165#endif
166
167/* Determine whether to disable renaming or not. This overrides the
168 setting in umachine.h which is for all platforms. */
169#ifndef U_DISABLE_RENAMING
170#define U_DISABLE_RENAMING @U_DISABLE_RENAMING@
171#endif
172
173/* Determine whether to override new and delete. */
174#ifndef U_OVERRIDE_CXX_ALLOCATION
175#define U_OVERRIDE_CXX_ALLOCATION @U_OVERRIDE_CXX_ALLOCATION@
176#endif
177/* Determine whether to override placement new and delete for STL. */
178#ifndef U_HAVE_PLACEMENT_NEW
179#define U_HAVE_PLACEMENT_NEW @U_HAVE_PLACEMENT_NEW@
180#endif
181
182/* Determine whether to enable tracing. */
183#ifndef U_ENABLE_TRACING
184#define U_ENABLE_TRACING @U_ENABLE_TRACING@
185#endif
186
729e4ab9
A
187/**
188 * Whether to enable Dynamic loading in ICU
189 * @internal
190 */
191#ifndef U_ENABLE_DYLOAD
192#define U_ENABLE_DYLOAD @U_ENABLE_DYLOAD@
193#endif
194
195/**
196 * Whether to test Dynamic loading as an OS capabilty
197 * @internal
198 */
199#ifndef U_CHECK_DYLOAD
200#define U_CHECK_DYLOAD @U_CHECK_DYLOAD@
201#endif
202
203
204/** Do we allow ICU users to use the draft APIs by default? */
73c04bcf
A
205#ifndef U_DEFAULT_SHOW_DRAFT
206#define U_DEFAULT_SHOW_DRAFT @U_DEFAULT_SHOW_DRAFT@
207#endif
208
729e4ab9 209/** @} */
374ca955 210
b75a7d8f 211/*===========================================================================*/
729e4ab9 212/** @{ Character data types */
b75a7d8f
A
213/*===========================================================================*/
214
73c04bcf 215#if ((defined(OS390) && (!defined(__CHARSET_LIB) || !__CHARSET_LIB))) || defined(OS400)
b75a7d8f
A
216# define U_CHARSET_FAMILY 1
217#endif
218
729e4ab9
A
219/** @} */
220
b75a7d8f 221/*===========================================================================*/
729e4ab9 222/** @{ Information about wchar support */
b75a7d8f
A
223/*===========================================================================*/
224
729e4ab9 225#ifndef U_HAVE_WCHAR_H
b75a7d8f 226#define U_HAVE_WCHAR_H @U_HAVE_WCHAR_H@
729e4ab9
A
227#endif
228
229#ifndef U_SIZEOF_WCHAR_T
b75a7d8f 230#define U_SIZEOF_WCHAR_T @U_SIZEOF_WCHAR_T@
729e4ab9 231#endif
b75a7d8f 232
729e4ab9 233#ifndef U_HAVE_WCSCPY
b75a7d8f 234#define U_HAVE_WCSCPY @U_HAVE_WCSCPY@
729e4ab9
A
235#endif
236
237/** @} */
b75a7d8f 238
46f4442e 239/**
729e4ab9 240 * @{
46f4442e
A
241 * \def U_DECLARE_UTF16
242 * Do not use this macro. Use the UNICODE_STRING or U_STRING_DECL macros
243 * instead.
244 * @internal
729e4ab9
A
245 *
246 * \def U_GNUC_UTF16_STRING
247 * @internal
46f4442e 248 */
729e4ab9
A
249#ifndef U_GNUC_UTF16_STRING
250#define U_GNUC_UTF16_STRING @U_CHECK_GNUC_UTF16_STRING@
251#endif
46f4442e
A
252#if @U_CHECK_UTF16_STRING@ || defined(U_CHECK_UTF16_STRING)
253#if (defined(__xlC__) && defined(__IBM_UTF_LITERAL) && U_SIZEOF_WCHAR_T != 2) \
254 || (defined(__HP_aCC) && __HP_aCC >= 035000) \
729e4ab9
A
255 || (defined(__HP_cc) && __HP_cc >= 111106) \
256 || U_GNUC_UTF16_STRING
46f4442e
A
257#define U_DECLARE_UTF16(string) u ## string
258#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550)
259/* || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x580) */
260/* Sun's C compiler has issues with this notation, and it's unreliable. */
261#define U_DECLARE_UTF16(string) U ## string
262#elif U_SIZEOF_WCHAR_T == 2 \
263 && (U_CHARSET_FAMILY == 0 || ((defined(OS390) || defined(OS400)) && defined(__UCS2__)))
264#define U_DECLARE_UTF16(string) L ## string
265#endif
266#endif
267
729e4ab9
A
268/** @} */
269
b75a7d8f 270/*===========================================================================*/
729e4ab9 271/** @{ Information about POSIX support */
b75a7d8f
A
272/*===========================================================================*/
273
729e4ab9 274#ifndef U_HAVE_NL_LANGINFO_CODESET
b75a7d8f 275#define U_HAVE_NL_LANGINFO_CODESET @U_HAVE_NL_LANGINFO_CODESET@
729e4ab9
A
276#endif
277
278#ifndef U_NL_LANGINFO_CODESET
b75a7d8f 279#define U_NL_LANGINFO_CODESET @U_NL_LANGINFO_CODESET@
729e4ab9 280#endif
b75a7d8f 281
374ca955 282#if @U_HAVE_TZSET@
b75a7d8f 283#define U_TZSET @U_TZSET@
b75a7d8f 284#endif
374ca955
A
285#if @U_HAVE_TIMEZONE@
286#define U_TIMEZONE @U_TIMEZONE@
287#endif
288#if @U_HAVE_TZNAME@
b75a7d8f 289#define U_TZNAME @U_TZNAME@
374ca955 290#endif
b75a7d8f
A
291
292#define U_HAVE_MMAP @HAVE_MMAP@
293#define U_HAVE_POPEN @U_HAVE_POPEN@
294
729e4ab9
A
295/** @} */
296
b75a7d8f 297/*===========================================================================*/
729e4ab9 298/** @{ Symbol import-export control */
b75a7d8f
A
299/*===========================================================================*/
300
46f4442e 301#if @U_USE_GCC_VISIBILITY_ATTRIBUTE@
73c04bcf 302#define U_EXPORT __attribute__((visibility("default")))
46f4442e
A
303#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
304 || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x550)
305#define U_EXPORT __global
306/*#elif defined(__HP_aCC) || defined(__HP_cc)
307#define U_EXPORT __declspec(dllexport)*/
73c04bcf 308#else
b75a7d8f 309#define U_EXPORT
73c04bcf
A
310#endif
311
b75a7d8f
A
312/* U_CALLCONV is releated to U_EXPORT2 */
313#define U_EXPORT2
314
315/* cygwin needs to export/import data */
729e4ab9 316#if defined(U_CYGWIN) && !defined(__GNUC__)
b75a7d8f
A
317#define U_IMPORT __declspec(dllimport)
318#else
319#define U_IMPORT
320#endif
321
729e4ab9
A
322/* @} */
323
b75a7d8f 324/*===========================================================================*/
729e4ab9 325/** @{ Code alignment and C function inlining */
b75a7d8f
A
326/*===========================================================================*/
327
328#ifndef U_INLINE
73c04bcf
A
329# ifdef __cplusplus
330# define U_INLINE inline
331# else
332# define U_INLINE @U_INLINE@
333# endif
b75a7d8f
A
334#endif
335
729e4ab9 336#ifndef U_ALIGN_CODE
b75a7d8f 337#define U_ALIGN_CODE(n)
729e4ab9
A
338#endif
339
340/** @} */
341
342/*===========================================================================*/
343/** @{ GCC built in functions for atomic memory operations */
344/*===========================================================================*/
345
346/**
347 * \def U_HAVE_GCC_ATOMICS
348 * @internal
349 */
350#ifndef U_HAVE_GCC_ATOMICS
351#define U_HAVE_GCC_ATOMICS @U_HAVE_GCC_ATOMICS@
352#endif
353
354/** @} */
b75a7d8f
A
355
356/*===========================================================================*/
729e4ab9 357/** @{ Programs used by ICU code */
b75a7d8f
A
358/*===========================================================================*/
359
729e4ab9
A
360/**
361 * \def U_MAKE
362 * What program to execute to run 'make'
363 */
364#ifndef U_MAKE
b75a7d8f 365#define U_MAKE "@U_MAKE@"
729e4ab9
A
366#endif
367
368/** @} */
369
370#endif /* CYGWINMSVC */
371
372/*===========================================================================*/
373/* Custom icu entry point renaming */
374/*===========================================================================*/
375
376/**
377 * Define the library suffix with C syntax.
378 * @internal
379 */
380# define U_LIB_SUFFIX_C_NAME @ICULIBSUFFIXCNAME@
381/**
382 * Define the library suffix as a string with C syntax
383 * @internal
384 */
385# define U_LIB_SUFFIX_C_NAME_STRING "@ICULIBSUFFIXCNAME@"
386/**
387 * 1 if a custom library suffix is set
388 * @internal
389 */
390# define U_HAVE_LIB_SUFFIX @U_HAVE_LIB_SUFFIX@
391
392#if U_HAVE_LIB_SUFFIX
393# ifndef U_ICU_ENTRY_POINT_RENAME
394/* Renaming pattern: u_strcpy_41_suffix */
395# define U_ICU_ENTRY_POINT_RENAME(x) x ## _ ## @LIB_VERSION_MAJOR@ ## @ICULIBSUFFIXCNAME@
396# define U_DEF_ICUDATA_ENTRY_POINT(major, minor) icudt##@ICULIBSUFFIXCNAME@##major##minor##_dat
397
398# endif
399#endif
400
401#endif