From 1602eda87f9628e2930551f4e4dc2e5af465c85e Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 24 Feb 2023 09:24:43 +0800 Subject: [PATCH] Fix tools build under C++17 --- .../extract_warnings/extract_warnings.cpp | 2 +- ryzom/tools/assoc_mem/tree.h | 8 +++++++- .../leveldesign/alias_synchronizer/alias_synchronizer.cpp | 5 ++++- .../leveldesign/mission_compiler_lib/mission_compiler.cpp | 5 ++++- ryzom/tools/translation_tools/main.cpp | 5 ++++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/nel/tools/misc/log_analyser_plug_ins/extract_warnings/extract_warnings.cpp b/nel/tools/misc/log_analyser_plug_ins/extract_warnings/extract_warnings.cpp index 7d8f6e3eaf..90695d5379 100644 --- a/nel/tools/misc/log_analyser_plug_ins/extract_warnings/extract_warnings.cpp +++ b/nel/tools/misc/log_analyser_plug_ins/extract_warnings/extract_warnings.cpp @@ -29,7 +29,6 @@ #include "extract_warnings.h" #include #include -using namespace std; #include "nel/misc/mem_displayer.h" #include "nel/misc/app_context.h" @@ -39,6 +38,7 @@ using namespace std; #include +using namespace std; BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, diff --git a/ryzom/tools/assoc_mem/tree.h b/ryzom/tools/assoc_mem/tree.h index 1fbf0a68ee..a7a6c59e55 100644 --- a/ryzom/tools/assoc_mem/tree.h +++ b/ryzom/tools/assoc_mem/tree.h @@ -17,6 +17,8 @@ #ifndef NL_TREE_H_ #define NL_TREE_H_ +#include "nel/misc/types_nl.h" + #include #include #include "record.h" @@ -33,7 +35,11 @@ class CTree public: - struct greater : public std::binary_function , std::pair , bool> { + struct greater +#ifndef NL_CPP17 + : public std::binary_function , std::pair , bool> +#endif + { bool operator()(std::pair x, std::pair y) const { return x.first > y.first; diff --git a/ryzom/tools/leveldesign/alias_synchronizer/alias_synchronizer.cpp b/ryzom/tools/leveldesign/alias_synchronizer/alias_synchronizer.cpp index 4c6d2ffa3d..d293ea86f5 100644 --- a/ryzom/tools/leveldesign/alias_synchronizer/alias_synchronizer.cpp +++ b/ryzom/tools/leveldesign/alias_synchronizer/alias_synchronizer.cpp @@ -33,7 +33,10 @@ vector Filters; // always true predicate -struct TAllPrimitivePredicate : public std::unary_function +struct TAllPrimitivePredicate +#ifndef NL_CPP17 + : public std::unary_function +#endif { bool operator () (IPrimitive *prim) { diff --git a/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp b/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp index d58ecbb43b..1cd2b2afbe 100644 --- a/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp +++ b/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp @@ -1156,7 +1156,10 @@ bool strtokquote(const vector &src, VectorType &tokens) return true; } -struct TFindParamPred : std::unary_function +struct TFindParamPred +#ifndef NL_CPP17 + : std::unary_function +#endif { string Name; TFindParamPred(const std::string &name) diff --git a/ryzom/tools/translation_tools/main.cpp b/ryzom/tools/translation_tools/main.cpp index dc91079f31..6c3f0c52df 100644 --- a/ryzom/tools/translation_tools/main.cpp +++ b/ryzom/tools/translation_tools/main.cpp @@ -822,7 +822,10 @@ int mergeStringDiff(int argc, char *argv[], const std::string &baseName) /* -struct TFindPhrase : unary_function +struct TFindPhrase +#ifndef NL_CPP17 + : unary_function + #endif { string Identifier; TFindPhrase (const string &identifier)