]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
dbus: Move DBUS_ENABLE_EMBEDDED_TESTS to a new dbus-macros-internal.h
authorSimon McVittie <smcv@collabora.com>
Thu, 21 Apr 2022 13:35:44 +0000 (14:35 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Sun, 1 May 2022 16:28:51 +0000 (16:28 +0000)
This avoids a circular dependency: I want to use
DBUS_ENABLE_EMBEDDED_TESTS in dbus-string.h, but
DBUS_ENABLE_EMBEDDED_TESTS was previously defined in dbus-internals.h,
which depends on dbus-string.h.

Signed-off-by: Simon McVittie <smcv@collabora.com>
dbus/CMakeLists.txt
dbus/Makefile.am
dbus/dbus-internals.h
dbus/dbus-macros-internal.h [new file with mode: 0644]

index 9e3f0a148eb0f8f506e2d3178258bcc60f358538..2f56e62cff26b7826384d92b9f0737710e63be39 100644 (file)
@@ -135,6 +135,7 @@ set(DBUS_SHARED_HEADERS
     dbus-hash.h
     dbus-internals.h
     dbus-list.h
+    dbus-macros-internal.h
     dbus-marshal-basic.h
     dbus-mempool.h
     dbus-string.h
index 7a71f4686ca3b173a57c900f29e3fd28c7559e51..fbd817586370fe5014434433aaa267f8829f69c4 100644 (file)
@@ -227,6 +227,7 @@ DBUS_SHARED_SOURCES=                                \
        dbus-internals.h                        \
        dbus-list.c                             \
        dbus-list.h                             \
+       dbus-macros-internal.h                  \
        dbus-marshal-basic.c                    \
        dbus-marshal-basic.h                    \
        dbus-memory.c                           \
index 3b293b057705d422dfc83068661bb5f0e984d150..1ca0065d7f8bd28d444237e06e7a0d16ec96e5cf 100644 (file)
 #include <dbus/dbus-types.h>
 #include <dbus/dbus-errors.h>
 #include <dbus/dbus-sysdeps.h>
+#include <dbus/dbus-macros-internal.h>
 #include <dbus/dbus-threads-internal.h>
 
 DBUS_BEGIN_DECLS
 
-#ifdef DBUS_ENABLE_EMBEDDED_TESTS
-#define DBUS_EMBEDDED_TESTS_EXPORT DBUS_PRIVATE_EXPORT
-#else
-#define DBUS_EMBEDDED_TESTS_EXPORT /* nothing */
-#endif
-
 DBUS_PRIVATE_EXPORT
 void _dbus_warn               (const char *format,
                                ...) _DBUS_GNUC_PRINTF (1, 2);
diff --git a/dbus/dbus-macros-internal.h b/dbus/dbus-macros-internal.h
new file mode 100644 (file)
index 0000000..d98891a
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2019 Collabora Ltd.
+ * SPDX-License-Identifier: AFL-2.1 or GPL-2.0-or-later
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifdef DBUS_INSIDE_DBUS_H
+#error "You can't include dbus-macros-internal.h in the public header dbus.h"
+#endif
+
+#ifndef DBUS_MACROS_INTERNAL_H
+#define DBUS_MACROS_INTERNAL_H
+
+#include <dbus/dbus-macros.h>
+
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
+# define DBUS_EMBEDDED_TESTS_EXPORT DBUS_PRIVATE_EXPORT
+#else
+# define DBUS_EMBEDDED_TESTS_EXPORT /* nothing */
+#endif
+
+#endif