ToyGine2 26.2.0
Game Engine for retro consoles
Loading...
Searching...
No Matches
platform_config.hpp File Reference

Compile-time platform and CPU bindings for Windows. More...

Include dependency graph for platform_config.hpp:

Go to the source code of this file.

Macros

#define __FUNC_SIGNATURE__   __func__
#define assert(expression)
 Debug assertion macro for runtime expression checking.
#define assert_message(expression, message)
 Debug assertion macro with custom message for runtime expression checking.

Detailed Description

Compile-time platform and CPU bindings for Windows.

Defines toy::Platform and toy::CpuArchitecture values (currentPlatform, currentCpuArchitecture) for Windows targets.

Note
Included by Windows platform translation units; not a public module header.

Macro Definition Documentation

◆ __FUNC_SIGNATURE__

#define __FUNC_SIGNATURE__   __func__

◆ assert

#define assert ( expression)
Value:
do { \
if (!(expression)) { \
if (std::is_constant_evaluated()) { \
toy::assertion::assertCompileTimeError(); \
} else { \
toy::assertion::assertion(#expression, nullptr, __FILE__, __FUNC_SIGNATURE__, __LINE__); \
} \
} \
} while (0)
#define __FUNC_SIGNATURE__
Definition platform_config.hpp:66

Debug assertion macro for runtime expression checking.

This macro provides runtime assertion checking in debug builds. It evaluates the given expression and triggers an assertion failure if the expression is false. In release builds, this macro expands to nothing.

Parameters
expressionBoolean expression to check. Prefer side-effect-free.
Note
This macro is only active in debug builds (_DEBUG defined).
In release builds, this macro expands to ((void)0) and has no effect.
Assertion failures will call toy::assertion::assertion with file, function, and line information.
The expression is evaluated only once and should not have side effects.
Warning
Do not rely on the expression being evaluated in release builds.
The expression should not have side effects as it may not be evaluated in release builds.
See also
assert_message, toy::assertion::assertion

◆ assert_message

#define assert_message ( expression,
message )
Value:
do { \
if (!(expression)) { \
if (std::is_constant_evaluated()) { \
toy::assertion::assertCompileTimeError(); \
} else { \
toy::assertion::assertion(#expression, message, __FILE__, __FUNC_SIGNATURE__, __LINE__); \
} \
} \
} while (0)

Debug assertion macro with custom message for runtime expression checking.

This macro provides runtime assertion checking in debug builds with a custom error message. It evaluates the given expression and triggers an assertion failure with the provided message if the expression is false. In release builds, this macro expands to nothing.

Parameters
expressionBoolean expression to check. Prefer side-effect-free.
messageA custom error message to display on assertion failure. Must be a C string literal.
Note
This macro is only active in debug builds (_DEBUG defined).
In release builds, this macro expands to ((void)0) and has no effect.
Assertion failures will call toy::assertion::assertion with file, function, line, and custom message.
The expression is evaluated only once and should not have side effects.
The message parameter is passed as-is to the assertion handler.
Warning
Do not rely on the expression being evaluated in release builds.
The expression should not have side effects as it may not be evaluated in release builds.
The message should be a C string literal for optimal performance.
See also
assert, toy::assertion::assertion