include/Cnx/Platform.h file

This module macro defines for identifying the platform being compiled for (operating system, compiler, etc)

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Enums

enum CnxPlatformArchitecture { CNX_PLATFORM_x86_64 = 1U << 1U, CNX_PLATFORM_X86 = 1U << 2U, CNX_PLATFORM_ARMv2 = 1U << 3U, CNX_PLATFORM_ARMv3 = 1U << 4U, CNX_PLATFORM_ARMv4 = 1U << 5U, CNX_PLATFORM_ARMv5 = 1U << 6U, CNX_PLATFORM_ARMv6 = 1U << 7U, CNX_PLATFORM_ARMv7 = 1U << 8U, CNX_PLATFORM_ARMv7a = (unsigned)(CNX_PLATFORM_ARMv7) | 1U << 9U, CNX_PLATFORM_ARMv7r = (unsigned)(CNX_PLATFORM_ARMv7) | (unsigned)(CNX_PLATFORM_ARMv7a) | 1U << 10U, CNX_PLATFORM_ARMv7m = (unsigned)(CNX_PLATFORM_ARMv7) | (unsigned)(CNX_PLATFORM_ARMv7a) | (unsigned)(CNX_PLATFORM_ARMv7r) | 1U << 11U, CNX_PLATFORM_ARMv7s = (unsigned)(CNX_PLATFORM_ARMv7) | (unsigned)(CNX_PLATFORM_ARMv7a) | (unsigned)(CNX_PLATFORM_ARMv7r) | 1U << 12U, CNX_PLATFORM_ARMv8 = 1U << 13U, CNX_PLATFORM_ARM64 = 1U << 13U, CNX_PLATFORM_MIPS = 1U << 14U, CNX_PLATFORM_SUPERH = 1U << 15U, CNX_PLATFORM_POWERPC = 1U << 16U, CNX_PLATFORM_POWERPC64 = 1U << 17U, CNX_PLATFORM_SPARC = 1U << 18U, CNX_PLATFORM_M68K = 1U << 19U, CNX_PLATFORM_UNKNOWN = 1U << 20U }
The list of supported architectures to compile for.

Typedefs

using CnxPlatformArchitecture = enum CnxPlatformArchitecture
The list of supported architectures to compile for.

Defines

#define CNX_PLATFORM
Declarations and definitions related to detecting the compiled-for platform.
#define CNX_PLATFORM_WINDOWS
Whether the compiled-for platform is WINDOWS.
#define CNX_PLATFORM_APPLE
Whether the compiled-for platform is APPLE (MacOS, IOS)
#define CNX_PLATFORM_UNIX
Whether the compiled-for platform is a variant of UNIX.
#define CNX_PLATFORM_LINUX
Whether the compiled-for platform is LINUX.
#define CNX_PLATFORM_BSD
Whether the compiled-for platform is BSD.
#define CNX_PLATFORM_ZOS
Whether the compiled-for platform is z/OS.
#define CNX_PLATFORM_ANDROID
Whether the compiled-for platform is ANDROID.
#define CNX_PLATFORM_HPUX
Whether the compiled-for platform is HPUX.
#define CNX_PLATFORM_AIX
Whether the compiled-for platform is AIX.
#define CNX_PLATFORM_SOLARIS
Whether the compiled-for platform is SOLARIS.
#define CNX_PLATFORM_COMPILER_CLANG
Whether the current compiler is CLANG.
#define CNX_PLATFORM_COMPILER_GCC
Whether the current compiler is GCC.
#define CNX_PLATFORM_DEBUG
Whether the current build mode is DEBUG.
#define CNX_PLATFORM_RELEASE
Whether the current build mode is RELEASE.
#define CNX_PLATFORM_LITTLE_ENDIAN
Whether the compiled-for architecture is a little endian architecture.
#define CNX_PLATFORM_BIG_ENDIAN
Whether the compiled-for architecture is a big endian architecture.
#define CNX_PLATFORM_ARCHITECTURE
The CPU architecture family being compiled for.
#define IS_CNX_PLATFORM_ARCHITECTURE(to_check)
Determines if the compiled-for architecture is the given one.