Rihen Rihen NkentseuDocumentation
Development version, not published. Built from main: it shows what is coming (fixes, descriptions written since the last tag) and can change with every commit. Go to the stable version 0.1.0-beta.11

NkPlatformInline.h

Include
#include "NKPlatform/NkPlatformInline.h"
Link (Jenga)
nkentseudependson(["NKPlatform"])

Macros · 23

NKENTSEU_INLINE_COMPILER_MSVCDefined, with no value, when the compiler is MSVC (_MSC_VER).
NKENTSEU_INLINE_COMPILER_NAMEName of the compiler seen by NkPlatformInline.h, as a string ("MSVC", "Clang", "GCC"...).
NKENTSEU_INLINE_COMPILER_CLANGDefined, with no value, when the compiler is Clang (and not MSVC).
NKENTSEU_INLINE_COMPILER_GCCDefined, with no value, when the compiler is GCC (neither MSVC nor Clang).
NKENTSEU_INLINE_COMPILER_INTELDefined, with no value, when the compiler is Intel's.
NKENTSEU_INLINE_COMPILER_ARMCCDefined, with no value, when the compiler is ARM Compiler (armcc).
NKENTSEU_INLINE_COMPILER_IARDefined, with no value, when the compiler is IAR.
NKENTSEU_INLINE_COMPILER_UNKNOWNDefined, with no value, when no known compiler is recognised.
NKENTSEU_INLINEThe language's inline keyword (inline in C++ and C99, __inline or __inline__ elsewhere).
NKENTSEU_FORCE_INLINEAsks the compiler to inline the function at every call (__forceinline, always_inline).
NKENTSEU_NO_INLINEForbids the compiler from inlining the function (__declspec(noinline), noinline).
NKENTSEU_PURE_FUNCTIONStates that a function has no side effects
NKENTSEU_CONST_FUNCTIONStates that a function only depends on its parameters
NKENTSEU_RESTRICT_RETURNStates that the returned pointer aliases no other pointer
NKENTSEU_RESTRICT_PARAMStates that the pointer parameters do not alias each other
NKENTSEU_NORETURNStates that the function may not return
NKENTSEU_COLD_FUNCTIONStates that the function is unlikely to be called
NKENTSEU_HOT_FUNCTIONStates that the function is very likely to be called
NKENTSEU_LIKELYStates that a condition is probably true
NKENTSEU_UNLIKELYStates that a condition is probably false
NKENTSEU_API_INLINEExports an inline function
NKENTSEU_API_FORCE_INLINEExports a force_inline function
NKENTSEU_API_NO_INLINEExports a no_inline function

Member details

NKENTSEU_INLINE_COMPILER_MSVC

#
macro
#define NKENTSEU_INLINE_COMPILER_MSVC

Defined, with no value, when the compiler is MSVC (_MSC_VER).

NKENTSEU_INLINE_COMPILER_NAME

#
macro
#define NKENTSEU_INLINE_COMPILER_NAME

Name of the compiler seen by NkPlatformInline.h, as a string ("MSVC", "Clang", "GCC"...).

NKENTSEU_INLINE_COMPILER_CLANG

#
macro
#define NKENTSEU_INLINE_COMPILER_CLANG

Defined, with no value, when the compiler is Clang (and not MSVC).

NKENTSEU_INLINE_COMPILER_GCC

#
macro
#define NKENTSEU_INLINE_COMPILER_GCC

Defined, with no value, when the compiler is GCC (neither MSVC nor Clang).

NKENTSEU_INLINE_COMPILER_INTEL

#
macro
#define NKENTSEU_INLINE_COMPILER_INTEL

Defined, with no value, when the compiler is Intel's.

NKENTSEU_INLINE_COMPILER_ARMCC

#
macro
#define NKENTSEU_INLINE_COMPILER_ARMCC

Defined, with no value, when the compiler is ARM Compiler (armcc).

NKENTSEU_INLINE_COMPILER_IAR

#
macro
#define NKENTSEU_INLINE_COMPILER_IAR

Defined, with no value, when the compiler is IAR.

NKENTSEU_INLINE_COMPILER_UNKNOWN

#
macro
#define NKENTSEU_INLINE_COMPILER_UNKNOWN

Defined, with no value, when no known compiler is recognised.

NKENTSEU_INLINE

#
macro
#define NKENTSEU_INLINE

The language's inline keyword (inline in C++ and C99, __inline or __inline__ elsewhere).

NKENTSEU_FORCE_INLINE

#
macro
#define NKENTSEU_FORCE_INLINE

Asks the compiler to inline the function at every call (__forceinline, always_inline).

NKENTSEU_NO_INLINE

#
macro
#define NKENTSEU_NO_INLINE

Forbids the compiler from inlining the function (__declspec(noinline), noinline).

NKENTSEU_PURE_FUNCTION

#
macro
#define NKENTSEU_PURE_FUNCTION

States that a function has no side effects

@codefragment, not compiled
NKENTSEU_PURE_FUNCTION int Square(int x) { return x * x; }

NKENTSEU_CONST_FUNCTION

#
macro
#define NKENTSEU_CONST_FUNCTION

States that a function only depends on its parameters

@codefragment, not compiled
NKENTSEU_CONST_FUNCTION int Add(int a, int b) { return a + b; }

NKENTSEU_RESTRICT_RETURN

#
macro
#define NKENTSEU_RESTRICT_RETURN

States that the returned pointer aliases no other pointer

NKENTSEU_RESTRICT_PARAM

#
macro
#define NKENTSEU_RESTRICT_PARAM(ptr)

States that the pointer parameters do not alias each other

@codefragment, not compiled
void VectorAdd(
    float* NKENTSEU_RESTRICT_PARAM(out),
    const float* NKENTSEU_RESTRICT_PARAM(a),
    const float* NKENTSEU_RESTRICT_PARAM(b),
    size_t count
);

NKENTSEU_NORETURN

#
macro
#define NKENTSEU_NORETURN

States that the function may not return

@codefragment, not compiled
NKENTSEU_NORETURN void FatalError(const char* message);

NKENTSEU_COLD_FUNCTION

#
macro
#define NKENTSEU_COLD_FUNCTION

States that the function is unlikely to be called

NKENTSEU_HOT_FUNCTION

#
macro
#define NKENTSEU_HOT_FUNCTION

States that the function is very likely to be called

NKENTSEU_LIKELY

#
macro
#define NKENTSEU_LIKELY(condition)

States that a condition is probably true

@codefragment, not compiled
if (NKENTSEU_LIKELY(ptr != nullptr)) {
    // Hot path : code fréquemment exécuté
    ProcessData(ptr);
} else {
    // Cold path : gestion d'erreur rare
    HandleNullPointer();
}

NKENTSEU_UNLIKELY

#
macro
#define NKENTSEU_UNLIKELY(condition)

States that a condition is probably false

@codefragment, not compiled
if (NKENTSEU_UNLIKELY(errorCode != 0)) {
    LogError(errorCode);
    return false;
}
// Hot path continue ici sans saut

NKENTSEU_API_INLINE

#
macro
#define NKENTSEU_API_INLINE

Exports an inline function

NKENTSEU_API_FORCE_INLINE

#
macro
#define NKENTSEU_API_FORCE_INLINE

Exports a force_inline function

NKENTSEU_API_NO_INLINE

#
macro
#define NKENTSEU_API_NO_INLINE

Exports a no_inline function