BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bsls_platform.h
Go to the documentation of this file.
1/// @file bsls_platform.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bsls_platform.h -*-C++-*-
8#ifndef INCLUDED_BSLS_PLATFORM
9#define INCLUDED_BSLS_PLATFORM
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bsls_platform bsls_platform
15/// @brief Provide compile-time support for platform/attribute identification.
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bsls
19/// @{
20/// @addtogroup bsls_platform
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bsls_platform-purpose"> Purpose</a>
25/// * <a href="#bsls_platform-classes"> Classes </a>
26/// * <a href="#bsls_platform-macros"> Macros </a>
27/// * <a href="#bsls_platform-description"> Description </a>
28/// * <a href="#bsls_platform-aggressive-inlining"> Aggressive Inlining </a>
29/// * <a href="#bsls_platform-forcing-a-compiler-error"> Forcing a Compiler Error </a>
30/// * <a href="#bsls_platform-windows-subtypes-explained"> Windows Subtypes Explained </a>
31/// * <a href="#bsls_platform-usage"> Usage </a>
32///
33/// # Purpose {#bsls_platform-purpose}
34/// Provide compile-time support for platform/attribute identification.
35///
36/// # Classes {#bsls_platform-classes}
37///
38/// - bsls::Platform: namespace for platform traits
39///
40/// # Macros {#bsls_platform-macros}
41///
42/// - BSLS_PLATFORM_OS_*: operating system type, sub-type, and version
43/// - BSLS_PLATFORM_CPU_*: instruction set, instruction width, and version
44/// - BSLS_PLATFORM_CMP_*: compiler vendor, and version
45/// - BSLS_PLATFORM_COMPILER_ERROR: trigger a compiler error
46/// - BSLS_PLATFORM_AGGRESSIVE_INLINE: inline code for speed over text size
47///
48/// @see bsls_compilerfeatures, bsls_libraryfeatures
49///
50/// # Description {#bsls_platform-description}
51/// This component implements a suite of preprocessor macros and
52/// traits that identify and define platform-specific compile-time attributes.
53/// These attributes consist of the types and versions of (1) the operating
54/// system, (2) the processor(s), and (3) the compiler that together make up the
55/// platform. Many of the macros defined in this component are configured
56/// automatically at compile-time; compile-time switches are used to configure
57/// the rest. Note that compiler capabilities are better determined through the
58/// @ref bsls_compilerfeatures and @ref bsls_libraryfeatures components; this
59/// component focuses on just identifying the tool chain.
60///
61/// Note that, for brevity, the `@` character in the following (alphabetically
62/// organized) tables is used to represent the characters `BSLS_PLATFORM` --
63/// e.g., `@_OS_UNIX` represents `BSLS_PLATFORM_OS_UNIX`:
64/// @code
65/// =============================================================
66/// OPERATING SYSTEM
67/// -------------------------------------------------------------
68/// Type Subtype Version
69/// ----------------- ------------------- -----------------
70/// @_OS_UNIX @_OS_LINUX @_OS_VER_MAJOR
71/// @_OS_FREEBSD @_OS_VER_MINOR
72/// @_OS_SOLARIS
73/// @_OS_CYGWIN
74/// @_OS_DARWIN
75///
76/// @_OS_WINDOWS @_OS_WINNT
77/// @_OS_WIN9X
78/// @_OS_WIN2K
79/// @_OS_WINXP
80/// @_OS_WINS03
81/// @_OS_WINS08 -- alias to Vista
82/// @_OS_WINVISTA
83/// @_OS_WIN7
84/// @_OS_WIN8
85/// @_OS_WINBLUE
86/// @_OS_WIN10
87///
88/// Please see also {Windows Subtypes Explained}.
89///
90/// ============================================================
91/// PROCESSOR
92/// ------------------------------------------------------------
93/// Instruction Set Width Version
94/// ----------------- ------------------ ----------------
95/// @_CPU_ALPHA @_CPU_32_BIT @_CPU_VER_MAJOR
96/// @_CPU_HPPA @_CPU_64_BIT
97/// @_CPU_X86
98/// @_CPU_IA64
99/// @_CPU_X86_64
100/// @_CPU_MIPS
101/// @_CPU_POWERPC
102/// @_CPU_SPARC
103/// @_CPU_ARM
104///
105/// =============================================================
106/// COMPILER
107/// -------------------------------------------------------------
108/// Vendor Version
109/// ----------------- ------------------
110/// @_CMP_CLANG @_CMP_VERSION
111/// @_CMP_EDG @_CMP_VER_MAJOR (deprecated)
112/// @_CMP_GNU
113/// @_CMP_MSVC
114/// @_CMP_SUN
115///
116/// =============================================================
117///
118/// =============================================================
119/// ENSURE A COMPILER ERROR FOR UNSUPPORTED PLATFORMS
120/// --------------------------------------------------------------
121/// Macro
122/// ---------------
123/// @_COMPILER_ERROR
124///
125/// =============================================================
126///
127/// =============================================================
128/// INLINING
129/// -------------------------------------------------------------
130/// Macro
131/// -----------------
132/// @_AGGRESSIVE_INLINE
133///
134/// =============================================================
135/// @endcode
136/// These macros are configured automatically, where possible. At a minimum,
137/// the generic operating system type (i.e., either `BSLS_PLATFORM_OS_UNIX` or
138/// `BSLS_PLATFORM_OS_WINDOWS`) is defined along with exactly one processor
139/// macro (e.g., `BSLS_PLATFORM_CPU_SPARC`) and exactly one compiler macro
140/// (e.g., `BSLS_PLATFORM_CMP_SUN`). Clients may need to supply additional
141/// macros (controlled via the `-D` option of a compiler) if further
142/// discrimination is required (e.g., based on sub-type or version of a specific
143/// operating system, processor, or compiler). Note that supplying a minor
144/// version number implies that the major version is also defined.
145///
146/// ## Aggressive Inlining {#bsls_platform-aggressive-inlining}
147///
148///
149/// The aggressive inlining macro `BSLS_PLATFORM_AGGRESSIVE_INLINE` is defined
150/// as the `inline` keyword on all compilers except `BSLS_PLATFORM_CMP_SUN`,
151/// where it is left empty. This is required for some of our legacy
152/// applications where substantially growing the text size is not possible.
153/// Even on those platforms, the symbol will be defined as `inline` if
154/// `BDE_BUILD_TARGET_AGGRESSIVE_INLINE` is passed in via the `-D` option of the
155/// compiler.
156///
157/// ## Forcing a Compiler Error {#bsls_platform-forcing-a-compiler-error}
158///
159///
160/// The compiler-error triggering macro `BSLS_PLATFORM_COMPILER_ERROR` is
161/// defined to a sequence of tokens that guarantees a compilation error on every
162/// supported compiler. This is necessary because not all compilers will
163/// respect the fairly obvious goal of the `#error` preprocessor directive even
164/// though they support it, and just issue a warning (claiming that the C++
165/// standard does not make a difference between a warning and an error, it knows
166/// only about diagnostic messages). Code using @ref bsls_platform macros will
167/// often want to prevent compilation for unsupported platforms, hence this
168/// component provides a macro that can be used to ensure that.
169///
170/// ## Windows Subtypes Explained {#bsls_platform-windows-subtypes-explained}
171///
172///
173/// Windows Subtypes describe what API variation the code is built to target,
174/// not the actual operating system it will run on, with the following mapping
175/// between the macro names and Windows API versions:
176/// @code
177/// MACRO Targeted API Version & Notes Officially supported?
178/// ------------- ---------------------------- ---------------------
179/// @_OS_WINNT NT 4.0 NO
180/// @_OS_WIN9X 95, 98, ME NO
181/// @_OS_WIN2K 2000 NO
182/// @_OS_WINXP XP NO
183/// @_OS_WINS03 Server 2003 NO
184/// @_OS_WINS08 Server 2008, same as Vista yes
185/// @_OS_WINVISTA Vista yes
186/// @_OS_WIN7 7 yes
187/// @_OS_WIN8 8 yes
188/// @_OS_WINBLUE 8.1 yes
189/// @_OS_WIN10 10 yes
190/// @endcode
191/// Note that Vista is the default targeted API.
192///
193/// ## Usage {#bsls_platform-usage}
194///
195///
196/// Writing portable software sometimes involves specializing implementations to
197/// work with platform-specific interfaces. For example, a socket-level
198/// communications framework would need to operate differently on a platform
199/// having a Windows operating system than on one having a Unix one (but it is
200/// probably unnecessary to distinguish between their respective versions):
201/// @code
202/// // my_socket.h
203/// #include <bsls_platform.h>
204///
205/// #ifdef BSLS_PLATFORM_OS_WINDOWS
206/// #ifndef INCLUDED_WINSOCK2
207/// #include <winsock2.h>
208/// #define INCLUDED_WINSOCK2
209/// #endif
210/// #endif
211///
212/// class my_Socket {
213///
214/// #ifdef BSLS_PLATFORM_OS_WINDOWS
215/// SOCKET d_socketObject; // Windows SOCKET handle
216/// #else
217/// int d_socketObject; // Unix socket descriptor
218/// #endif
219///
220/// // ...
221///
222/// };
223/// @endcode
224/// Certain compile-time constants are also provided as preprocessor macros that
225/// encapsulate the capability of determining whether a machine is big-endian or
226/// little-endian across all supported platforms:
227/// @code
228/// BSLS_PLATFORM_IS_BIG_ENDIAN
229/// BSLS_PLATFORM_IS_LITTLE_ENDIAN
230/// @endcode
231/// These macros are useful for writing platform-independent code, such as a
232/// function that converts the bytes in a `short` to network byte order (which
233/// is consistent with big-endian):
234/// @code
235/// short convertToNetworkByteOrder(short input)
236/// // Return the specified 'input' in network byte order.
237/// {
238/// #ifdef BSLS_PLATFORM_IS_BIG_ENDIAN
239/// return input;
240/// #else
241/// return ((input >> 8) & 0xFF) | ((input & 0xFF) << 8);
242/// #endif
243/// }
244/// @endcode
245/// @}
246/** @} */
247/** @} */
248
249/** @addtogroup bsl
250 * @{
251 */
252/** @addtogroup bsls
253 * @{
254 */
255/** @addtogroup bsls_platform
256 * @{
257 */
258
259#ifdef __cplusplus
260
261#endif
262
263 // ===========================
264 // struct bsls_Platform_Assert
265 // ===========================
266
267struct bsls_Platform_Assert;
268 // This 'struct' is declared but not defined. It is used with the 'sizeof'
269 // operator to force a compile-time error on platforms that do not support
270 // '#error'. For example:
271 //..
272 // char die[sizeof(bsls_Platform_Assert)]; // if '#error' unsupported
273 //..
274
275#ifdef __cplusplus
276
277#endif
278
279// Use this macro to trigger a compile-time error if '#error' is not supported.
280#ifdef __cplusplus
281 #define BSLS_PLATFORM_COMPILER_ERROR \
282 char die[sizeof(::BloombergLP::bsls_Platform_Assert)]
283#else
284 #define BSLS_PLATFORM_COMPILER_ERROR char die[sizeof(bsls_Platform_Assert)]
285#endif
286
287 // Automatic Configuration
288
289// IMPLEMENTATION NOTE: The following attempts to configure the system
290// automatically, setting as many of the macros listed in the table above as
291// possible. Since the automatic configuration is based upon the macros set by
292// the compiler, the outer-most level of detection will be driven by whatever
293// compiler is in use. Once the compiler has been determined, the
294// automatic-configuration process will attempt to determine the OS and finally
295// the CPU. At the end of the section for each compiler, the macros that have
296// been defined automatically will be "sanity-checked" (for consistency)
297// against other macros set by the compiler. The order of the statements in
298// the process is the same as that in the table above, which is also
299// alphabetical. Any changes to the list of supported compilers should
300// preserve the alphabetical order of the table, inserting the necessary
301// configuration logic in the preprocessor statements below.
302
303// ----------------------------------------------------------------------------
304#if defined(_MSC_VER)
305 #define BSLS_PLATFORM_CMP_MSVC 1
306 #define BSLS_PLATFORM_CMP_VERSION _MSC_VER
307
308 // which OS -- should be some flavor of Windows
309 // there is currently no support for:
310 // - 16-bit versions of Windows (3.x)
311 // - Windows CE
312 #if defined(_WIN64) || defined(_WIN32)
313 #define BSLS_PLATFORM_OS_WINDOWS 1
314 #elif defined(_WIN16)
315 #error "16-bit Windows platform not supported."
317 #else
318 #error "Microsoft OS is running on an unknown platform."
320 #endif
321
322 // which version of Windows, source sampled 2022.Dec.26 18:00EST:
323 // https://learn.microsoft.com/en-us/cpp/porting/ ...
324 // ... modifying-winver-and-win32-winnt
325 #if _WIN32_WINNT >= 0x0A00
326 #define BSLS_PLATFORM_OS_WIN10 1
327 #elif _WIN32_WINNT >= 0x0603
328 #define BSLS_PLATFORM_OS_WINBLUE 1
329 #elif _WIN32_WINNT >= 0x0602
330 #define BSLS_PLATFORM_OS_WIN8 1
331 #elif _WIN32_WINNT >= 0x0601
332 #define BSLS_PLATFORM_OS_WIN7 1
333 #elif _WIN32_WINNT >= 0x0600
334 #define BSLS_PLATFORM_OS_WINVISTA 1
335 #elif _WIN32_WINNT >= 0x0502
336 #define BSLS_PLATFORM_OS_WINS03 1
337 #elif _WIN32_WINNT >= 0x0501
338 #define BSLS_PLATFORM_OS_WINXP 1
339 #elif _WIN32_WINNT >= 0x0500
340 #define BSLS_PLATFORM_OS_WIN2K 1
341 #elif _WIN32_WINNT >= 0x0410
342 #define BSLS_PLATFORM_OS_WIN9X 1
343 #elif _WIN32_WINNT >= 0x0400
344 #define BSLS_PLATFORM_OS_WINNT 1
345 #elif defined(WINVER) && WINVER >= 0x0400 \
346 || defined(_WIN32_WINDOWS) && _WIN32_WINDOWS >= 0x401
347 #define BSLS_PLATFORM_OS_WIN9X 1
348 #else // default when detection fails
349 #define BSLS_PLATFORM_OS_WINVISTA 1
350 #endif
351
352 // set API Version synonyms
353 #if defined(BSLS_PLATFORM_OS_WINVISTA) && !defined(BSLS_PLATFORM_OS_WINS08)
354 #define BSLS_PLATFORM_OS_WINS08 1
355 // Windows Server 2008 is the same API as Windows Vista
356 #endif
357 #if !defined(BSLS_PLATFORM_OS_WINVISTA) && defined(BSLS_PLATFORM_OS_WINS08)
358 #define BSLS_PLATFORM_OS_WINVISTA 1
359 // Windows Server 2008 is the same API as Windows Vista
360 #endif
361
362 // set Version flags
363 #if defined(_WIN32_WINNT)
364 #define BSLS_PLATFORM_OS_VER_MAJOR _WIN32_WINNT / 0x100
365 #define BSLS_PLATFORM_OS_VER_MINOR _WIN32_WINNT % 0x100
366 #elif defined(WINVER)
367 #define BSLS_PLATFORM_OS_VER_MAJOR WINVER / 0x100
368 #define BSLS_PLATFORM_OS_VER_MINOR WINVER % 0x100
369 #elif defined(_WIN32_WINDOWS)
370 #define BSLS_PLATFORM_OS_VER_MAJOR _WIN32_WINDOWS / 0x100
371 #define BSLS_PLATFORM_OS_VER_MINOR _WIN32_WINDOWS % 0x100
372 #else // default
373 #define BSLS_PLATFORM_OS_VER_MAJOR 4
374 #define BSLS_PLATFORM_OS_VER_MINOR 0
375 #endif
376
377 // which CPU
378 // since WinCE is not supported, neither is the HITACHI CPU
379 #if defined(_M_ALPHA)
380 #define BSLS_PLATFORM_CPU_ALPHA 1
381 #elif defined(_M_IX86)
382 #define BSLS_PLATFORM_CPU_X86 1
383 #define BSLS_PLATFORM_CPU_32_BIT 1
384 #define BSLS_PLATFORM_CPU_VER_MAJOR _M_IX86
385 #elif defined(_M_IA64)
386 #if defined(_WIN64) // native mode
387 #define BSLS_PLATFORM_CPU_IA64 1
388 #define BSLS_PLATFORM_CPU_64_BIT 1
389 #else // emulated
390 #define BSLS_PLATFORM_CPU_X86 1
391 #define BSLS_PLATFORM_CPU_32_BIT 1
392 #endif
393 #define BSLS_PLATFORM_CPU_VER_MAJOR _M_IA64
394 #elif defined(_M_AMD64)
395 #if defined(_WIN64) // native mode
396 #define BSLS_PLATFORM_CPU_X86_64 1
397 #define BSLS_PLATFORM_CPU_64_BIT 1
398 #else // emulated
399 #define BSLS_PLATFORM_CPU_X86 1
400 #define BSLS_PLATFORM_CPU_32_BIT 1
401 #endif
402 #define BSLS_PLATFORM_CPU_VER_MAJOR _M_AMD64
403 #elif defined(_M_PPC)
404 #define BSLS_PLATFORM_CPU_POWERPC 1
405 #define BSLS_PLATFORM_CPU_VER_MAJOR _M_PPC
406 #elif defined(_M_MRX000)
407 #define BSLS_PLATFORM_CPU_MIPS 1
408 #define BSLS_PLATFORM_CPU_VER_MAJOR _M_MRX000
409 #elif defined(_M_ARM)
410 #define BSLS_PLATFORM_CPU_ARM 1
411 #define BSLS_PLATFORM_CPU_32_BIT 1
412
413 // MSVC doesn't provide macros for differentiating version, but the
414 // minimum supported one is ARMv7
415 #define BSLS_PLATFORM_CPU_ARM_V7 1
416 #elif defined(_M_ARM64)
417 #define BSLS_PLATFORM_CPU_ARM 1
418 #define BSLS_PLATFORM_CPU_64_BIT 1
419
420 // MSVC doesn't provide macros for differentiating version, but the
421 // minimum supported one is ARMv7
422 #define BSLS_PLATFORM_CPU_ARM_V7 1
423 #else
424 #error "Unable to identify CPU on which the MSVC compiler is running."
426 #endif
427
428// ---------------------------------------------------------------------------
429#elif defined(__clang__) || defined(__GNUC__) || defined(__EDG__)
430
431 #if defined(__clang__)
432 // Clang presents itself as GCC compatible, but sets the pre-defined
433 // GCC version macros ('__GNUC__', '__GNUC_MINOR__', and
434 // '__GNUC_PATCHLEVEL__') to version 4.2.1 no matter the version of
435 // Clang being used. In order to differentiate between Clang and GCC,
436 // the compilers are identified by independent 'BSLS_PLATFORM' macros.
437 // Apple Xcode is based upon LLVM (Clang), but Apple changes the
438 // reported Clang versioning ('__clang_major__', '__clang_minor__',
439 // '__clang_patchlevel__') to report the Xcode version rather than the
440 // actual version of Clang the Xcode release includes. A table of
441 // Xcode/Clang version information is maintained here:
442 // https://trac.macports.org/wiki/XcodeVersionInfo To avoid this extra
443 // dimension, the Clang intrinsics '__has_builtin', '__has_feature',
444 // and '__has_extension' should be used in preference to
445 // 'BSLS_PLATFORM_CMP_VERSION' when checking for compiler features. If
446 // 'BSLS_PLATFORM_CMP_VERSION' must be used,
447 // then '__apple_build_version__' can be tested to determine if
448 // 'BSLS_PLATFORM_CMP_VERSION' represents Clang LLVM or Apple Xcode
449 // version. (Note that the `__APPLE_CC__` macro identifies that the
450 // target operating system is Darwin based, *not* that the compiler is
451 // Apple-made. 3rd party built LLVM compilers (brew.sh, MacPorts, or
452 // built-from-source LLVM) all define that macro if the compilation
453 // targets Darwin.)
454
455 #define BSLS_PLATFORM_CMP_CLANG 1
456 #define BSLS_PLATFORM_CMP_VERSION ( __clang_major__ * 10000 \
457 + __clang_minor__ * 100 \
458 + __clang_patchlevel__ )
459 #elif defined (__GNUC__)
460 #define BSLS_PLATFORM_CMP_GNU 1
461 #if defined(__GNUC_PATCHLEVEL__)
462 #define BSLS_PLATFORM_CMP_VERSION (__GNUC__ * 10000 \
463 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
464 #else
465 #define BSLS_PLATFORM_CMP_VERSION (__GNUC__ * 10000 \
466 + __GNUC_MINOR__ * 100)
467 #endif
468 #else
469 #define BSLS_PLATFORM_CMP_EDG 1
470 #define BSLS_PLATFORM_CMP_VERSION __EDG_VERSION__
471 #endif
472
473 // which OS -- GNU and EDG/Como are implemented almost everywhere
474 #if defined(__CYGWIN__) || defined(cygwin) || defined(__cygwin)
475 #define BSLS_PLATFORM_OS_CYGWIN 1
476 #elif defined(linux) || defined(__linux)
477 #define BSLS_PLATFORM_OS_LINUX 1
478 #elif defined(__FreeBSD__)
479 #define BSLS_PLATFORM_OS_FREEBSD 1
480 #elif defined(sun) || defined(__sun)
481 #if defined(__SVR4) || defined(__svr4__)
482 #define BSLS_PLATFORM_OS_SOLARIS 1
483 #endif
484 #elif defined(_WIN32) || defined(__WIN32__) && \
485 !(defined(cygwin) || defined(__cygwin))
486 #define BSLS_PLATFORM_OS_WINDOWS 1
487 #elif defined(__APPLE__)
488 #define BSLS_PLATFORM_OS_DARWIN 1
489 #else
490 #if defined(__GNUC__)
491 #error "Unable to determine on which OS the compiler is running."
492 #else
493 #error "Unable to determine on which OS EDG compiler is running."
494 #endif
496 #endif
497
498 #if !defined(BSLS_PLATFORM_OS_WINDOWS)
499 #define BSLS_PLATFORM_OS_UNIX 1
500 #endif
501
502 // which CPU -- GNU and EDG/Como are implemented almost everywhere
503 #if defined(__alpha__)
504 #define BSLS_PLATFORM_CPU_ALPHA 1
505 #elif defined(__x86_64) || defined(__x86_64__)
506 #define BSLS_PLATFORM_CPU_X86_64 1
507 #define BSLS_PLATFORM_CPU_64_BIT 1
508 #elif defined(__i386) || defined(__i386__) \
509 || defined(__ix86) || defined(__ix86__)
510 #define BSLS_PLATFORM_CPU_X86 1
511 #define BSLS_PLATFORM_CPU_32_BIT 1
512 #elif defined(__ia64) || defined(__ia64__) || defined(_IA64) \
513 || defined(__IA64__)
514 #define BSLS_PLATFORM_CPU_IA64 1
515 #if defined(_LP64) || defined(__LP64__)
516 #define BSLS_PLATFORM_CPU_64_BIT 1
517 #else // defined(_ILP32)
518 #define BSLS_PLATFORM_CPU_32_BIT 1
519 #endif
520 #elif defined(__mips__)
521 #define BSLS_PLATFORM_CPU_MIPS 1
522 #elif defined(__hppa__) || defined(__hppa)
523 #define BSLS_PLATFORM_CPU_HPPA 1
524 #elif defined(__powerpc) || defined(__powerpc__) \
525 || defined(__POWERPC__) || defined(__ppc__) || defined(_POWER)
526 #define BSLS_PLATFORM_CPU_POWERPC 1
527 #if defined(__64BIT__) || defined(_LP64) || defined(__LP64__)
528 #define BSLS_PLATFORM_CPU_64_BIT 1
529 #else // defined(_ILP32)
530 #define BSLS_PLATFORM_CPU_32_BIT 1
531 #endif
532 #elif defined(__sparc__) || defined(__sparc_v9__) || defined(__sparcv9)
533 #define BSLS_PLATFORM_CPU_SPARC 1
534 #if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)
535 #define BSLS_PLATFORM_CPU_SPARC_V9 1
536 #define BSLS_PLATFORM_CPU_64_BIT 1
537 #else
538 #define BSLS_PLATFORM_CPU_SPARC_32 1
539 #endif
540 #elif defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
541 #define BSLS_PLATFORM_CPU_ARM 1
542 #if defined(__arm64__) || defined(__aarch64__)
543 #define BSLS_PLATFORM_CPU_64_BIT 1
544 #endif
545 #if defined(__ARM_ARCH)
546 #if __ARM_ARCH == 6
547 #define BSLS_PLATFORM_CPU_ARM_V6 1
548 #elif __ARM_ARCH == 7
549 #define BSLS_PLATFORM_CPU_ARM_V7 1
550 #elif __ARM_ARCH == 8
551 #define BSLS_PLATFORM_CPU_ARM_V8 1
552 #endif
553 #elif defined(__ARM_ARCH_5T__) \
554 || defined(__ARM_ARCH_5TE__) \
555 || defined(__ARM_ARCH_5TEJ__)
556 #define BSLS_PLATFORM_CPU_ARM_V5
557 #elif defined(__ARM_ARCH_6__) || defined (__ARM_ARCH_6ZK__)
558 #define BSLS_PLATFORM_CPU_ARM_V6
559 #elif defined(__ARM_ARCH_7__) \
560 || defined(__ARM_ARCH_7A__) \
561 || defined(__ARM_ARCH_7M__) \
562 || defined(__ARM_ARCH_7R__)
563 #define BSLS_PLATFORM_CPU_ARM_V7
564 #elif defined(__ARM64_ARCH_8__) \
565 || defined(__ARM_ARCH_8_3__) \
566 || defined(__ARM_ARCH_8_4__) \
567 || defined(__ARM_ARCH_8_5__)
568 #define BSLS_PLATFORM_CPU_ARM_V8
569 #else
570 #error "Unsupported ARM platform."
571 #endif
572 #else
573 #if defined(__GNUC__)
574 #error "Unable to determine on which CPU the compiler is running."
575 #else
576 #error "Unable to determine on which CPU EDG compiler is running."
577 #endif
579 #endif
580
581 #if !defined(BSLS_PLATFORM_CPU_64_BIT)
582 #define BSLS_PLATFORM_CPU_32_BIT 1
583 #endif
584// ----------------------------------------------------------------------------
585#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
586
587 #define BSLS_PLATFORM_CMP_SUN 1
588 #if defined(__cplusplus)
589 #define BSLS_PLATFORM_CMP_VERSION __SUNPRO_CC
590 #else
591 #define BSLS_PLATFORM_CMP_VERSION __SUNPRO_C
592 #endif
593
594 // which OS
595 #define BSLS_PLATFORM_OS_UNIX 1
596 #if defined(sun) || defined(__sun)
597 #define BSLS_PLATFORM_OS_SOLARIS 1
598 #if defined(__SVR4) || defined(__svr4__)
599 #if defined(__SunOS_5_10)
600 #define BSLS_PLATFORM_OS_VER_MAJOR 10
601 #define BSLS_PLATFORM_OS_VER_MINOR 0
602 #elif defined(__SunOS_5_11)
603 #define BSLS_PLATFORM_OS_VER_MAJOR 11
604 #define BSLS_PLATFORM_OS_VER_MINOR 0
605 #else
606 #define BSLS_PLATFORM_OS_VER_MAJOR 1
607 #define BSLS_PLATFORM_OS_VER_MINOR 0
608 #endif
609 #else
610 #error "Unable to determine Solaris OS version."
612 #endif
613 #else
614 #error "Unable to determine SUN OS version."
616 #endif
617
618 // determine which CPU
619 #if defined(__x86_64) || defined(__x86_64__)
620 #define BSLS_PLATFORM_CPU_X86_64 1
621 #define BSLS_PLATFORM_CPU_64_BIT 1
622 #elif defined(i386) || defined(__i386)
623 #define BSLS_PLATFORM_CPU_X86 1
624 #define BSLS_PLATFORM_CPU_32_BIT 1
625 #elif defined(__sparc64) || defined(__sparcv9)
626 #define BSLS_PLATFORM_CPU_SPARC 1
627 #define BSLS_PLATFORM_CPU_SPARC_V9 1
628 #define BSLS_PLATFORM_CPU_64_BIT 1
629 #elif defined(sparc) || defined(__sparc)
630 #define BSLS_PLATFORM_CPU_SPARC 1
631 #define BSLS_PLATFORM_CPU_SPARC_32 1
632 #define BSLS_PLATFORM_CPU_32_BIT 1
633 #else
634 #error "Cannot determine CPU on which the SUN compiler is running."
636 #endif
637// ---------------------------------------------------------------------------
638#else
639 #error "Could not identify the compiler."
641#endif
642// ----------------------------------------------------------------------------
643
644// Determine endianness.
645
646// GNU libc or Linux or Cygwin
647#if defined(BSLS_PLATFORM_OS_LINUX) || defined(BSLS_PLATFORM_OS_CYGWIN) \
648 || defined(__GLIBC__)
649
650 #include <endian.h>
651 #if (__BYTE_ORDER == __LITTLE_ENDIAN)
652 #define BSLS_PLATFORM_IS_LITTLE_ENDIAN 1
653 #elif (__BYTE_ORDER == __BIG_ENDIAN)
654 #define BSLS_PLATFORM_IS_BIG_ENDIAN 1
655 #endif
656
657// Sun/Solaris
658#elif defined(BSLS_PLATFORM_OS_SOLARIS)
659 #include <sys/isa_defs.h>
660 #if defined(_LITTLE_ENDIAN)
661 #define BSLS_PLATFORM_IS_LITTLE_ENDIAN 1
662 #elif defined(_BIG_ENDIAN)
663 #define BSLS_PLATFORM_IS_BIG_ENDIAN 1
664 #endif
665
666// Darwin
667#elif defined(BSLS_PLATFORM_OS_DARWIN)
668 #include <machine/endian.h>
669 #if BYTE_ORDER == LITTLE_ENDIAN
670 #define BSLS_PLATFORM_IS_LITTLE_ENDIAN 1
671 #elif BYTE_ORDER == BIG_ENDIAN
672 #define BSLS_PLATFORM_IS_BIG_ENDIAN 1
673 #endif
674
675// MSVC and Windows
676#elif defined(BSLS_PLATFORM_OS_WINDOWS)
677 #define BSLS_PLATFORM_IS_LITTLE_ENDIAN 1
678#endif
679
680// Endianness sanity check is done further in this header.
681
682// ----------------------------------------------------------------------------
683
684 // Detect Supported Platform
685
686#if !defined(BDE_DISABLE_COMPILER_VERSION_CHECK)
687
688#if defined(BSLS_PLATFORM_CMP_CLANG)
689 // No minimum supported compiler version has been identified yet.
690#elif defined(BSLS_PLATFORM_CMP_EDG)
691 // No minimum supported compiler version has been identified yet.
692#elif defined(BSLS_PLATFORM_CMP_SUN)
693 #if BSLS_PLATFORM_CMP_VERSION < 0x5120
694 #error This early compiler is not supported by BDE
695 #endif
696#elif defined(BSLS_PLATFORM_CMP_GNU)
697 // Test GNU late, as so many compilers offer a GNU compatibility mode.
698 #if BSLS_PLATFORM_CMP_VERSION < 40102
699 #error This early compiler is not supported by BDE
700 #endif
701#elif defined(BSLS_PLATFORM_CMP_MSVC)
702 // Test MSVC last, as many compilers targeting Windows offer a Microsoft
703 // compatibility mode.
704 #if BSLS_PLATFORM_CMP_VERSION < 1800
705 #error This early compiler is not supported by BDE
706 #endif
707#else
708 #error This compiler is not recognized by BDE
709#endif
710
711#endif
712
713#ifdef BSLS_PLATFORM_CMP_VERSION
714/// This deprecated macro is defined for backwards compatibility only.
715 #define BSLS_PLATFORM_CMP_VER_MAJOR BSLS_PLATFORM_CMP_VERSION
716#endif
717// ----------------------------------------------------------------------------
718
719 // Miscellaneous Platform Macros
720
721#if defined(BSLS_PLATFORM_CMP_GNU) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
722 #define BSLS_PLATFORM_NO_64_BIT_LITERALS 1
723#endif
724
725#if (defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 40600) \
726 || defined(BSLS_PLATFORM_CMP_CLANG)
727 #define BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC 1
728 #if defined(BSLS_PLATFORM_CMP_CLANG)
729 #define BSLS_PLATFORM_PRAGMA_GCC_DIAGNOSTIC_CLANG 1
730 #else
731 #define BSLS_PLATFORM_PRAGMA_GCC_DIAGNOSTIC_GCC 1
732 #endif
733#endif
734
735#if !defined(BSLS_PLATFORM_CMP_SUN) \
736 || defined(BDE_BUILD_TARGET_AGGRESSIVE_INLINE)
737 #define BSLS_PLATFORM_AGGRESSIVE_INLINE inline
738#else
739 #define BSLS_PLATFORM_AGGRESSIVE_INLINE
740#endif
741
742#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 40406 || \
743 defined(BSLS_PLATFORM_CMP_CLANG) || defined(BSLS_PLATFORM_CMP_MSVC)
744 // Support for preserving macro values through the following pragmas:
745 // #pragma push_macro("NAME") // Save macro definition of NAME
746 // #pragma pop_macro("NAME") // Restore macro definition of NAME
747 // Note that if NAME is undefined, the sequence push/define NAME/pop may
748 // leave NAME defined at the end, depending on compiler version.
749 #define BSLS_PLATFORM_HAS_MACRO_PUSH_POP 1
750#endif
751
752///Implementation Note
753///- - - - - - - - - -
754// When compiling with Microsoft Visual Studio, as indicated by the macro
755// '_MSC_VER' being defined, this component assumes that the SSE, SSE2, and
756// SSE3 instruction set extensions are available on x86 platforms. Therefore,
757// x86 processors lacking these extensions are not supported when compiling
758// with Visual Studio. Later extensions, such as SSE4.1, SSE4.2, and AVX, are
759// not assumed. As of the writing of this note, Visual Studio does not provide
760// a reliable way to detect whether x86 instruction set extensions are enabled.
761//
762// Note that it is not necessarily safe to change this component to assume
763// later instruction set extensions are available when compiling with Visual
764// Studio. Doing so may lead to dependent components using instructions that
765// are not available on some x86 platforms.
766//
767// Clang and GCC (as well as compilers with EDG front-ends) provide macros to
768// detect whether most x86 instruction set extensions are enabled.
769
770#if defined(_MSC_VER)
771 #if !defined(BSLS_PLATFORM_CPU_ARM)
772 #define BSLS_PLATFORM_CPU_SSE 1
773 #define BSLS_PLATFORM_CPU_SSE2 1
774 #define BSLS_PLATFORM_CPU_SSE3 1
775 #endif
776#elif defined(__clang__) || defined(__GNUC__) || defined(__EDG__)
777 #if defined(__SSE__)
778 #define BSLS_PLATFORM_CPU_SSE 1
779 #endif
780 #if defined(__SSE2__)
781 #define BSLS_PLATFORM_CPU_SSE2 1
782 #endif
783 #if defined(__SSE3__)
784 #define BSLS_PLATFORM_CPU_SSE3 1
785 #endif
786 #if defined(__SSE4_1__)
787 #define BSLS_PLATFORM_CPU_SSE4_1 1
788 #endif
789 #if defined(__SSE4_2__)
790 #define BSLS_PLATFORM_CPU_SSE4_2 1
791 #endif
792 #if defined(__AVX__)
793 #define BSLS_PLATFORM_CPU_AVX 1
794 #endif
795 #if defined(__AVX2__)
796 #define BSLS_PLATFORM_CPU_AVX2 1
797 #endif
798#endif
799
800// ----------------------------------------------------------------------------
801
802 // Self Validation
803
804// Unix flag must be set by the compiler if Unix detected (except for Darwin).
805#if defined(BSLS_PLATFORM_OS_UNIX) && !defined(BSLS_PLATFORM_OS_DARWIN)
806 #if !defined(unix) && !defined(__unix__) && !defined(__unix)
807 #error "Unix platform assumed, but unix flag not set by compiler"
809 #endif
810#endif
811
812// Exactly one 'CMP' type.
813#if BSLS_PLATFORM_CMP_CLANG \
814 + BSLS_PLATFORM_CMP_EDG \
815 + BSLS_PLATFORM_CMP_GNU \
816 + BSLS_PLATFORM_CMP_MSVC \
817 + BSLS_PLATFORM_CMP_SUN != 1
818 #error "Exactly one compiler must be set."
820#endif
821
822// Exactly one 'OS' type.
823#if BSLS_PLATFORM_OS_UNIX \
824 + BSLS_PLATFORM_OS_WINDOWS != 1
825 #error "Exactly one operating system must be set."
827#endif
828
829// At most one 'OS' subtype.
830#define BSLS_PLATFORM_OS_SUBTYPE_COUNT \
831 BSLS_PLATFORM_OS_CYGWIN \
832 + BSLS_PLATFORM_OS_DARWIN \
833 + BSLS_PLATFORM_OS_FREEBSD \
834 + BSLS_PLATFORM_OS_LINUX \
835 + BSLS_PLATFORM_OS_SOLARIS \
836 + BSLS_PLATFORM_OS_WIN9X \
837 + BSLS_PLATFORM_OS_WINNT \
838 + BSLS_PLATFORM_OS_WIN2K \
839 + BSLS_PLATFORM_OS_WINXP \
840 + BSLS_PLATFORM_OS_WINS03 \
841 + BSLS_PLATFORM_OS_WINVISTA \
842 + BSLS_PLATFORM_OS_WIN7 \
843 + BSLS_PLATFORM_OS_WIN8 \
844 + BSLS_PLATFORM_OS_WINBLUE \
845 + BSLS_PLATFORM_OS_WIN10
846#if BSLS_PLATFORM_OS_SUBTYPE_COUNT > 1
847 #error "At most one operating system subtype must be set."
849#endif
850
851// Windows Server 2008 API is the same as Vista
852#if defined(BSLS_PLATFORM_OS_WINVISTA) != defined(BSLS_PLATFORM_OS_WINS08)
853 #error "Windows Vista and Server 2008 are the same API."
855#endif
856
857// Exactly one 'CPU' type.
858#if BSLS_PLATFORM_CPU_ALPHA \
859 + BSLS_PLATFORM_CPU_HPPA \
860 + BSLS_PLATFORM_CPU_IA64 \
861 + BSLS_PLATFORM_CPU_X86 \
862 + BSLS_PLATFORM_CPU_X86_64 \
863 + BSLS_PLATFORM_CPU_MIPS \
864 + BSLS_PLATFORM_CPU_POWERPC \
865 + BSLS_PLATFORM_CPU_SPARC \
866 + BSLS_PLATFORM_CPU_ARM != 1
867 #error "Exactly one processor must be set."
869#endif
870
871// Exactly one kind of "endian-ness".
872#if BSLS_PLATFORM_IS_BIG_ENDIAN \
873 + BSLS_PLATFORM_IS_LITTLE_ENDIAN != 1
874 #error "Exactly one kind of endian-ness must be set."
876#endif
877
878#if defined(BSLS_PLATFORM_OS_VER_MAJOR) && BSLS_PLATFORM_OS_SUBTYPE_COUNT != 1
879 // For OS, MAJOR VERSION implies SUBTYPE.
880 #error "Operating system major version but not subtype defined."
882#endif
883
884#undef BSLS_PLATFORM_OS_SUBTYPE_COUNT
885
886#if defined(BSLS_PLATFORM_OS_VER_MINOR) && !defined(BSLS_PLATFORM_OS_VER_MAJOR)
887 #error "Operating System minor but not major version defined."
889#endif
890
891#ifdef __cplusplus
892
893namespace bsls {
894
895// ----------------------------------------------------------------------------
896
897 // ========
898 // Platform
899 // ========
900
901/// Namespace for platform-trait definitions.
902///
903/// See @ref bsls_platform
904struct Platform {
905
906 // OS TYPES
907
908 struct OsAny {};
909
910 struct OsUnix : OsAny {};
911 struct OsWindows : OsAny {};
912
913 struct OsAix : OsUnix {};
914 struct OsCygwin : OsUnix {};
915 struct OsDarwin : OsUnix {};
916 struct OsFreeBsd : OsUnix {};
917 struct OsHpux : OsUnix {};
918 struct OsLinux : OsUnix {};
919 struct OsSolaris : OsUnix {};
920
921 struct OsAix_V5 : OsAix {};
922
923 struct OsSolaris_V8 : OsSolaris {};
924 struct OsSolaris_V9 : OsSolaris {};
925 struct OsSolaris_V10 : OsSolaris {};
926
927 struct OsWinNT : OsWindows {};
928
929 // PROCESSOR TYPES
930
931 struct CpuAny {};
932
933 struct Cpu88000 : CpuAny {};
934 struct CpuAlpha : CpuAny {};
935 struct CpuHppa : CpuAny {};
936 struct CpuX86 : CpuAny {};
937 struct CpuIa64 : CpuAny {};
938 struct CpuX86_64 : CpuAny {};
939 struct CpuMips : CpuAny {};
940
941 struct CpuPowerpc : CpuAny {};
942
943 struct CpuSparc : CpuAny {};
944 struct CpuSparc_32 : CpuSparc {}; // 32-bit
945 struct CpuSparc_V9 : CpuSparc {}; // 64-bit
946
947 typedef CpuPowerpc CPU_POWERPC;
948 typedef CpuSparc CPU_SPARC;
949 typedef CpuSparc_32 CPU_SPARC_32;
950 typedef CpuSparc_V9 CPU_SPARC_V9;
951
952 struct CpuPowerpc_601 : CpuPowerpc {};
953 struct CpuArch_Pwr : CpuPowerpc {};
954 struct CpuArch_Pwr2 : CpuPowerpc {};
955 struct CpuArch_Pwr2s : CpuPowerpc {};
956
957 struct CpuArm : CpuAny {};
958 struct CpuArmv5 : CpuArm {};
959 struct CpuArmv6 : CpuArm {};
960 struct CpuArmv7 : CpuArm {};
961 struct CpuArmv8 : CpuArm {};
962
963 // PLATFORM TRAITS
964
965 //OS TRAIT
966 // Will fail to compile if more than one OS type is set.
967
968 #if defined(BSLS_PLATFORM_OS_CYGWIN)
969 typedef OsCygwin Os;
970 #endif
971 #if defined(BSLS_PLATFORM_OS_DARWIN)
972 typedef OsDarwin Os;
973 #endif
974 #if defined(BSLS_PLATFORM_OS_FREEBSD)
975 typedef OsFreeBsd Os;
976 #endif
977 #if defined(BSLS_PLATFORM_OS_LINUX)
978 typedef OsLinux Os;
979 #endif
980 #if defined BSLS_PLATFORM_OS_SOLARIS
981 #if (BSLS_PLATFORM_OS_VER_MAJOR == 9)
982 typedef OsSolaris_V9 Os;
983 #elif (BSLS_PLATFORM_OS_VER_MAJOR == 10)
984 typedef OsSolaris_V10 Os;
985 #else
986 typedef OsSolaris_V8 Os;
987 #endif
988 #endif
989 #if defined(BSLS_PLATFORM_OS_WINDOWS)
990 typedef OsWinNT Os;
991 #endif
992
993 //CPU TRAIT
994 // Will fail to compile if more than one CPU type is set.
995
996 #if defined(BSLS_PLATFORM_CPU_X86)
997 typedef CpuX86 Cpu;
998 #endif
999 #if defined(BSLS_PLATFORM_CPU_IA64)
1000 typedef CpuIa64 Cpu;
1001 #endif
1002 #if defined(BSLS_PLATFORM_CPU_X86_64)
1003 typedef CpuX86_64 Cpu;
1004 #endif
1005 #if defined(BSLS_PLATFORM_CPU_POWERPC)
1006 typedef CpuPowerpc Cpu;
1007 #endif
1008 #if defined(BSLS_PLATFORM_CPU_SPARC_32)
1009 typedef CpuSparc_32 Cpu;
1010 #endif
1011 #if defined(BSLS_PLATFORM_CPU_SPARC_V9)
1012 typedef CpuSparc_V9 Cpu;
1013 #endif
1014 #if defined(BSLS_PLATFORM_CPU_ARM_V5)
1015 typedef CpuArmv5 Cpu;
1016 #endif
1017 #if defined(BSLS_PLATFORM_CPU_ARM_V6)
1018 typedef CpuArmv6 Cpu;
1019 #endif
1020 #if defined(BSLS_PLATFORM_CPU_ARM_V7)
1021 typedef CpuArmv7 Cpu;
1022 #endif
1023 #if defined(BSLS_PLATFORM_CPU_ARM_V8)
1024 typedef CpuArmv8 Cpu;
1025 #endif
1026};
1027
1028} // close package namespace
1029#endif // __cplusplus
1030
1031#ifndef BDE_OPENSOURCE_PUBLICATION // BACKWARD_COMPATIBILITY
1032#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1033
1034 // ======================
1035 // BACKWARD COMPATIBILITY
1036 // ======================
1037
1038#ifdef __cplusplus
1039/// This alias is defined for backward compatibility.
1040typedef bsls::Platform bdes_Platform;
1041#endif // __cplusplus
1042
1043#endif // BDE_OMIT_INTERNAL_DEPRECATED
1044
1045#ifdef __cplusplus
1046/// This alias is defined for backward compatibility.
1047typedef bsls::Platform bsls_Platform;
1048#endif
1049
1050#endif // BDE_OPENSOURCE_PUBLICATION -- BACKWARD_COMPATIBILITY
1051
1052#ifdef __cplusplus
1053
1054#endif
1055
1056#if !defined(BSL_DOUBLE_UNDERSCORE_XLAT) || 1 == BSL_DOUBLE_UNDERSCORE_XLAT
1057
1058// 'BDES' aliases
1059
1060#ifdef BSLS_PLATFORM_CMP_GNU
1061# define BDES_PLATFORM__CMP_GNU BSLS_PLATFORM_CMP_GNU
1062#endif
1063#ifdef BSLS_PLATFORM_CMP_MSVC
1064# define BDES_PLATFORM__CMP_MSVC BSLS_PLATFORM_CMP_MSVC
1065#endif
1066#ifdef BSLS_PLATFORM_CMP_SUN
1067# define BDES_PLATFORM__CMP_SUN BSLS_PLATFORM_CMP_SUN
1068#endif
1069#ifdef BSLS_PLATFORM_CMP_VER_MAJOR
1070# define BDES_PLATFORM__CMP_VER_MAJOR BSLS_PLATFORM_CMP_VER_MAJOR
1071#endif
1072#ifdef BSLS_PLATFORM_CPU_64_BIT
1073# define BDES_PLATFORM__CPU_64_BIT BSLS_PLATFORM_CPU_64_BIT
1074#endif
1075#ifdef BSLS_PLATFORM_OS_CYGWIN
1076# define BDES_PLATFORM__OS_CYGWIN BSLS_PLATFORM_OS_CYGWIN
1077#endif
1078#ifdef BSLS_PLATFORM_OS_DARWIN
1079# define BDES_PLATFORM__OS_DARWIN BSLS_PLATFORM_OS_DARWIN
1080#endif
1081#ifdef BSLS_PLATFORM_OS_FREEBSD
1082# define BDES_PLATFORM__OS_FREEBSD BSLS_PLATFORM_OS_FREEBSD
1083#endif
1084#ifdef BSLS_PLATFORM_OS_LINUX
1085# define BDES_PLATFORM__OS_LINUX BSLS_PLATFORM_OS_LINUX
1086#endif
1087#ifdef BSLS_PLATFORM_OS_SOLARIS
1088# define BDES_PLATFORM__OS_SOLARIS BSLS_PLATFORM_OS_SOLARIS
1089#endif
1090#ifdef BSLS_PLATFORM_OS_UNIX
1091# define BDES_PLATFORM__OS_UNIX BSLS_PLATFORM_OS_UNIX
1092#endif
1093#ifdef BSLS_PLATFORM_OS_VER_MAJOR
1094# define BDES_PLATFORM__OS_VER_MAJOR BSLS_PLATFORM_OS_VER_MAJOR
1095#endif
1096#ifdef BSLS_PLATFORM_OS_VER_MINOR
1097# define BDES_PLATFORM__OS_VER_MINOR BSLS_PLATFORM_OS_VER_MINOR
1098#endif
1099#ifdef BSLS_PLATFORM_OS_WIN2K
1100# define BDES_PLATFORM__OS_WIN2K BSLS_PLATFORM_OS_WIN2K
1101#endif
1102#ifdef BSLS_PLATFORM_OS_WIN9X
1103# define BDES_PLATFORM__OS_WIN9X BSLS_PLATFORM_OS_WIN9X
1104#endif
1105#ifdef BSLS_PLATFORM_OS_WINDOWS
1106# define BDES_PLATFORM__OS_WINDOWS BSLS_PLATFORM_OS_WINDOWS
1107#endif
1108#ifdef BSLS_PLATFORM_OS_WINNT
1109# define BDES_PLATFORM__OS_WINNT BSLS_PLATFORM_OS_WINNT
1110#endif
1111#ifdef BSLS_PLATFORM_OS_WINXP
1112# define BDES_PLATFORM__OS_WINXP BSLS_PLATFORM_OS_WINXP
1113#endif
1114
1115// 'BSLS' aliases
1116
1117#ifdef BSLS_PLATFORM_CMP_CLANG
1118# define BSLS_PLATFORM__CMP_CLANG BSLS_PLATFORM_CMP_CLANG
1119#endif
1120#ifdef BSLS_PLATFORM_CMP_EDG
1121# define BSLS_PLATFORM__CMP_EDG BSLS_PLATFORM_CMP_EDG
1122#endif
1123#ifdef BSLS_PLATFORM_CMP_GNU
1124# define BSLS_PLATFORM__CMP_GNU BSLS_PLATFORM_CMP_GNU
1125#endif
1126#ifdef BSLS_PLATFORM_CMP_MSVC
1127# define BSLS_PLATFORM__CMP_MSVC BSLS_PLATFORM_CMP_MSVC
1128#endif
1129#ifdef BSLS_PLATFORM_CMP_SUN
1130# define BSLS_PLATFORM__CMP_SUN BSLS_PLATFORM_CMP_SUN
1131#endif
1132#ifdef BSLS_PLATFORM_CMP_VERSION
1133# define BSLS_PLATFORM__CMP_VERSION BSLS_PLATFORM_CMP_VERSION
1134#endif
1135#ifdef BSLS_PLATFORM_CMP_VER_MAJOR
1136# define BSLS_PLATFORM__CMP_VER_MAJOR BSLS_PLATFORM_CMP_VER_MAJOR
1137#endif
1138#ifdef BSLS_PLATFORM_CPU_32_BIT
1139# define BSLS_PLATFORM__CPU_32_BIT BSLS_PLATFORM_CPU_32_BIT
1140#endif
1141#ifdef BSLS_PLATFORM_CPU_64_BIT
1142# define BSLS_PLATFORM__CPU_64_BIT BSLS_PLATFORM_CPU_64_BIT
1143#endif
1144#ifdef BSLS_PLATFORM_CPU_POWERPC
1145# define BSLS_PLATFORM__CPU_POWERPC BSLS_PLATFORM_CPU_POWERPC
1146#endif
1147#ifdef BSLS_PLATFORM_CPU_X86
1148# define BSLS_PLATFORM__CPU_X86 BSLS_PLATFORM_CPU_X86
1149#endif
1150#ifdef BSLS_PLATFORM_CPU_X86_64
1151# define BSLS_PLATFORM__CPU_X86_64 BSLS_PLATFORM_CPU_X86_64
1152#endif
1153#ifdef BSLS_PLATFORM_IS_BIG_ENDIAN
1154# define BSLS_PLATFORM__IS_BIG_ENDIAN BSLS_PLATFORM_IS_BIG_ENDIAN
1155#endif
1156#ifdef BSLS_PLATFORM_IS_LITTLE_ENDIAN
1157# define BSLS_PLATFORM__IS_LITTLE_ENDIAN BSLS_PLATFORM_IS_LITTLE_ENDIAN
1158#endif
1159#ifdef BSLS_PLATFORM_OS_CYGWIN
1160# define BSLS_PLATFORM__OS_CYGWIN BSLS_PLATFORM_OS_CYGWIN
1161#endif
1162#ifdef BSLS_PLATFORM_OS_DARWIN
1163# define BSLS_PLATFORM__OS_DARWIN BSLS_PLATFORM_OS_DARWIN
1164#endif
1165#ifdef BSLS_PLATFORM_OS_LINUX
1166# define BSLS_PLATFORM__OS_LINUX BSLS_PLATFORM_OS_LINUX
1167#endif
1168#ifdef BSLS_PLATFORM_OS_SOLARIS
1169# define BSLS_PLATFORM__OS_SOLARIS BSLS_PLATFORM_OS_SOLARIS
1170#endif
1171#ifdef BSLS_PLATFORM_OS_UNIX
1172# define BSLS_PLATFORM__OS_UNIX BSLS_PLATFORM_OS_UNIX
1173#endif
1174#ifdef BSLS_PLATFORM_OS_WINDOWS
1175# define BSLS_PLATFORM__OS_WINDOWS BSLS_PLATFORM_OS_WINDOWS
1176#endif
1177
1178#endif
1179
1180#endif
1181
1182// ----------------------------------------------------------------------------
1183// Copyright 2019 Bloomberg Finance L.P.
1184//
1185// Licensed under the Apache License, Version 2.0 (the "License");
1186// you may not use this file except in compliance with the License.
1187// You may obtain a copy of the License at
1188//
1189// http://www.apache.org/licenses/LICENSE-2.0
1190//
1191// Unless required by applicable law or agreed to in writing, software
1192// distributed under the License is distributed on an "AS IS" BASIS,
1193// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1194// See the License for the specific language governing permissions and
1195// limitations under the License.
1196// ----------------------------- END-OF-FILE ----------------------------------
1197
1198/** @} */
1199/** @} */
1200/** @} */
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
#define BSLS_PLATFORM_COMPILER_ERROR
Definition bsls_platform.h:284
Definition bdlt_iso8601util.h:707