summaryrefslogtreecommitdiff
path: root/src/CommonAPI/DBus/DBusRuntime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/CommonAPI/DBus/DBusRuntime.cpp')
-rwxr-xr-xsrc/CommonAPI/DBus/DBusRuntime.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/CommonAPI/DBus/DBusRuntime.cpp b/src/CommonAPI/DBus/DBusRuntime.cpp
index 5ac705c..9f21b42 100755
--- a/src/CommonAPI/DBus/DBusRuntime.cpp
+++ b/src/CommonAPI/DBus/DBusRuntime.cpp
@@ -11,7 +11,15 @@ namespace DBus {
const MiddlewareInfo DBusRuntime::middlewareInfo_("DBus", &DBusRuntime::getInstance);
-INITIALIZER(registerDBusMiddleware) {
+#ifdef WIN32
+#pragma section(".CRT$XCU",read)
+void __cdecl registerDBusMiddleware(void);
+__declspec(allocate(".CRT$XCU")) void(__cdecl*registerDBusMiddleware_)(void) = registerDBusMiddleware;
+void __cdecl
+#else
+__attribute__((constructor)) void
+#endif
+ registerDBusMiddleware(void) {
Runtime::registerRuntimeLoader("DBus", &DBusRuntime::getInstance);
}
@@ -35,4 +43,4 @@ extern "C" {
CommonAPI::MiddlewareInfo middlewareInfo = CommonAPI::DBus::DBusRuntime::middlewareInfo_;
-}
+} \ No newline at end of file