diff options
-rw-r--r-- | src/build-data/buildh.in | 4 | ||||
-rw-r--r-- | src/cli/cli.h | 3 | ||||
-rw-r--r-- | src/lib/base/algo_registry.h | 5 | ||||
-rw-r--r-- | src/tests/tests.h | 3 |
4 files changed, 9 insertions, 6 deletions
diff --git a/src/build-data/buildh.in b/src/build-data/buildh.in index 42d5a1531..338787de5 100644 --- a/src/build-data/buildh.in +++ b/src/build-data/buildh.in @@ -289,4 +289,8 @@ softare-based entropy polling is still used. */ %{local_config} +// Append to macros living outside of functions, so that invocations must end with a semicolon. +// The struct is only declared to force the semicolon, it is never defined. +#define BOTAN_FORCE_SEMICOLON struct BOTAN_DUMMY_STRUCT + #endif diff --git a/src/cli/cli.h b/src/cli/cli.h index 49167b2ad..890d4a630 100644 --- a/src/cli/cli.h +++ b/src/cli/cli.h @@ -547,7 +547,8 @@ class Command #define BOTAN_REGISTER_COMMAND(name, CLI_Class) \ namespace { Botan_CLI::Command::Registration \ - reg_cmd_ ## CLI_Class(name, []() -> Botan_CLI::Command* { return new CLI_Class; }); } + reg_cmd_ ## CLI_Class(name, []() -> Botan_CLI::Command* { return new CLI_Class; }); } \ + BOTAN_FORCE_SEMICOLON } diff --git a/src/lib/base/algo_registry.h b/src/lib/base/algo_registry.h index 4265b737d..eebbaa4e8 100644 --- a/src/lib/base/algo_registry.h +++ b/src/lib/base/algo_registry.h @@ -8,6 +8,7 @@ #ifndef BOTAN_ALGO_REGISTRY_H__ #define BOTAN_ALGO_REGISTRY_H__ +#include <botan/build.h> #include <botan/types.h> #include <botan/exceptn.h> #include <functional> @@ -262,10 +263,6 @@ make_new_T_1X(const typename Algo_Registry<T>::Spec& spec) return new T(x.release()); } -// Append to macros living outside of functions, so that invocations must end with a semicolon. -// The struct is only declared to force the semicolon, it is never defined. -#define BOTAN_FORCE_SEMICOLON struct BOTAN_DUMMY_STRUCT - #define BOTAN_REGISTER_TYPE(T, type, name, maker, provider, pref) \ namespace { Algo_Registry<T>::Add g_ ## type ## _reg(name, maker, provider, pref); } \ BOTAN_FORCE_SEMICOLON diff --git a/src/tests/tests.h b/src/tests/tests.h index f98194278..5a075975d 100644 --- a/src/tests/tests.h +++ b/src/tests/tests.h @@ -325,7 +325,8 @@ class Test * Register the test with the runner */ #define BOTAN_REGISTER_TEST(type, Test_Class) \ - namespace { Test::Registration reg_ ## Test_Class ## _tests(type, new Test_Class); } + namespace { Test::Registration reg_ ## Test_Class ## _tests(type, new Test_Class); } \ + BOTAN_FORCE_SEMICOLON /* * A test based on reading an input file which contains key/value pairs |