Skip to content

Commit 702d6a4

Browse files
committed
fix: force macro expansion in version namespace identifier
1 parent 9a58e9a commit 702d6a4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

includes/sjson/version.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@
4949
#endif
5050
#endif
5151

52-
// Name of the namespace, e.g. v08
53-
#define SJSON_CPP_IMPL_VERSION_NAMESPACE_NAME v ## SJSON_CPP_VERSION_MAJOR ## SJSON_CPP_VERSION_MINOR
52+
// Force macro expansion to concatenate namespace identifier
53+
#define SJSON_CPP_IMPL_VERSION_CONCAT_IMPL(prefix, major, minor, patch) prefix ## major ## minor ## patch
54+
#define SJSON_CPP_IMPL_VERSION_CONCAT(prefix, major, minor, patch) SJSON_CPP_IMPL_VERSION_CONCAT_IMPL(prefix, major, minor, patch)
55+
56+
// Name of the namespace, e.g. v082
57+
#define SJSON_CPP_IMPL_VERSION_NAMESPACE_NAME SJSON_CPP_IMPL_VERSION_CONCAT(v, SJSON_CPP_VERSION_MAJOR, SJSON_CPP_VERSION_MINOR, SJSON_CPP_VERSION_PATCH)
5458

5559
// Because this is being introduced in a patch release, as caution, it is disabled
5660
// by default. It does break ABI if host runtimes forward declare types but that

0 commit comments

Comments
 (0)