diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-02-17 21:53:14 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-02-17 21:53:14 -0800 |
| commit | 128ba92feeba2f474d19a5fc738fb60338b5e70a (patch) | |
| tree | 37e0618f882f984ef8348e70dc0c0069cb6f28d6 | |
| parent | 43eb772d9475b4e9ec06eb54dca078a4793ab9e4 (diff) | |
| download | vcpkg-128ba92feeba2f474d19a5fc738fb60338b5e70a.tar.gz vcpkg-128ba92feeba2f474d19a5fc738fb60338b5e70a.zip | |
STRINGIFY: use __VA_ARGS__ to avoid C4003 and double quote hack
| -rw-r--r-- | toolsrc/src/commands_version.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp index 462c31c90..4789e2409 100644 --- a/toolsrc/src/commands_version.cpp +++ b/toolsrc/src/commands_version.cpp @@ -3,10 +3,10 @@ #include "vcpkg_System.h" #include "metrics.h" -#define STRINGIFY(X) #X +#define STRINGIFY(...) #__VA_ARGS__ #define MACRO_TO_STRING(X) STRINGIFY(X) -#define VCPKG_VERSION_AS_STRING MACRO_TO_STRING(VCPKG_VERSION)"" // Double quotes needed at the end to prevent blank token +#define VCPKG_VERSION_AS_STRING MACRO_TO_STRING(VCPKG_VERSION) namespace vcpkg::Commands::Version { @@ -15,12 +15,7 @@ namespace vcpkg::Commands::Version static const std::string s_version = #include "../VERSION.txt" - -#pragma warning( push ) -#pragma warning( disable : 4003) - // VCPKG_VERSION can be defined but have no value, which yields C4003. + std::string(VCPKG_VERSION_AS_STRING) -#pragma warning( pop ) #ifndef NDEBUG + std::string("-debug") #endif |
