From 1fd50b4deae59353695dc8cf8dac562f69eb6cf1 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Mon, 18 Dec 2017 16:35:43 -0800 Subject: [PATCH] Fix MSVC build. --- src/utils.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/utils.cc b/src/utils.cc index 832a6243..fa7f618d 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -19,9 +19,14 @@ #include #endif -//#define _STRINGIFY(x) #x -//#define ENSURE_STRING_MACRO_ARGUMENT(x) _STRINGIFY(x) +// DEFAULT_RESOURCE_DIRECTORY is passed with quotes for non-MSVC compilers, ie, +// foo vs "foo". +#if defined(_MSC_VER ) +#define _STRINGIFY(x) #x +#define ENSURE_STRING_MACRO_ARGUMENT(x) _STRINGIFY(x) +#else #define ENSURE_STRING_MACRO_ARGUMENT(x) x +#endif // See http://stackoverflow.com/a/217605 void TrimStart(std::string& s) {