Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
feature_flags_core.h File Reference

Core KCENON_* macro definitions for feature detection. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define KCENON_HAS_INCLUDE(x)
 Helper macro to check if __has_include is available.
 
#define KCENON_HAS_CPP_ATTRIBUTE(x)
 Helper macro to check if __has_cpp_attribute is available.
 
#define KCENON_HAS_FEATURE(x)
 Helper macro to check if __has_feature is available (Clang)
 
#define KCENON_HAS_BUILTIN(x)
 Helper macro to check if __has_builtin is available.
 
#define KCENON_COMPILER_MSVC   0
 
#define KCENON_COMPILER_CLANG   0
 
#define KCENON_CLANG_VERSION   0
 
#define KCENON_COMPILER_GCC   0
 
#define KCENON_GCC_VERSION   0
 
#define KCENON_CPLUSPLUS   __cplusplus
 
#define KCENON_HAS_CPP17   (KCENON_CPLUSPLUS >= 201703L)
 
#define KCENON_HAS_CPP20   (KCENON_CPLUSPLUS >= 202002L)
 
#define KCENON_HAS_CPP23   (KCENON_CPLUSPLUS >= 202302L)
 
#define KCENON_PLATFORM_WINDOWS   0
 
#define KCENON_PLATFORM_LINUX   0
 
#define KCENON_PLATFORM_MACOS   0
 
#define KCENON_PLATFORM_UNIX    (KCENON_PLATFORM_LINUX || KCENON_PLATFORM_MACOS)
 
#define KCENON_ENABLE_LEGACY_ALIASES   1
 Enable legacy macro aliases for backward compatibility.
 
#define KCENON_DEFINE_LEGACY_ALIAS(legacy_name, new_name)
 Helper macro for defining legacy aliases.
 

Detailed Description

Core KCENON_* macro definitions for feature detection.

This file provides the foundational macros used across all system modules for detecting compiler and standard library features. It is designed to be included first before any other feature detection headers.

Note
All macros follow the KCENON_ prefix convention for consistency.

Definition in file feature_flags_core.h.

Macro Definition Documentation

◆ KCENON_CLANG_VERSION

#define KCENON_CLANG_VERSION   0

Definition at line 79 of file feature_flags_core.h.

◆ KCENON_COMPILER_CLANG

#define KCENON_COMPILER_CLANG   0

Definition at line 78 of file feature_flags_core.h.

◆ KCENON_COMPILER_GCC

#define KCENON_COMPILER_GCC   0

Definition at line 87 of file feature_flags_core.h.

◆ KCENON_COMPILER_MSVC

#define KCENON_COMPILER_MSVC   0

Definition at line 70 of file feature_flags_core.h.

◆ KCENON_CPLUSPLUS

#define KCENON_CPLUSPLUS   __cplusplus

Definition at line 98 of file feature_flags_core.h.

◆ KCENON_DEFINE_LEGACY_ALIAS

#define KCENON_DEFINE_LEGACY_ALIAS ( legacy_name,
new_name )
Value:
do { } while(0)

Helper macro for defining legacy aliases.

Only defines the legacy alias if:

  1. Legacy aliases are enabled
  2. The legacy macro is not already defined

Definition at line 156 of file feature_flags_core.h.

156 #define KCENON_DEFINE_LEGACY_ALIAS(legacy_name, new_name) \
157 do { } while(0)

◆ KCENON_ENABLE_LEGACY_ALIASES

#define KCENON_ENABLE_LEGACY_ALIASES   1

Enable legacy macro aliases for backward compatibility.

When defined and set to 1, legacy aliases (COMMON_*, USE_*, etc.) will be available alongside the new KCENON_* macros. This provides a migration path for existing code.

Note
Legacy aliases will not override explicit 0 values to ensure intentional disabling is respected.

Definition at line 145 of file feature_flags_core.h.

◆ KCENON_GCC_VERSION

#define KCENON_GCC_VERSION   0

Definition at line 88 of file feature_flags_core.h.

◆ KCENON_HAS_BUILTIN

#define KCENON_HAS_BUILTIN ( x)
Value:
0

Helper macro to check if __has_builtin is available.

Definition at line 58 of file feature_flags_core.h.

◆ KCENON_HAS_CPP17

#define KCENON_HAS_CPP17   (KCENON_CPLUSPLUS >= 201703L)

Definition at line 101 of file feature_flags_core.h.

◆ KCENON_HAS_CPP20

#define KCENON_HAS_CPP20   (KCENON_CPLUSPLUS >= 202002L)

Definition at line 102 of file feature_flags_core.h.

◆ KCENON_HAS_CPP23

#define KCENON_HAS_CPP23   (KCENON_CPLUSPLUS >= 202302L)

Definition at line 103 of file feature_flags_core.h.

◆ KCENON_HAS_CPP_ATTRIBUTE

#define KCENON_HAS_CPP_ATTRIBUTE ( x)
Value:
0

Helper macro to check if __has_cpp_attribute is available.

Definition at line 40 of file feature_flags_core.h.

◆ KCENON_HAS_FEATURE

#define KCENON_HAS_FEATURE ( x)
Value:
0

Helper macro to check if __has_feature is available (Clang)

Definition at line 49 of file feature_flags_core.h.

◆ KCENON_HAS_INCLUDE

#define KCENON_HAS_INCLUDE ( x)
Value:
0

Helper macro to check if __has_include is available.

Some older compilers may not support __has_include. This provides a safe fallback mechanism.

Definition at line 31 of file feature_flags_core.h.

◆ KCENON_PLATFORM_LINUX

#define KCENON_PLATFORM_LINUX   0

Definition at line 118 of file feature_flags_core.h.

◆ KCENON_PLATFORM_MACOS

#define KCENON_PLATFORM_MACOS   0

Definition at line 124 of file feature_flags_core.h.

◆ KCENON_PLATFORM_UNIX

#define KCENON_PLATFORM_UNIX    (KCENON_PLATFORM_LINUX || KCENON_PLATFORM_MACOS)

Definition at line 127 of file feature_flags_core.h.

127#define KCENON_PLATFORM_UNIX \
128 (KCENON_PLATFORM_LINUX || KCENON_PLATFORM_MACOS)

◆ KCENON_PLATFORM_WINDOWS

#define KCENON_PLATFORM_WINDOWS   0

Definition at line 112 of file feature_flags_core.h.