mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
STRINGIFY: use __VA_ARGS__ to avoid C4003 and double quote hack
This commit is contained in:
parent
43eb772d94
commit
128ba92fee
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user