Final Platform Layer  0.9.2.0
Compiler Options

Table of Contents

Preprocessor options

CategoryMacro definitionDescription

Default

System FPL_IMPLEMENTATION Define this to include the actual implementation code.
Set this only once per translation unit, otherwise you will get linking errors.
Not set by default
System FPL_NO_ENTRYPOINT Define this to disable the entry point inclusion.
This is useful when you use FPL in multiple translation units, but want your main entry point to be included only once.
Not set by default
System FPL_ENTRYPOINT Force the inclusion of the main entry point.
If you use FPL as a static library, you need to set this in your main translation unit only.
Automatically set when FPL_IMPLEMENTATION is defined, but only when FPL_NO_ENTRYPOINT is not defined
System FPL_API_AS_PRIVATE Define this to make all functions be private ( static ).
This means that all function calls can be called from one translation unit only.
By default all FPL functions are defined as ( extern )
System FPL_DEBUG Define this to enable the "Debug" configuration.
When set assertions and some debug related features are enabled.
By default this is auto-detected by compiler settings.
System FPL_RELEASE Define this to enable the "Release" configuration.
When set all DEBUG features are compiled out entirely.
By default this is auto-detected by compiler settings.
System FPL_NO_RUNTIME_LINKING Define this to disable runtime linking of libraries.

Not set by default

Assertions FPL_NO_ASSERTIONS Define this to disable all internal assertions. Not set by default
Assertions FPL_FORCE_ASSERTIONS Define this to enable internal assertions always, even in release builds. Not set by default.
Note
When enabled all assertions will use a simple null-pointer assertion macro always!
Assertions FPL_NO_C_ASSERT Define this to disable C runtime assert. Not set by default.
Note
Has no effect when FPL_FORCE_ASSERTIONS is set!
Window FPL_NO_WINDOW Define this to disable Window Support entirely.

Not set by default

Video FPL_NO_VIDEO Define this to disable Video Support entirely. Not set by default
Video FPL_NO_VIDEO_OPENGL Define this to disable the OpenGL Video Driver. Not set by default
Video FPL_NO_VIDEO_SOFTWARE Define this to disable the Software Video Driver.

Not set by default

Audio FPL_NO_AUDIO Define this to disable Audio Support entirely. Not set by default
Audio FPL_NO_AUDIO_DIRECTSOUND Define this to disable DirectSound support entirely. Not set by default
Audio FPL_NO_AUDIO_ALSA Define this to disable ALSA support entirely.

Not set by default

Logging FPL_LOGGING Define this to enable logging. Not set by default
Logging FPL_LOG_MULTIPLE_WRITERS Define this to support multiple log writers, so you can have a writer for each log level.

Not set by default

C-Runtime FPL_NO_CRT Define this to disable the usage of functions from the CRT.

This is not set by default.

Application FPL_NO_APPTYPE Define this to disable the application type detection. By default this are not set and the application type is detected automatically.
Application FPL_APPTYPE_CONSOLE Define this to force your application to be a console application.
When this is set the window support will be compiled out!
By default this are set when FPL_NO_WINDOW is defined.
Application FPL_APPTYPE_WINDOW Define this to force your application to be a windowed application.

By default this is set when FPL_NO_WINDOW is not defined.

User functions FPL_USERFUNC_vsnprintf Define this to provide a replacement for vsnprintf() when FPL_NO_CRT is set.

By default this is not set.

Platform/Compiler detection

Like every other C/C++ program, FPL uses compiler defines to detect the proper platform/architecture and used compiler.
If you need this information for whatever reason you can simply compare the defines:

All these defines have no values set, there are just "defined" - use always defined() for checking them.

#if defined(FPL_PLATFORM_WIN32)
// ... Any win32 code you may need
#endif // FPL_PLATFORM_WIN32
#if defined(FPL_ARCH_X64)
// ... Any x64 code you may need
#endif // FPL_ARCH_X64
#if defined(FPL_COMPILER_MSVC)
// ... MSVC compiler specific code you may need
#endif // FPL_COMPILER_MSVC

Sub-Platforms

To prevent code duplication for platform combinations, FPL uses sub-platforms - which are no real platforms, but rather principles or standards the actual operating system is built-on.
For example "Linux" is detected as FPL_PLATFORM_LINUX but uses POSIX as a sub-platform FPL_SUBPLATFORM_POSIX.
Another example is "FreeBSD" which is a unix-based operation system which uses POSIX standards as well, so it uses the same posix sub platform.