22. Platforms¶
22.1. Platform codes¶
The MPS uses a six-character platform code to express a combination of
operating system, CPU architecture, and compiler toolchain. Each
six-character code breaks down into three pairs of characters:
OSARCT
. The first pair of characters names the operating system:
|
Operating system |
Constant |
---|---|---|
|
FreeBSD |
|
|
Linux |
|
|
Windows |
|
|
macOS |
The second pair of characters names the processor architecture:
|
Processor architecture |
Constant |
---|---|---|
|
Intel/AMD IA-32 |
|
|
Intel/AMD x86-64 |
The third pair of characters names the compiler toolchain:
|
Compiler toolchain |
Constant |
---|---|---|
|
GNU Compiler collection |
|
|
Clang/LLVM |
|
|
Microsoft Visual C/C++ |
In each case the aspect of the platform can be tested by checking
whether the preprocessor constant in the third column in the table
is defined, and the full platform can be tested by checking
whether the corresponding MPS_PF_
preprocessor constant is
defined. For example, “xci6ll
” platform corresponds to the
MPS_PF_XCI6LL
preprocessor constant.
Not all combinations of operating system, processor architecture, and compiler are supported.
22.2. Platform interface¶
#include "mpstd.h"
-
MPS_ARCH_I3
¶ A C preprocessor macro that indicates, if defined, that the target processor architecture of the compilation is a member of the IA-32 Intel/AMD family of 32-bit processors.
-
MPS_ARCH_I6
¶ A C preprocessor macro that indicates, if defined, that the target processor architecture of the compilation is a member of the x86-64 Intel/AMD family of 64-bit processors.
Note
The MPS is not supported on IA-64 (Itanium).
-
MPS_BUILD_GC
¶ A C preprocessor macro that indicates, if defined, that the MPS was compiled by the C compiler from the GNU Compiler Collection (GCC).
-
MPS_BUILD_LL
¶ A C preprocessor macro that indicates, if defined, that the MPS was compiled by Clang, the C compiler from the LLVM (Low Level Virtual Machine) system.
-
MPS_BUILD_MV
¶ A C preprocessor macro that indicates, if defined, that the MPS was compiled by the C compiler from Microsoft Visual Studio.
-
MPS_OS_FR
¶ A C preprocessor macro that indicates, if defined, that the MPS was compiled on a FreeBSD operating system.
-
MPS_OS_LI
¶ A C preprocessor macro that indicates, if defined, that the MPS was compiled on a Linux operating system.
-
MPS_OS_W3
¶ A C preprocessor macro that indicates, if defined, that the MPS was compiled on a Windows operating system.
-
MPS_OS_XC
¶ A C preprocessor macro that indicates, if defined, that the MPS was compiled on an macOS operating system.
-
MPS_PF_ALIGN
¶ A C preprocessor macro that expands to an integer giving the natural alignment of the platform.
-
MPS_PF_FRI3GC
¶ A C preprocessor macro that indicates, if defined, that the platform consists of the FreeBSD operating system, the IA-32 processor architecture, and the GCC compiler.
-
MPS_PF_FRI3LL
¶ A C preprocessor macro that indicates, if defined, that the platform consists of the FreeBSD operating system, the IA-32 processor architecture, and the Clang/LLVM compiler.
-
MPS_PF_FRI6GC
¶ A C preprocessor macro that indicates, if defined, that the platform consists of the FreeBSD operating system, the x86-64 processor architecture, and the GCC compiler.
-
MPS_PF_FRI6LL
¶ A C preprocessor macro that indicates, if defined, that the platform consists of the FreeBSD operating system, the x86-64 processor architecture, and the Clang/LLVM compiler.
-
MPS_PF_LII3GC
¶ A C preprocessor macro that indicates, if defined, that the platform consists of the Linux operating system, the IA-32 processor architecture, and the GCC compiler.
-
MPS_PF_LII6GC
¶ A C preprocessor macro that indicates, if defined, that the platform consists of the Linux operating system, the x86-64 processor architecture, and the GCC compiler.
-
MPS_PF_LII6LL
¶ A C preprocessor macro that indicates, if defined, that the platform consists of the Linux operating system, the x86-64 processor architecture, and the Clang/LLVM compiler.
-
MPS_PF_W3I3MV
¶ A C preprocessor macro that indicates, if defined, that the platform consists of the Windows operating system, the IA-32 processor architecture, and the Microsoft Visual C/C++ compiler.
-
MPS_PF_W3I6MV
¶ A C preprocessor macro that indicates, if defined, that the platform consists of the Windows operating system, the x86-64 processor architecture, and the Microsoft Visual C/C++ compiler.
-
MPS_PF_XCI3GC
¶ A C preprocessor macro that indicates, if defined, that the platform consists of the macOS operating system, the IA-32 processor architecture, and the GCC compiler.
-
MPS_PF_XCI3LL
¶ A C preprocessor macro that indicates, if defined, that the platform consists of the macOS operating system, the IA-32 processor architecture, and the Clang/LLVM compiler.
-
MPS_PF_XCI6GC
¶ A C preprocessor macro that indicates, if defined, that the platform consists of the macOS operating system, the x86-64 processor architecture, and the GCC compiler.
-
MPS_PF_XCI6LL
¶ A C preprocessor macro that indicates, if defined, that the platform consists of the macOS operating system, the x86-64 processor architecture, and the Clang/LLVM compiler.
-
MPS_T_ULONGEST
¶ A C preprocessor macro that expands to the name of the largest unsigned integral type.
The exact identity of this type is platform-dependent. Typical identities are
unsigned long
andunsigned __int_64
.
-
MPS_T_WORD
¶ A C preprocessor macro that expands to the name of an unsigned integral type that is the same size as an object pointer, so that
sizeof(MPS_T_WORD) == sizeof(void*)
.The exact identity of this type is platform-dependent. Typical identities are
unsigned long
andunsigned __int_64
.
-
MPS_WORD_SHIFT
¶ A C preprocessor macro that expands to the logarithm to base 2 of the constant
MPS_WORD_WIDTH
, so that1 << MPS_WORD_SHIFT == MPS_WORD_WIDTH
.The value is platform-dependent. Typical values are 5 and 6.
-
MPS_WORD_WIDTH
¶ A C preprocessor macro that expands to the width in bits of the type
MPS_T_WORD
, so thatMPS_WORD_WIDTH == sizeof(MPS_T_WORD) * CHAR_BIT
.This value is platform-dependent. It is always a power of 2: typical values are 32 and 64.
22.3. Historical platform codes¶
The platform codes in the tables below were in use in older versions of the Memory Pool System, but are not currently supported.
Formerly supported operating systems:
|
Operating system |
Constant |
---|---|---|
|
Irix 5 or 6 (old ABI) |
|
|
Irix 6 (new ABI) |
|
|
OSF/1 aka Tru64 |
|
|
Macintosh System 7, 8, or 9 |
|
|
Solaris |
|
|
SunOS |
|
Formerly supported processor architectures:
|
Processor architecture |
Constant |
---|---|---|
|
Intel/AMD IA-32 1 |
|
|
Digital Alpha |
|
|
MIPS R2000 |
|
|
MIPS R4000 |
|
|
Motorola 68000 |
|
|
PowerPC |
|
|
SPARC V8 |
|
|
SPARC V9 (32-bit) |
|
Formerly supported compiler toolchains:
|
Compiler toolchain |
Constant |
---|---|---|
|
Macintosh Programmer’s Workshop C/C++ |
|
|
The “native” C compiler 2 |
|
|
SunPro C CXREF tool |
|
|
Experimental GNU Compiler System (EGCS) |
|
|
GCC with profiling |
|
|
LCC |
|
|
Metrowerks CodeWarrior |
|
|
Pelles C |
|
|
SunPro C |
|
22.4. Historical platform list¶
This is the full list of platforms that have ever been supported by the Memory Pool System, with their current status.
Platform |
Status |
---|---|
|
Supported |
|
Supported |
|
Corrected to |
|
Supported |
|
Supported |
|
Not supported |
|
Not supported |
|
Not supported |
|
Supported |
|
Corrected to |
|
Supported |
|
Supported |
|
Not supported |
|
Not supported |
|
Not supported |
|
Not supported |
|
Not supported |
|
Not supported |
|
Not supported |
|
Not supported |
|
Not supported |
|
Not supported |
|
Not supported |
|
Not supported |
|
Not supported |
|
Supported |
|
Not supported |
|
Supported |
|
Not supported |
|
Not supported |
|
Not supported |
|
Supported |
|
Not supported |
|
Supported |
|
Not supported |