Skip to content

Commit 1b2eecc

Browse files
committed
Cleaning up module related macro definitions
1 parent 321d9fe commit 1b2eecc

22 files changed

Lines changed: 156 additions & 145 deletions

File tree

cmake/templates/hpx.ixx.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ module;
2020

2121
export module HPX.Core@cxx_sub_module@;
2222

23+
// Make sure the exported symbols are name-mangled using standard C++ rules.
24+
// This is necessary as otherwise the symbols exported from the shared libraries
25+
// will be exported from the module using a differently encoded name.
2326
extern "C++" {
24-
27+
2528
#if defined(HPX_MSVC)
2629
// disable warning C5244: '#include <filename>' in the purview of module
2730
// 'HPX.Core' appears erroneous. Consider moving that directive before

libs/core/assertion/include/hpx/assertion/api.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ namespace hpx::assertion {
2222
/// Set the assertion handler to be used within a program. If the handler has been
2323
/// set already once, the call to this function will be ignored.
2424
/// \note This function is not thread safe
25-
HPX_CORE_MODULE_EXPORT void set_assertion_handler(
25+
HPX_CXX_EXPORT HPX_CORE_EXPORT void set_assertion_handler(
2626
assertion_handler handler);
2727
} // namespace hpx::assertion

libs/core/assertion/include/hpx/assertion/evaluate_assert.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
namespace hpx::assertion::detail {
1717

1818
/// \cond NOINTERNAL
19-
HPX_CORE_MODULE_EXPORT void handle_assert(hpx::source_location const& loc,
20-
char const* expr, std::string const& msg) noexcept;
19+
HPX_CXX_EXPORT HPX_CORE_EXPORT void handle_assert(
20+
hpx::source_location const& loc, char const* expr,
21+
std::string const& msg) noexcept;
2122
/// \endcond
2223
} // namespace hpx::assertion::detail

libs/core/assertion/include/hpx/assertion/source_location.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ namespace hpx {
7878
};
7979
#endif
8080

81-
HPX_CORE_MODULE_EXPORT std::ostream& operator<<(
81+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::ostream& operator<<(
8282
std::ostream& os, source_location const& loc);
8383
} // namespace hpx

libs/core/config/include/hpx/config/export_definitions.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# define HPX_SYMBOL_INTERNAL /* empty */
2929
#elif defined(HPX_HAVE_ELF_HIDDEN_VISIBILITY)
3030
# define HPX_SYMBOL_EXPORT __attribute__((visibility("default")))
31-
# define HPX_SYMBOL_IMPORT /* empty */
31+
# define HPX_SYMBOL_IMPORT __attribute__((visibility("default")))
3232
# define HPX_SYMBOL_INTERNAL __attribute__((visibility("hidden")))
3333
#endif
3434

@@ -58,10 +58,6 @@
5858
# define HPX_CXX_EXPORT /* empty */
5959
#endif
6060

61-
#define HPX_CORE_MODULE_EXPORT HPX_CXX_EXPORT HPX_CORE_EXPORT
62-
#define HPX_CORE_MODULE_EXPORT_NODISCARD \
63-
HPX_CXX_EXPORT [[nodiscard]] HPX_CORE_EXPORT
64-
6561
///////////////////////////////////////////////////////////////////////////////
6662
#if defined(HPX_EXPORTS) || defined(HPX_FULL_EXPORTS)
6763
# define HPX_EXPORT HPX_SYMBOL_EXPORT

libs/core/debugging/include/hpx/debugging/attach_debugger.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ namespace hpx::util {
1313

1414
/// Tries to break an attached debugger, if not supported a loop is
1515
/// invoked which gives enough time to attach a debugger manually.
16-
HPX_CORE_MODULE_EXPORT void attach_debugger();
16+
HPX_CXX_EXPORT HPX_CORE_EXPORT void attach_debugger();
1717
} // namespace hpx::util

libs/core/debugging/include/hpx/debugging/backtrace/backtrace.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace hpx::util {
7373
backtrace const* tr_;
7474
};
7575

76-
HPX_CORE_MODULE_EXPORT std::ostream& operator<<(
76+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::ostream& operator<<(
7777
std::ostream& out, trace_manip const& t);
7878
} // namespace detail
7979

@@ -84,6 +84,6 @@ namespace hpx::util {
8484
return detail::trace_manip(tr);
8585
}
8686

87-
HPX_CORE_MODULE_EXPORT_NODISCARD std::string trace(
87+
HPX_CXX_EXPORT [[nodiscard]] HPX_CORE_EXPORT std::string trace(
8888
std::size_t frames_no = HPX_HAVE_THREAD_BACKTRACE_DEPTH);
8989
} // namespace hpx::util

libs/core/debugging/include/hpx/debugging/environ.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// On FreeBSD the environment is available for executables only, so needs to be
2626
// handled explicitly (e.g. see hpx_init_impl.hpp)
2727
// The variable is defined in debugging/src/print.cpp
28-
HPX_CORE_MODULE_EXPORT char** freebsd_environ;
28+
HPX_CXX_EXPORT HPX_CORE_EXPORT char** freebsd_environ;
2929
#else
3030
// this case is handled in debugging/macros.hpp
3131
extern char** environ;

libs/core/debugging/include/hpx/debugging/print.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ namespace hpx::debug {
153153
}
154154
};
155155

156-
HPX_CORE_MODULE_EXPORT void print_ptr(
156+
HPX_CXX_EXPORT HPX_CORE_EXPORT void print_ptr(
157157
std::ostream& os, void const* v, int n);
158158

159159
HPX_CXX_EXPORT template <int N, typename T>
@@ -219,7 +219,7 @@ namespace hpx::debug {
219219
// ------------------------------------------------------------------
220220
namespace detail {
221221

222-
HPX_CORE_MODULE_EXPORT void print_str(
222+
HPX_CXX_EXPORT HPX_CORE_EXPORT void print_str(
223223
std::ostream& os, char const* v, int n);
224224
}
225225

@@ -325,12 +325,13 @@ namespace hpx::debug {
325325
};
326326

327327
///////////////////////////////////////////////////////////////////////
328-
HPX_CORE_MODULE_EXPORT void register_print_info(
328+
HPX_CXX_EXPORT HPX_CORE_EXPORT void register_print_info(
329329
void (*)(std::ostream&));
330-
HPX_CORE_MODULE_EXPORT void generate_prefix(std::ostream& os);
330+
HPX_CXX_EXPORT HPX_CORE_EXPORT void generate_prefix(std::ostream& os);
331331

332332
///////////////////////////////////////////////////////////////////////
333-
HPX_CORE_MODULE_EXPORT void display_to_cout(std::string const& str);
333+
HPX_CXX_EXPORT HPX_CORE_EXPORT void display_to_cout(
334+
std::string const& str);
334335

335336
HPX_CXX_EXPORT template <typename... Args>
336337
void display(char const* prefix, Args const&... args)

libs/core/errors/include/hpx/errors/error.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ namespace hpx {
328328
#undef HPX_ERROR_UNSCOPED_ENUM_DEPRECATION_MSG
329329

330330
// Return a textual representation of a given error code
331-
HPX_CORE_MODULE_EXPORT char const* get_error_name(error e) noexcept;
331+
HPX_CXX_EXPORT HPX_CORE_EXPORT char const* get_error_name(error e) noexcept;
332332

333333
} // namespace hpx
334334

0 commit comments

Comments
 (0)