From 8042aa39bfd2ca63f70d30a7d900cee5e310a409 Mon Sep 17 00:00:00 2001 From: Anton Samokhvalov Date: Sun, 7 Jan 2024 00:13:35 +0300 Subject: [PATCH] fix: ODR issues in plugin bundle generation (#1486) fix possible ODR - multiple classes with same name in different .cpp files --- dist/web/plugin-bundle.cpp.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/web/plugin-bundle.cpp.in b/dist/web/plugin-bundle.cpp.in index 1e6fc7d52..7471deed9 100644 --- a/dist/web/plugin-bundle.cpp.in +++ b/dist/web/plugin-bundle.cpp.in @@ -2,10 +2,12 @@ extern "C" void forceLinkPlugin_@IMHEX_PLUGIN_NAME@(); +namespace { struct StaticLoad { StaticLoad() { forceLinkPlugin_@IMHEX_PLUGIN_NAME@(); } }; +} -static StaticLoad staticLoad; \ No newline at end of file +static StaticLoad staticLoad;