diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f46036..bc67965 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,8 +57,6 @@ option(MSVC_STHREADED_RT "MSVC: Build with single-threaded static runtime libs ( ### if(YAML_CPP_BUILD_OLD_API) set(API_DEFINE "#define YAML_CPP_OLD_API") -else() - set(API_DEFINE "#undef YAML_CPP_OLD_API") endif() configure_file(${YAML_CPP_SOURCE_DIR}/include/yaml-cpp/yaml.h.cmake ${YAML_CPP_SOURCE_DIR}/include/yaml-cpp/yaml.h @ONLY) diff --git a/include/yaml-cpp/yaml.h.cmake b/include/yaml-cpp/yaml.h.cmake index 9f2c360..1c93755 100644 --- a/include/yaml-cpp/yaml.h.cmake +++ b/include/yaml-cpp/yaml.h.cmake @@ -5,6 +5,7 @@ #pragma once #endif +#undef YAML_CPP_OLD_API @API_DEFINE@ #include "yaml-cpp/parser.h" diff --git a/src/null.cpp b/src/null.cpp index 240de33..61a634b 100644 --- a/src/null.cpp +++ b/src/null.cpp @@ -1,6 +1,6 @@ #include "yaml-cpp/null.h" -#if YAML_CPP_OLD_API +#ifdef YAML_CPP_OLD_API #include "yaml-cpp/old-api/node.h" #endif @@ -8,7 +8,7 @@ namespace YAML { _Null Null; -#if YAML_CPP_OLD_API +#ifdef YAML_CPP_OLD_API bool IsNull(const Node& node) { return node.Read(Null); diff --git a/src/parser.cpp b/src/parser.cpp index c131b14..8f2725e 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -9,7 +9,7 @@ #include #include -#if YAML_CPP_OLD_API +#ifdef YAML_CPP_OLD_API #include "yaml-cpp/old-api/node.h" #include "old-api/nodebuilder.h" #endif @@ -58,7 +58,7 @@ namespace YAML return true; } -#if YAML_CPP_OLD_API +#ifdef YAML_CPP_OLD_API // GetNextDocument // . Reads the next document in the queue (of tokens). // . Throws a ParserException on error. diff --git a/util/parse.cpp b/util/parse.cpp index 0653c2a..1187fd3 100644 --- a/util/parse.cpp +++ b/util/parse.cpp @@ -37,7 +37,7 @@ public: void parse(std::istream& input) { try { -#if YAML_CPP_OLD_API +#ifdef YAML_CPP_OLD_API YAML::Parser parser(input); YAML::Node doc; while(parser.GetNextDocument(doc)) {