From: Simon McVittie Date: Tue, 15 Aug 2023 11:50:19 +0000 (+0100) Subject: sysdeps: Move declarations used from C++ to their own header X-Git-Tag: dbus-1.15.8~12^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e621e992410e7181a63a5af6c9ca2b33a9ef8dee;p=thirdparty%2Fdbus.git sysdeps: Move declarations used from C++ to their own header I want to use in dbus-sysdeps.h, but if we do that, we won't be able to include that header into C++ code on all compilers. Move the declarations for new internal Windows-specific functions introduced in commit 17a23d08 "dbus_threads_init_default, dbus_threads_init: be safe to call at any time" into their own header. Signed-off-by: Simon McVittie --- diff --git a/dbus/CMakeLists.txt b/dbus/CMakeLists.txt index cc192ef84..1f545ba6b 100644 --- a/dbus/CMakeLists.txt +++ b/dbus/CMakeLists.txt @@ -185,6 +185,7 @@ if(WIN32) dbus-sysdeps-thread-win.c ) set(DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS} + dbus-init-win.h dbus-sockets-win.h dbus-sysdeps-win.h ) diff --git a/dbus/Makefile.am b/dbus/Makefile.am index fa628ded9..0d38aca20 100644 --- a/dbus/Makefile.am +++ b/dbus/Makefile.am @@ -77,6 +77,7 @@ DBUS_SHARED_arch_sources = \ $(wince_source) \ dbus-backtrace-win.c \ dbus-file-win.c \ + dbus-init-win.h \ dbus-pipe-win.c \ dbus-sockets-win.h \ dbus-sysdeps-win.c \ diff --git a/dbus/dbus-init-win.cpp b/dbus/dbus-init-win.cpp index 3464c88f6..56311d8a6 100644 --- a/dbus/dbus-init-win.cpp +++ b/dbus/dbus-init-win.cpp @@ -27,7 +27,7 @@ extern "C" { -#include "dbus-sysdeps-win.h" +#include "dbus-init-win.h" } class DBusInternalInit diff --git a/dbus/dbus-init-win.h b/dbus/dbus-init-win.h new file mode 100644 index 000000000..8a9de8f73 --- /dev/null +++ b/dbus/dbus-init-win.h @@ -0,0 +1,17 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* + * Copyright © 2013 Intel Corporation + * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later + * + * Do not include other private headers in this one, particularly + * dbus-sysdeps.h: it gets included into C++ code which is not + * compatible with our use of . + */ + +#ifndef DBUS_INIT_WIN_H +#define DBUS_INIT_WIN_H + +void _dbus_threads_windows_init_global (void); +void _dbus_threads_windows_ensure_ctor_linked (void); + +#endif diff --git a/dbus/dbus-sysdeps-thread-win.c b/dbus/dbus-sysdeps-thread-win.c index 482623062..9f1818f91 100644 --- a/dbus/dbus-sysdeps-thread-win.c +++ b/dbus/dbus-sysdeps-thread-win.c @@ -24,6 +24,7 @@ */ #include +#include "dbus-init-win.h" #include "dbus-internals.h" #include "dbus-sysdeps.h" #include "dbus-sysdeps-win.h" diff --git a/dbus/dbus-sysdeps-win.h b/dbus/dbus-sysdeps-win.h index be9cbe159..f7be21014 100644 --- a/dbus/dbus-sysdeps-win.h +++ b/dbus/dbus-sysdeps-win.h @@ -87,9 +87,6 @@ _dbus_win_sid_to_name_and_domain (dbus_uid_t uid, DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_get_install_root (DBusString *str); -void _dbus_threads_windows_init_global (void); -void _dbus_threads_windows_ensure_ctor_linked (void); - DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_getsid(char **sid, dbus_pid_t process_id);