|
Open Model Railroad Network (OpenMRN)
|
#include <stddef.h>Go to the source code of this file.
Macros | |
| #define | EXTERNC |
| Allows both C and C++ compilation. | |
| #define | EXTERNCEND |
| Allows both C and C++ compilation. | |
| #define | DECLARE_CONST(name) |
| Declares a constant value. | |
| #define | DEFAULT_CONST(name, value) DEFAULT_CONST_(name, value) |
| Defines the default value of a constant. | |
| #define | DEFAULT_CONST_(name, value) |
| #define | OVERRIDE_CONST(name, value) OVERRIDE_CONST_(name, value) |
| Overrides the value of a constant. | |
| #define | OVERRIDE_CONST_(name, value) |
| #define | CONSTANT_TRUE 1 |
| We cannot compare constants to zero, so we use 1 and 2 as constant values for booleans. | |
| #define | CONSTANT_FALSE 2 |
| We cannot compare constants to zero, so we use 1 and 2 as constant values for booleans. | |
| #define | DEFAULT_CONST_TRUE(name) DEFAULT_CONST(name, 1) |
| Sets the default value of a boolean constant to true. | |
| #define | DEFAULT_CONST_FALSE(name) DEFAULT_CONST(name, 2) |
| Sets the default value of a boolean constant to false. | |
| #define | OVERRIDE_CONST_TRUE(name) OVERRIDE_CONST(name, 1) |
| Overrides the value of a boolean constant to true. | |
| #define | OVERRIDE_CONST_FALSE(name) OVERRIDE_CONST(name, 2) |
| Overrides the value of a boolean constant to false. | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Utility to specify linking-time constants and overrides for them.
Definition in file constants.hxx.
| #define CONSTANT_FALSE 2 |
We cannot compare constants to zero, so we use 1 and 2 as constant values for booleans.
Definition at line 160 of file constants.hxx.
| #define CONSTANT_TRUE 1 |
We cannot compare constants to zero, so we use 1 and 2 as constant values for booleans.
Definition at line 157 of file constants.hxx.
| #define DECLARE_CONST | ( | name | ) |
Declares a constant value.
Put this into a header and include that header to the code which has to access that constant.
| name | name of the constant. For a name NNN Creates a function called config_NNN() that returns the configured value. |
Definition at line 60 of file constants.hxx.
| #define DEFAULT_CONST | ( | name, | |
| value | |||
| ) | DEFAULT_CONST_(name, value) |
Defines the default value of a constant.
Use this in a single .cxx file and make sure NOT to include the header that has the respective DECLARE_CONST macros. Best not to incude anything at all.
| name | name of the constant. |
| value | is what the default value should be. |
Definition at line 77 of file constants.hxx.
| #define DEFAULT_CONST_ | ( | name, | |
| value | |||
| ) |
Definition at line 79 of file constants.hxx.
| #define DEFAULT_CONST_FALSE | ( | name | ) | DEFAULT_CONST(name, 2) |
Sets the default value of a boolean constant to false.
| name | is the name of the constant to set. |
Definition at line 167 of file constants.hxx.
| #define DEFAULT_CONST_TRUE | ( | name | ) | DEFAULT_CONST(name, 1) |
Sets the default value of a boolean constant to true.
| name | is the name of the constant to set. |
Definition at line 164 of file constants.hxx.
| #define EXTERNC |
Allows both C and C++ compilation.
Definition at line 44 of file constants.hxx.
| #define EXTERNCEND |
Allows both C and C++ compilation.
Definition at line 46 of file constants.hxx.
| #define OVERRIDE_CONST | ( | name, | |
| value | |||
| ) | OVERRIDE_CONST_(name, value) |
Overrides the value of a constant.
Use this is a single .cxx file (usually main.cxx).
| name | name of the constant. |
| value | is what the actual value should be. |
Definition at line 91 of file constants.hxx.
| #define OVERRIDE_CONST_ | ( | name, | |
| value | |||
| ) |
Definition at line 93 of file constants.hxx.
| #define OVERRIDE_CONST_FALSE | ( | name | ) | OVERRIDE_CONST(name, 2) |
Overrides the value of a boolean constant to false.
| name | is the name of the constant to set. |
Definition at line 174 of file constants.hxx.
| #define OVERRIDE_CONST_TRUE | ( | name | ) | OVERRIDE_CONST(name, 1) |
Overrides the value of a boolean constant to true.
| name | is the name of the constant to set. |
Definition at line 171 of file constants.hxx.