Master header file for Platform-wide declarations.
More...
#include <Windows.h>
#include <cstddef>
#include <cstdint>
#include <string>
Go to the source code of this file.
|
| | psystem |
| | Contains the process examination "system" and basic frameworks.
|
| |
|
|
#define | PSYSTEM_FRAMEWORK_PLATFORM_HPP |
| |
|
#define | _ALLOW_KEYWORD_MACROS |
| | Tell MSVC to allow certain keywords.
|
| |
|
#define | constexpr const |
| | Replace keyword with something useful.
|
| |
|
#define | noexcept throw() |
| | Replace keyword with something useful.
|
| |
|
| #define | LIKELY(cond) (cond) |
| | Alters branch prediction in generated code to favor a "true" result. More...
|
| |
| #define | UNLIKELY(cond) (cond) |
| | Alters branch prediction in generated code to favor a false result. More...
|
| |
| #define | ASSERT(cond) |
| | Abort the process if the condition is not satisfied. More...
|
| |
| #define | ASSERT_USING_VAR(var, cond) ((void)(var)) |
| | Abort the process if the condition is not satisfied, declaring the a variable is used by the assertion. More...
|
| |
Master header file for Platform-wide declarations.
- Author
- Matt Bisson
- Date
- 5 August, 2014
- Since
- PSystem 2.0
- Version
- PSystem 2.0
- Copyright
- This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details.
- Todo:
Decide on a consistent approach between TCHAR and char...
Remove "_t" from non-system types.
- Note
- MSVC does not support the
noexcept keyword in 2013. Consequently, we cannot provide defaulted CTORs and DTORs that have an exception specification either as required by the C++ language (see C++ specification 8.4.2). There is a run-time benefit associated with noexcept (and to a lesser extent, throw()), so we'll still try to use it.
Abort the process if the condition is not satisfied.
This macro evaluates to nothing unless _DEBUG is defined as a preprocessor token. If the condition evaluates to false, the macro prints the condition as well as the source code location to stderr.
- Parameters
-
| cond | The (boolean) condition that we assert is always true. |
| #define ASSERT_USING_VAR |
( |
|
var, |
|
|
|
cond |
|
) |
| ((void)(var)) |
Abort the process if the condition is not satisfied, declaring the a variable is used by the assertion.
This macro behaves identically to the ASSERT() macro, however it marks a variable as "used" to prevent compilation warnings in non-debug code.
- Parameters
-
| var | The name of the variable that the assertion examines. |
| cond | The (boolean) condition that we assert is always true. |
| #define LIKELY |
( |
|
cond | ) |
(cond) |
Alters branch prediction in generated code to favor a "true" result.
- Parameters
-
| cond | A conditional expression that will be evaluated. |
| #define MAKE_FILE_VERSION_ID |
( |
|
maj, |
|
|
|
min, |
|
|
|
patch, |
|
|
|
bld |
|
) |
| |
Value:
STRINGIZE_SINGLE_VERSION_ID(min) "." \
STRINGIZE_SINGLE_VERSION_ID(patch) " (build " \
STRINGIZE_SINGLE_VERSION_ID(bld) ")"
Builds a string to represent the version of a specific file.
- Parameters
-
| [in] | maj | Major version number (expects an integer). |
| [in] | min | Minor version number (expects an integer). |
| [in] | patch | Patch level (expects an integer). |
| [in] | bld | Build ID / number (expects an integer). |
| #define MAKE_PRODUCT_VERSION_ID |
( |
|
maj, |
|
|
|
min, |
|
|
|
patch |
|
) |
| |
Value:
STRINGIZE_SINGLE_VERSION_ID(min) "." \
STRINGIZE_SINGLE_VERSION_ID(patch)
Builds a string to represent the product version.
- Parameters
-
| [in] | maj | Major version number (expects an integer). |
| [in] | min | Minor version number (expects an integer). |
| [in] | patch | Patch level (expects an integer). |
| #define STRINGIZE_SINGLE_VERSION_ID |
( |
|
id | ) |
#id |
Make a C-string from a token.
This is required for the resource file. It seems that some (not all) fields require an extra indirection to construct the desired string. When passing a pre-processor constant to one of the MAKE_xxx_VERSION_ID macros, the result becomes the names of the macros passed in instead of the version numbers that those macros define.
- Parameters
-
| [in] | id | The token to form into a string. |
| #define UNLIKELY |
( |
|
cond | ) |
(cond) |
Alters branch prediction in generated code to favor a false result.
- Parameters
-
| cond | A conditional expression that will be evaluated. |