Fixed the #ifdefs for the api stuff

This commit is contained in:
beder
2011-10-18 14:47:35 -05:00
parent 075f8449f8
commit 488c3d6cef
5 changed files with 6 additions and 7 deletions

View File

@@ -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)

View File

@@ -5,6 +5,7 @@
#pragma once
#endif
#undef YAML_CPP_OLD_API
@API_DEFINE@
#include "yaml-cpp/parser.h"

View File

@@ -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);

View File

@@ -9,7 +9,7 @@
#include <sstream>
#include <cstdio>
#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.

View File

@@ -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)) {