[PATCH] API: don't depend on GLib in ModemManager headers

Aleksander Morgado aleksander at aleksander.es
Mon Feb 5 08:53:57 UTC 2018


We should only depend on GLib on the libmm-glib headers. Otherwise,
packages using just the core headers (e.g. ModemManagerQt) would also
need to build-depend on GLib and we don't want to enforce that.

    cd ~/buildroot/output/build/kde-modemmanager-qt-v5.36.0/src && ~/buildroot/output/host/usr/bin/arm-cortexa9_neon-linux-gnueabihf-g++  .... -fPIC -o CMakeFiles/KF5ModemManagerQt_static.dir/bearer.cpp.o -c ~/buildroot/output/build/kde-modemmanager-qt-v5.36.0/src/bearer.cpp
    In file included from ~/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/ModemManager/ModemManager.h:41:0,
                     from ~/buildroot/output/build/kde-modemmanager-qt-v5.36.0/src/generictypes.h:27,
                     from ~/buildroot/output/build/kde-modemmanager-qt-v5.36.0/src/generictypes.cpp:23:
    ~/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/ModemManager/ModemManager-compat.h:23:18: fatal error: glib.h: No such file or directory
    compilation terminated.
---

Hey,

This one is regarding the deprecated API items we include in the ModemManager core headers.

Comments?

---
 include/ModemManager-compat.h | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/ModemManager-compat.h b/include/ModemManager-compat.h
index 6d65d500..974b69bf 100644
--- a/include/ModemManager-compat.h
+++ b/include/ModemManager-compat.h
@@ -20,8 +20,6 @@
 #error "Only <ModemManager.h> can be included directly."
 #endif

-#include <glib.h>
-
 #include <ModemManager-enums.h>

 #ifndef MM_DISABLE_DEPRECATED
@@ -35,8 +33,15 @@
  * avoid unnecessary API/ABI breaks.
  */

+/* deprecated attribute support since gcc 3.1 */
+#if defined __GNUC__ && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
+# define MM_DEPRECATED __attribute__((__deprecated__))
+#else
+# define MM_DEPRECATED
+#endif
+
 /* The following type exists just so that we can get deprecation warnings */
-G_DEPRECATED
+MM_DEPRECATED
 typedef int MMModemBandDeprecated;

 /**
--
2.15.1


More information about the ModemManager-devel mailing list