mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Fixed the #ifdefs for the api stuff
This commit is contained in:
@@ -57,8 +57,6 @@ option(MSVC_STHREADED_RT "MSVC: Build with single-threaded static runtime libs (
|
|||||||
###
|
###
|
||||||
if(YAML_CPP_BUILD_OLD_API)
|
if(YAML_CPP_BUILD_OLD_API)
|
||||||
set(API_DEFINE "#define YAML_CPP_OLD_API")
|
set(API_DEFINE "#define YAML_CPP_OLD_API")
|
||||||
else()
|
|
||||||
set(API_DEFINE "#undef YAML_CPP_OLD_API")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
configure_file(${YAML_CPP_SOURCE_DIR}/include/yaml-cpp/yaml.h.cmake ${YAML_CPP_SOURCE_DIR}/include/yaml-cpp/yaml.h @ONLY)
|
configure_file(${YAML_CPP_SOURCE_DIR}/include/yaml-cpp/yaml.h.cmake ${YAML_CPP_SOURCE_DIR}/include/yaml-cpp/yaml.h @ONLY)
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#undef YAML_CPP_OLD_API
|
||||||
@API_DEFINE@
|
@API_DEFINE@
|
||||||
|
|
||||||
#include "yaml-cpp/parser.h"
|
#include "yaml-cpp/parser.h"
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#include "yaml-cpp/null.h"
|
#include "yaml-cpp/null.h"
|
||||||
|
|
||||||
#if YAML_CPP_OLD_API
|
#ifdef YAML_CPP_OLD_API
|
||||||
#include "yaml-cpp/old-api/node.h"
|
#include "yaml-cpp/old-api/node.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ namespace YAML
|
|||||||
{
|
{
|
||||||
_Null Null;
|
_Null Null;
|
||||||
|
|
||||||
#if YAML_CPP_OLD_API
|
#ifdef YAML_CPP_OLD_API
|
||||||
bool IsNull(const Node& node)
|
bool IsNull(const Node& node)
|
||||||
{
|
{
|
||||||
return node.Read(Null);
|
return node.Read(Null);
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#if YAML_CPP_OLD_API
|
#ifdef YAML_CPP_OLD_API
|
||||||
#include "yaml-cpp/old-api/node.h"
|
#include "yaml-cpp/old-api/node.h"
|
||||||
#include "old-api/nodebuilder.h"
|
#include "old-api/nodebuilder.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -58,7 +58,7 @@ namespace YAML
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if YAML_CPP_OLD_API
|
#ifdef YAML_CPP_OLD_API
|
||||||
// GetNextDocument
|
// GetNextDocument
|
||||||
// . Reads the next document in the queue (of tokens).
|
// . Reads the next document in the queue (of tokens).
|
||||||
// . Throws a ParserException on error.
|
// . Throws a ParserException on error.
|
||||||
|
@@ -37,7 +37,7 @@ public:
|
|||||||
void parse(std::istream& input)
|
void parse(std::istream& input)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
#if YAML_CPP_OLD_API
|
#ifdef YAML_CPP_OLD_API
|
||||||
YAML::Parser parser(input);
|
YAML::Parser parser(input);
|
||||||
YAML::Node doc;
|
YAML::Node doc;
|
||||||
while(parser.GetNextDocument(doc)) {
|
while(parser.GetNextDocument(doc)) {
|
||||||
|
Reference in New Issue
Block a user