aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2015-12-26 16:39:33 +0100
committerSimon Warta <[email protected]>2016-01-11 16:20:31 +0100
commitbd7ae5416385c12437dbb1e8cf377e0e817e7a90 (patch)
treeea04970928130fd720dfba9f9587f6b9fa517560
parent672d29570e55686b90126b5d6f5d337ddf0b8f04 (diff)
Get rid of "extra ';'" warnings and force semicolon after macros
-rw-r--r--src/build-data/buildh.in4
-rw-r--r--src/cli/cli.h3
-rw-r--r--src/lib/base/algo_registry.h5
-rw-r--r--src/tests/tests.h3
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