-
Notifications
You must be signed in to change notification settings - Fork 13
Compiler Options
Finalspace edited this page May 29, 2026
·
2 revisions
| Category | Macro definition | Description | 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 |
| System | FPL_NO_PLATFORM_INCLUDES | Define this to disable the includes for the specific platform in the API. | Not set by default |
| System | FPL_OPAQUE_HANDLES | Define this to force the use of opaque handles in the API. | 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. NoteWhen 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. NoteHas 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 backend. | Not set by default |
| Video | FPL_NO_VIDEO_VULKAN | Define this to disable the Vulkan video backend. | Not set by default |
| Video | FPL_NO_VIDEO_SOFTWARE | Define this to disable the Software video backend. | Not set by default |
| Audio | FPL_NO_AUDIO | Define this to disable Audio Support entirely. | Not set by default |
| Audio | FPL_NO_AUDIO_WASAPI | Define this to disable WASAPI 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 |
| Audio | FPL_NO_AUDIO_PULSEAUDIO | Define this to disable PulseAudio support entirely. | Not set by default |
| Audio | FPL_NO_AUDIO_PIPEWIRE | Define this to disable PipeWire support entirely. | Not set by default |
| Audio | FPL_NO_AUDIO_OSS | Define this to disable OSS support entirely. | Not set by default |
| Input | FPL_NO_INPUT | Define this to disable the entire input subsystem (keyboard, mouse and gamepad backends). | Not set by default |
| Input | FPL_NO_INPUT_XINPUT | Define this to disable the XInput gamepad backend (Windows). | Not set by default |
| Input | FPL_NO_INPUT_DINPUT | Define this to disable the DirectInput gamepad backend (Windows). | Not set by default |
| Input | FPL_NO_INPUT_RAWINPUT | Define this to disable the RawInput keyboard/mouse backend (Windows). | Not set by default |
| Input | FPL_NO_INPUT_WIN32 | Define this to disable the Win32 keyboard/mouse backend. | Not set by default |
| Input | FPL_NO_INPUT_X11 | Define this to disable the X11 keyboard/mouse backend. | Not set by default |
| Input | FPL_NO_INPUT_LINUX_JOYSTICK | Define this to disable the /dev/input/jsX gamepad backend (Linux). | 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 |
| Logging | FPL_CRASH_ON_ERROR | Define this to crash the application on any error logged by FPL. | Not set by default |
| Logging | FPL_CRASH_ON_WARNING | Define this to crash the application on any warning logged by FPL. | 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 is 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 is 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. |
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:
- FPL_PLATFORM_WIN32 or FPL_PLATFORM_LINUX or FPL_PLATFORM_UNIX ...
- FPL_ARCH_X64 or FPL_ARCH_X86 or FPL_ARCH_ARM64 ...
All these defines have no values set, they are just "defined" - always use defined() for checking them.
#if defined(FPL_PLATFORM_WINDOWS)
// ... 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_MSVCTo 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 operating system that uses POSIX standards as well, so it uses the same POSIX sub-platform.
- Assertion & Debug
- Atomic operations
- Audio functions
- Clipboard functions
- Console functions
- Constants
- Display/Monitor functions
- Dynamic library loading
- Error Handling
- Files/IO functions
- Function macros
- Hardware Infos
- Input types and functions
- Localization functions
- Logging
- Memory Macros
- Memory functions
- Operating system Infos
- Path functions
- Platform functions
- Session Infos
- Settings & Configurations
- Storage class identifiers
- String functions
- Threading and synchronizations routines
- Timing functions
- Video functions
- Window events
- Window functions
- fplARMCPUCapabilities
- fplAudioChannelMap
- fplAudioDeviceID
- fplAudioDeviceInfo
- fplAudioFormat
- fplAudioSettings
- fplColor32
- fplConditionVariable
- fplConsoleSettings
- fplCPUCapabilities
- fplCPUIDLeaf
- fplDateTime
- fplDateTimeCreationResult
- fplDateTimeResult
- fplDisplayInfo
- fplDisplayMode
- fplDynamicLibraryHandle
- fplEndianess
- fplEvent
- fplFileEntry
- fplFileHandle
- fplFilePermissions
- fplFileTimeStamps
- fplGamepadButton
- fplGamepadData
- fplGamepadEvent
- fplGamepadInfo
- fplGamepadInputBinding
- fplGamepadMapping
- fplGamepadSettings
- fplGamepadState
- fplGamepadStates
- fplGraphicsApiSettings
- fplImageSource
- fplInputBackendMask
- fplInputBackendSupport
- fplInputDevice
- fplInputDeviceGuid
- fplInputSettings
- fplInternalConditionVariable
- fplInternalDynamicLibraryHandle
- fplInternalFileEntryHandle
- fplInternalFileHandle
- fplInternalFileRootInfo
- fplInternalMutexHandle
- fplInternalSemaphoreHandle
- fplInternalSignalHandle
- fplInternalThreadHandle
- fplKeyboardEvent
- fplKeyboardState
- fplLogSettings
- fplLogWriter
- fplLogWriterConsole
- fplLogWriterCustom
- fplMemoryAllocationSettings
- fplMemoryBlock
- fplMemoryInfos
- fplMemorySettings
- fplMouseEvent
- fplMouseState
- fplMutexHandle
- fplOpenGLSettings
- fplOSVersionInfos
- fplSemaphoreHandle
- fplSettings
- fplSignalHandle
- fplSpecificAudioSettings
- fplThreadHandle
- fplThreadParameters
- fplTimestamp
- fplVersionInfo
- fplVideoBackBuffer
- fplVideoRect
- fplVideoRequirements
- fplVideoRequirementsVulkan
- fplVideoSettings
- fplVideoSurface
- fplVideoSurfaceOpenGL
- fplVideoSurfaceVulkan
- fplVideoWindow
- fplVulkanSettings
- fplWindowCallbacks
- fplWindowDropFiles
- fplWindowEvent
- fplWindowPosition
- fplWindowSettings
- fplWindowSize
- fplX86CPUCapabilities