From ced84e17b685c78bb2cab4c28a5f4786dbfe7522 Mon Sep 17 00:00:00 2001 From: Antonio Andelic Date: Wed, 26 Jan 2022 08:12:09 +0100 Subject: [PATCH] Update nlohmann and remove guards (#336) --- libs/setup.sh | 4 ++-- src/query/cypher_query_interpreter.hpp | 14 ++------------ src/query/frontend/ast/cypher_main_visitor.cpp | 18 ++++-------------- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/libs/setup.sh b/libs/setup.sh index 3f9bee615..bfcc23dee 100755 --- a/libs/setup.sh +++ b/libs/setup.sh @@ -121,7 +121,7 @@ declare -A primary_urls=( ["mgconsole"]="http://$local_cache_host/git/mgconsole.git" ["spdlog"]="http://$local_cache_host/git/spdlog" ["jemalloc"]="http://$local_cache_host/git/jemalloc.git" - ["nlohmann"]="http://$local_cache_host/file/nlohmann/json/b3e5cb7f20dcc5c806e418df34324eca60d17d4e/single_include/nlohmann/json.hpp" + ["nlohmann"]="http://$local_cache_host/file/nlohmann/json/4f8fba14066156b73f1189a2b8bd568bde5284c5/single_include/nlohmann/json.hpp" ["neo4j"]="http://$local_cache_host/file/neo4j-community-3.2.3-unix.tar.gz" ["librdkafka"]="http://$local_cache_host/git/librdkafka.git" ["protobuf"]="http://$local_cache_host/git/protobuf.git" @@ -151,7 +151,7 @@ declare -A secondary_urls=( ["mgconsole"]="http://github.com/memgraph/mgconsole.git" ["spdlog"]="https://github.com/gabime/spdlog" ["jemalloc"]="https://github.com/jemalloc/jemalloc.git" - ["nlohmann"]="https://raw.githubusercontent.com/nlohmann/json/b3e5cb7f20dcc5c806e418df34324eca60d17d4e/single_include/nlohmann/json.hpp" + ["nlohmann"]="https://raw.githubusercontent.com/nlohmann/json/4f8fba14066156b73f1189a2b8bd568bde5284c5/single_include/nlohmann/json.hpp" ["neo4j"]="https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/neo4j-community-3.2.3-unix.tar.gz" ["librdkafka"]="https://github.com/edenhill/librdkafka.git" ["protobuf"]="https://github.com/protocolbuffers/protobuf.git" diff --git a/src/query/cypher_query_interpreter.hpp b/src/query/cypher_query_interpreter.hpp index c4a6a9ba5..620fab0da 100644 --- a/src/query/cypher_query_interpreter.hpp +++ b/src/query/cypher_query_interpreter.hpp @@ -1,4 +1,4 @@ -// Copyright 2021 Memgraph Ltd. +// Copyright 2022 Memgraph Ltd. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source @@ -11,23 +11,13 @@ #pragma once -////////////////////////////////////////////////////// -// THIS INCLUDE SHOULD ALWAYS COME BEFORE THE -// "cypher_main_visitor.hpp" -// "planner.hpp" includes json.hpp which uses libc's -// EOF macro while "cypher_main_visitor.hpp" includes -// "antlr4-runtime.h" which contains a static variable -// of the same name, EOF. -// This hides the definition of the macro which causes -// the compilation to fail. -#include "query/plan/planner.hpp" -////////////////////////////////////////////////////// #include "query/config.hpp" #include "query/frontend/ast/cypher_main_visitor.hpp" #include "query/frontend/opencypher/parser.hpp" #include "query/frontend/semantic/required_privileges.hpp" #include "query/frontend/semantic/symbol_generator.hpp" #include "query/frontend/stripped.hpp" +#include "query/plan/planner.hpp" #include "utils/flag_validation.hpp" #include "utils/timer.hpp" diff --git a/src/query/frontend/ast/cypher_main_visitor.cpp b/src/query/frontend/ast/cypher_main_visitor.cpp index 5d46aa292..16356ac32 100644 --- a/src/query/frontend/ast/cypher_main_visitor.cpp +++ b/src/query/frontend/ast/cypher_main_visitor.cpp @@ -1,4 +1,4 @@ -// Copyright 2021 Memgraph Ltd. +// Copyright 2022 Memgraph Ltd. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source @@ -9,19 +9,6 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -////////////////////////////////////////////////////// -// THIS INCLUDE SHOULD ALWAYS COME BEFORE THE -// "cypher_main_visitor.hpp" -// "module.hpp" includes json.hpp which uses libc's -// EOF macro while "cypher_main_visitor.hpp" includes -// "antlr4-runtime.h" which contains a static variable -// of the same name, EOF. -// This hides the definition of the macro which causes -// the compilation to fail. -#include "query/frontend/ast/ast.hpp" -#include "query/frontend/ast/ast_visitor.hpp" -#include "query/procedure/module.hpp" -////////////////////////////////////////////////////// #include "query/frontend/ast/cypher_main_visitor.hpp" #include @@ -41,8 +28,11 @@ #include #include "query/exceptions.hpp" +#include "query/frontend/ast/ast.hpp" +#include "query/frontend/ast/ast_visitor.hpp" #include "query/frontend/parsing.hpp" #include "query/interpret/awesome_memgraph_functions.hpp" +#include "query/procedure/module.hpp" #include "query/stream/common.hpp" #include "utils/exceptions.hpp" #include "utils/logging.hpp"