From 552c7012f4497c910610e01a7c7b5b1f4ef8b6f4 Mon Sep 17 00:00:00 2001 From: yhirose Date: Thu, 30 Jul 2015 17:23:31 -0400 Subject: [PATCH] Changed PEGLIB_HAS_CONSTEXPR_SUPPORT TO BE PEGLIB_NO_CONSTEXPR_SUPPORT. --- CMakeLists.txt | 2 +- language/CMakeLists.txt | 2 +- language/vc14/culebra.vcxproj | 4 ++-- peglib.h | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6fd919..073f507 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0) include_directories(.) -add_definitions("-std=c++1y" -DPEGLIB_HAS_CONSTEXPR_SUPPORT) +add_definitions("-std=c++1y") add_executable(peglint lint/peglint.cc) target_link_libraries(peglint pthread) diff --git a/language/CMakeLists.txt b/language/CMakeLists.txt index ae57321..e4eefab 100644 --- a/language/CMakeLists.txt +++ b/language/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.0) include_directories(..) -add_definitions("-std=c++1y" -DPEGLIB_HAS_CONSTEXPR_SUPPORT) +add_definitions("-std=c++1y") add_executable(culebra main.cc) diff --git a/language/vc14/culebra.vcxproj b/language/vc14/culebra.vcxproj index a1501b6..54d7077 100644 --- a/language/vc14/culebra.vcxproj +++ b/language/vc14/culebra.vcxproj @@ -59,7 +59,7 @@ Level3 Disabled - PEGLIB_HAS_CONSTEXPR_SUPPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) ../.. @@ -76,7 +76,7 @@ MaxSpeed true true - PEGLIB_HAS_CONSTEXPR_SUPPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) ../.. diff --git a/peglib.h b/peglib.h index 7b4c713..f883c76 100644 --- a/peglib.h +++ b/peglib.h @@ -1945,7 +1945,7 @@ private: const int AstDefaultTag = -1; -#ifdef PEGLIB_HAS_CONSTEXPR_SUPPORT +#ifndef PEGLIB_NO_CONSTEXPR_SUPPORT inline constexpr unsigned int str2tag(const char* str, int h = 0) { return !str[h] ? 5381 : (str2tag(str, h + 1) * 33) ^ str[h]; } @@ -1959,14 +1959,14 @@ struct Ast { Ast(const char* path, size_t line, size_t column, const char* name, const std::vector>& nodes) : path(path ? path : ""), line(line), column(column), name(name), original_name(name), is_token(false), nodes(nodes) -#ifdef PEGLIB_HAS_CONSTEXPR_SUPPORT +#ifndef PEGLIB_NO_CONSTEXPR_SUPPORT , tag(str2tag(name)), original_tag(tag) #endif {} Ast(const char* path, size_t line, size_t column, const char* name, const std::string& token) : path(path ? path : ""), line(line), column(column), name(name), original_name(name), is_token(true), token(token) -#ifdef PEGLIB_HAS_CONSTEXPR_SUPPORT +#ifndef PEGLIB_NO_CONSTEXPR_SUPPORT , tag(str2tag(name)), original_tag(tag) #endif {} @@ -1974,7 +1974,7 @@ struct Ast Ast(const Ast& ast, const char* original_name) : path(ast.path), line(ast.line), column(ast.column), name(ast.name), original_name(original_name) , is_token(ast.is_token), token(ast.token), nodes(ast.nodes) -#ifdef PEGLIB_HAS_CONSTEXPR_SUPPORT +#ifndef PEGLIB_NO_CONSTEXPR_SUPPORT , tag(ast.tag), original_tag(str2tag(original_name)) #endif {} @@ -1992,7 +1992,7 @@ struct Ast const std::string token; const std::vector> nodes; std::shared_ptr parent_node; -#ifdef PEGLIB_HAS_CONSTEXPR_SUPPORT +#ifndef PEGLIB_NO_CONSTEXPR_SUPPORT const unsigned int tag; const unsigned int original_tag; #endif