mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-29 11:41:36 +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 "vcpkg_System.h"
|
||||||
#include "metrics.h"
|
#include "metrics.h"
|
||||||
|
|
||||||
#define STRINGIFY(X) #X
|
#define STRINGIFY(...) #__VA_ARGS__
|
||||||
#define MACRO_TO_STRING(X) STRINGIFY(X)
|
#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
|
namespace vcpkg::Commands::Version
|
||||||
{
|
{
|
||||||
@ -15,12 +15,7 @@ namespace vcpkg::Commands::Version
|
|||||||
static const std::string s_version =
|
static const std::string s_version =
|
||||||
#include "../VERSION.txt"
|
#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)
|
+ std::string(VCPKG_VERSION_AS_STRING)
|
||||||
#pragma warning( pop )
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
+ std::string("-debug")
|
+ std::string("-debug")
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user