From ec5ba794473f0a816004436332d3f489b9f7c838 Mon Sep 17 00:00:00 2001 From: John Keiser Date: Fri, 5 Mar 2021 11:48:34 -0800 Subject: [PATCH] Add base.h to allow src/ to pick and choose includes --- include/simdjson.h | 24 +----------------------- include/simdjson/base.h | 25 +++++++++++++++++++++++++ include/simdjson/builtin.h | 2 +- include/simdjson/dom.h | 5 +++++ include/simdjson/implementations.h | 5 +++++ 5 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 include/simdjson/base.h diff --git a/include/simdjson.h b/include/simdjson.h index 2aa311ed..f09c9f46 100644 --- a/include/simdjson.h +++ b/include/simdjson.h @@ -34,30 +34,8 @@ } */ -#include "simdjson/compiler_check.h" -#include "simdjson/common_defs.h" - -SIMDJSON_PUSH_DISABLE_WARNINGS -SIMDJSON_DISABLE_UNDESIRED_WARNINGS - -// Public API -#include "simdjson/simdjson_version.h" -#include "simdjson/error.h" -#include "simdjson/minify.h" -#include "simdjson/padded_string.h" -#include "simdjson/padded_string_view.h" -#include "simdjson/implementation.h" - -// Inline functions -#include "simdjson/error-inl.h" -#include "simdjson/padded_string-inl.h" -#include "simdjson/padded_string_view-inl.h" - -// DOM +#include "simdjson/base.h" #include "simdjson/dom.h" -// Implementations #include "simdjson/implementations.h" -SIMDJSON_POP_DISABLE_WARNINGS - #endif // SIMDJSON_H diff --git a/include/simdjson/base.h b/include/simdjson/base.h new file mode 100644 index 00000000..00ce6851 --- /dev/null +++ b/include/simdjson/base.h @@ -0,0 +1,25 @@ +#ifndef SIMDJSON_BASE_H +#define SIMDJSON_BASE_H + +#include "simdjson/compiler_check.h" +#include "simdjson/common_defs.h" + +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_UNDESIRED_WARNINGS + +// Public API +#include "simdjson/simdjson_version.h" +#include "simdjson/error.h" +#include "simdjson/minify.h" +#include "simdjson/padded_string.h" +#include "simdjson/padded_string_view.h" +#include "simdjson/implementation.h" + +// Inline functions +#include "simdjson/error-inl.h" +#include "simdjson/padded_string-inl.h" +#include "simdjson/padded_string_view-inl.h" + +SIMDJSON_POP_DISABLE_WARNINGS + +#endif // SIMDJSON_BASE_H \ No newline at end of file diff --git a/include/simdjson/builtin.h b/include/simdjson/builtin.h index 9353d90c..594a73a8 100644 --- a/include/simdjson/builtin.h +++ b/include/simdjson/builtin.h @@ -32,7 +32,7 @@ namespace simdjson { */ namespace builtin = SIMDJSON_BUILTIN_IMPLEMENTATION; /** - * @overload simdjson::SIMDJSON_BUILTIN_IMPLEMENTATION::ondemand + * @copydoc simdjson::SIMDJSON_BUILTIN_IMPLEMENTATION::ondemand */ namespace ondemand = SIMDJSON_BUILTIN_IMPLEMENTATION::ondemand; /** diff --git a/include/simdjson/dom.h b/include/simdjson/dom.h index eba36013..5629b2b1 100644 --- a/include/simdjson/dom.h +++ b/include/simdjson/dom.h @@ -1,6 +1,9 @@ #ifndef SIMDJSON_DOM_H #define SIMDJSON_DOM_H +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_UNDESIRED_WARNINGS + #include "simdjson/dom/array.h" #include "simdjson/dom/document_stream.h" #include "simdjson/dom/document.h" @@ -25,4 +28,6 @@ #include "simdjson/internal/tape_ref-inl.h" #include "simdjson/dom/serialization-inl.h" +SIMDJSON_POP_DISABLE_WARNINGS + #endif // SIMDJSON_DOM_H diff --git a/include/simdjson/implementations.h b/include/simdjson/implementations.h index 666262e4..8e89efc6 100644 --- a/include/simdjson/implementations.h +++ b/include/simdjson/implementations.h @@ -1,6 +1,9 @@ #ifndef SIMDJSON_IMPLEMENTATIONS_H #define SIMDJSON_IMPLEMENTATIONS_H +SIMDJSON_PUSH_DISABLE_WARNINGS +SIMDJSON_DISABLE_UNDESIRED_WARNINGS + // Implementation-internal files (must be included before the implementations themselves, to keep // amalgamation working--otherwise, the first time a file is included, it might be put inside the // #ifdef SIMDJSON_IMPLEMENTATION_ARM64/FALLBACK/etc., which means the other implementations can't @@ -18,4 +21,6 @@ #include "simdjson/fallback.h" #include "simdjson/builtin.h" +SIMDJSON_POP_DISABLE_WARNINGS + #endif // SIMDJSON_IMPLEMENTATIONS_H \ No newline at end of file