From 1de9f65fac6c4b65ff280501d60b9b6dd46c6a8c Mon Sep 17 00:00:00 2001
From: Kurt Kanzenbach <kurt@kmk-computers.de>
Date: Mon, 22 Feb 2021 20:36:14 +0100
Subject: [PATCH 3/3] static_reinit: Remove export macro

This macro leads to doc generation fail:

|/home/kurt/git/hpx/build/docs/sphinx/libs/static_reinit/api.rst:29: WARNING:cpp:identifier reference target not found: HPX_EXPORT_REINITIALIZABLE_STATIC

... and it results in an exception in sphinx:

|Traceback (most recent call last):
|  File "/usr/lib/python3.7/site-packages/sphinx/cmd/build.py", line 280, in build_main
|    app.build(args.force_all, filenames)
|  File "/usr/lib/python3.7/site-packages/sphinx/application.py", line 348, in build
|    self.builder.build_update()
|  File "/usr/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 299, in build_update
|    len(to_build))
|  File "/usr/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 361, in build
|    self.write(docnames, list(updated_docnames), method)
|  File "/usr/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 535, in write
|    self._write_serial(sorted(docnames))
|  File "/usr/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 542, in _write_serial
|    doctree = self.env.get_and_resolve_doctree(docname, self)
|  File "/usr/lib/python3.7/site-packages/sphinx/environment/__init__.py", line 539, in get_and_resolve_doctree
|    self.apply_post_transforms(doctree, docname)
|  File "/usr/lib/python3.7/site-packages/sphinx/environment/__init__.py", line 585, in apply_post_transforms
|    transformer.apply_transforms()
|  File "/usr/lib/python3.7/site-packages/sphinx/transforms/__init__.py", line 87, in apply_transforms
|    super().apply_transforms()
|  File "/usr/lib/python3.7/site-packages/docutils/transforms/__init__.py", line 171, in apply_transforms
|    transform.apply(**kwargs)
|  File "/usr/lib/python3.7/site-packages/sphinx/transforms/post_transforms/__init__.py", line 44, in apply
|    self.run(**kwargs)
|  File "/usr/lib/python3.7/site-packages/sphinx/transforms/post_transforms/__init__.py", line 88, in run
|    typ, target, node, contnode)
|  File "/usr/lib/python3.7/site-packages/sphinx/domains/cpp.py", line 7502, in resolve_xref
|    target, node, contnode)[0]
|  File "/usr/lib/python3.7/site-packages/sphinx/domains/cpp.py", line 7375, in _resolve_xref_inner
|    assert parentSymbol  # should be there
|AssertionError

Actually the macro is not needed. So, just remove it until sphinx is fixed.

Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
---
 .../hpx/static_reinit/reinitializable_static.hpp   | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/libs/core/static_reinit/include/hpx/static_reinit/reinitializable_static.hpp b/libs/core/static_reinit/include/hpx/static_reinit/reinitializable_static.hpp
index 51ccbf2481b2..b8661d1c84cb 100644
--- a/libs/core/static_reinit/include/hpx/static_reinit/reinitializable_static.hpp
+++ b/libs/core/static_reinit/include/hpx/static_reinit/reinitializable_static.hpp
@@ -18,14 +18,6 @@
 #include <mutex>
 #include <type_traits>
 
-// clang-format off
-#if !defined(HPX_WINDOWS)
-#  define HPX_EXPORT_REINITIALIZABLE_STATIC HPX_CORE_EXPORT
-#else
-#  define HPX_EXPORT_REINITIALIZABLE_STATIC
-#endif
-// clang-format on
-
 namespace hpx { namespace util {
     ///////////////////////////////////////////////////////////////////////////
     //  Provides thread-safe initialization of a single static instance of T.
@@ -40,11 +32,11 @@ namespace hpx { namespace util {
     //  functions used by the HPX runtime system to reinitialize the held data
     //  structures.
     template <typename T, typename Tag = T, std::size_t N = 1>
-    struct HPX_EXPORT_REINITIALIZABLE_STATIC reinitializable_static;
+    struct HPX_EXPORT reinitializable_static;
 
     //////////////////////////////////////////////////////////////////////////
     template <typename T, typename Tag, std::size_t N>
-    struct HPX_EXPORT_REINITIALIZABLE_STATIC reinitializable_static
+    struct HPX_EXPORT reinitializable_static
     {
     public:
         HPX_NON_COPYABLE(reinitializable_static);
@@ -160,5 +152,3 @@ namespace hpx { namespace util {
     template <typename T, typename Tag, std::size_t N>
     std::once_flag reinitializable_static<T, Tag, N>::constructed_;
 }}    // namespace hpx::util
-
-#undef HPX_EXPORT_REINITIALIZABLE_STATIC
-- 
2.30.1

