projects/guix·blob python-team · refs

41 lines · 1.5 KiB

1From a4c4e4f3c410834c3e56f644841f5bcbb084225c Mon Sep 17 00:00:00 2001
2From: Liliana Marie Prikler <[email protected]>
3Date: Fri, 28 Jun 2024 11:15:16 +0200
4Subject: [PATCH] clasp: Hide Event_t<T>::id_s.
5
6This patch helps build clingo with non-local clasp while keeping the
7event system working as intended.
8---
9 clasp/util/misc_types.h | 2 ++
10 src/CMakeLists.txt | 2 +-
11 2 files changed, 3 insertions(+), 1 deletion(-)
12
13diff --git a/clasp/util/misc_types.h b/clasp/util/misc_types.h
14index 3677873..09c2075 100644
15--- a/clasp/util/misc_types.h
16+++ b/clasp/util/misc_types.h
17@@ -432,7 +432,9 @@ struct Event_t : Event {
18 Event_t(Subsystem sys, Verbosity verb) : Event(sys, id_s, verb) {}
19 static const uint32 id_s;
20 };
21+#if _BUILDING_CLASP_
22 template <class T> const uint32 Event_t<T>::id_s = Event::nextId();
23+#endif
24
25 template <class ToType, class EvType> const ToType* event_cast(const EvType& ev) { return ev.id == ToType::id_s ? static_cast<const ToType*>(&ev) : 0; }
26
27diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
28index 8439d12..4f55990 100644
29--- a/src/CMakeLists.txt
30+++ b/src/CMakeLists.txt
31@@ -123,6 +123,7 @@ source_group("${ide_header}\\mt" FILES ${header_mt})
32 endif()
33
34 add_library(libclasp ${header} ${header_util} ${header_cli} ${header_mt} ${src})
35+target_compile_definitions(libclasp PRIVATE _BUILDING_CLASP_)
36 if (CLASP_BUILD_WITH_THREADS)
37 target_link_libraries(libclasp PUBLIC Threads::Threads)
38 target_compile_options(libclasp PRIVATE
39--
402.45.1
41