Macros defined in the misc
library.
More...
|
#define | NLIB_NOEMPTYFILE() |
| Writing this macro in a file that should be empty for some reasons can prevent the Linker warning 4221 in MSVC from occurring.
|
|
#define | NLIB_FINAL final |
| Defines final if it is available for use. If not, holds an empty string.
|
|
#define | NLIB_OVERRIDE override |
| Defines override if it is available for use. If not, holds an empty string.
|
|
#define | NLIB_CEXPR constexpr |
| Defines constexpr if it is available for use. If not, holds an empty string.
|
|
#define | NLIB_TRY if (true) |
| Defines try if exceptions are enabled. If not, defines if (true) .
|
|
#define | NLIB_CATCH(x) if (false) |
| Defines catch(x) if exceptions are enabled. If not, defines if (true) . More...
|
|
#define | NLIB_THROW |
| Defines throw if exceptions are enabled. If not, defines a space.
|
|
#define | NLIB_NOEXCEPT noexcept |
| Defines noexcept geared to the environment, or the equivalent. More...
|
|
#define | NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName) |
| Prohibits use of the copy constructor and assignment operator for the class specified by TypeName. More...
|
|
#define | NLIB_STATIC_ASSERT(exp) static_assert((exp), "NLIB_STATIC_ASSERT error: " #exp) |
| Defines a static assertion. Uses static_assert if it is available for use. More...
|
|
#define | NLIB_ALIGNAS(x) alignas(x) |
| Defines alignas(x) or the equivalent. More...
|
|
#define | NLIB_ALIGNOF(tp) alignof(tp) |
| Defines alignof(tp) or the equivalent. More...
|
|
#define | NLIB_SAFE_BOOL(class_name, exp) |
| Defines a safe operator bool function in the class. Uses the C++11 explicit bool if it is available for use. More...
|
|
Macros defined in the misc
library.
- Description
- Mainly defines the macros used when
Nflags.h
is used.
NLIB_ALIGNAS |
( |
|
x | ) |
alignas(x) |
NLIB_ALIGNOF |
( |
|
tp | ) |
alignof(tp) |
Defines alignof(tp)
or the equivalent.
- Parameters
-
- Description
Platform | Definition |
Win32 | __alignof(tp) |
Linux | alignof(tp) or __alignof__(tp) |
FreeBSD | alignof(tp) |
OS X | alignof(tp) |
CAFE | __alignof__(tp) |
CTR | __alignof__(tp) |
- Examples:
- heap/gameheap/gameheap_appcode.cpp.
Definition at line 210 of file Config.h.
#define NLIB_CATCH |
( |
|
x | ) |
if (false) |
Defines catch(x)
if exceptions are enabled. If not, defines if (true)
.
- Parameters
-
[in] | x | The catch parameter. |
NLIB_DISALLOW_COPY_AND_ASSIGN |
( |
|
TypeName | ) |
|
NLIB_FLAGS_DECLARE_bool |
( |
|
opt_name | ) |
extern bool NLIB_FLAGS_##opt_name |
Enables the use of an NLIB_FLAGS_option
name that was defined in a different place.
- Parameters
-
[in] | opt_name | An option name. |
Definition at line 122 of file Nflags.h.
NLIB_FLAGS_DECLARE_double |
( |
|
opt_name | ) |
extern double NLIB_FLAGS_##opt_name |
Enables the use of an NLIB_FLAGS_option
name that was defined in a different place.
- Parameters
-
[in] | opt_name | An option name v. |
Definition at line 124 of file Nflags.h.
NLIB_FLAGS_DECLARE_int32 |
( |
|
opt_name | ) |
extern int32_t NLIB_FLAGS_##opt_name |
Enables the use of an NLIB_FLAGS_option
name that was defined in a different place.
- Parameters
-
[in] | opt_name | An option name. |
Definition at line 123 of file Nflags.h.
NLIB_FLAGS_DECLARE_string |
( |
|
opt_name | ) |
extern const char* NLIB_FLAGS_##opt_name |
Enables the use of an NLIB_FLAGS_option
name that was defined in a different place.
- Parameters
-
[in] | opt_name | An option name. |
Definition at line 125 of file Nflags.h.
NLIB_FLAGS_DEFINE_bool |
( |
|
opt_name, |
|
|
|
def_value, |
|
|
|
desc |
|
) |
| |
Value:bool NLIB_FLAGS_##opt_name; \
class NLIB_FLAGS_CL_##opt_name { \
public: \
NLIB_FLAGS_CL_##opt_name() { \
::nlib_ns::nflags::AddDefOptBool(#opt_name, def_value, desc, &NLIB_FLAGS_##opt_name); \
} \
} NLIB_FLAGS_CL_##opt_name##_
Defines a command-line option with a bool
value.
- Parameters
-
[in] | opt_name | An option name. |
[in] | def_value | The default value of the command-line option ( a bool -type value). |
[in] | desc | A string literal that serves as the description of the option. |
- Description
- Use this macro to define a variable named
NLIB_FLAGS_option
name. Specify bool
values as follows: --opt_value and --opt_value=[true/false].
- Examples:
- misc/nflags/nflags.cpp.
Definition at line 83 of file Nflags.h.
NLIB_FLAGS_DEFINE_double |
( |
|
opt_name, |
|
|
|
def_value, |
|
|
|
desc |
|
) |
| |
Value:double NLIB_FLAGS_##opt_name; \
class NLIB_FLAGS_CL_##opt_name { \
public: \
NLIB_FLAGS_CL_##opt_name() { \
::nlib_ns::nflags::AddDefOptDouble(#opt_name, def_value, desc, \
&NLIB_FLAGS_##opt_name); \
} \
} NLIB_FLAGS_CL_##opt_name##_
Defines a command-line option with a bool
value.
- Parameters
-
[in] | opt_name | An option name. |
[in] | def_value | The default value of the command line option (a double -type value). |
[in] | desc | A string literal that serves as the description of the option. |
- Description
- Use this macro to define a variable named
NLIB_FLAGS_option
name. Specify double-precision floating point type values as follows: --opt_value=1.1.
Definition at line 102 of file Nflags.h.
NLIB_FLAGS_DEFINE_int32 |
( |
|
opt_name, |
|
|
|
def_value, |
|
|
|
desc |
|
) |
| |
Value:int32_t NLIB_FLAGS_##opt_name; \
class NLIB_FLAGS_CL_##opt_name { \
public: \
NLIB_FLAGS_CL_##opt_name() { \
::nlib_ns::nflags::AddDefOptInt32(#opt_name, def_value, desc, \
&NLIB_FLAGS_##opt_name); \
} \
} NLIB_FLAGS_CL_##opt_name##_
Defines a command-line option with a bool
value.
- Parameters
-
[in] | opt_name | An option name. |
[in] | def_value | The default value of the command line option (an int32_t -type value). |
[in] | desc | A string literal that serves as the description of the option. |
- Description
- Use this macro to define a variable named
NLIB_FLAGS_option
name. Specify integer values as follows: --opt_value=1.
- Examples:
- misc/nflags/nflags.cpp.
Definition at line 92 of file Nflags.h.
NLIB_FLAGS_DEFINE_string |
( |
|
opt_name, |
|
|
|
def_value, |
|
|
|
desc |
|
) |
| |
Value:const char* NLIB_FLAGS_##opt_name; \
class NLIB_FLAGS_CL_##opt_name { \
public: \
NLIB_FLAGS_CL_##opt_name() { \
::nlib_ns::nflags::AddDefOptString(#opt_name, def_value, desc, \
&NLIB_FLAGS_##opt_name); \
} \
} NLIB_FLAGS_CL_##opt_name##_
Defines a command-line option with a bool
value.
- Parameters
-
[in] | opt_name | An option name. |
[in] | def_value | The default value of the command-line option (a string literal). |
[in] | desc | A string literal that serves as the description of the option. |
Use this macro to define a variable named NLIB_FLAGS_option
name. Specify strings as follows: --opt_value=A,B,C.
- Examples:
- misc/nflags/nflags.cpp.
Definition at line 112 of file Nflags.h.
#define NLIB_NOEXCEPT noexcept |
NLIB_SAFE_BOOL |
( |
|
class_name, |
|
|
|
exp |
|
) |
| |
Value:public: \
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Defines a safe operator bool
function in the class. Uses the C++11 explicit bool
if it is available for use.
- Parameters
-
[in] | class_name | The class name. |
[in] | exp | Evaluation expression. |
Definition at line 141 of file Config.h.
NLIB_STATIC_ASSERT |
( |
|
exp | ) |
static_assert((exp), "NLIB_STATIC_ASSERT error: " #exp) |