summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-10-04 14:48:23 +0200
committerThomas Haller <thaller@redhat.com>2016-10-04 15:00:53 +0200
commitf0942f5bb84e368e99b15ef730bc3ad62d36fbff (patch)
tree680383132c02873a1872f0f07122e5ee5e153366
parent4683a4e60d5a7cc19ad6feff3694fc738f0d2f26 (diff)
downloadnetwork-manager-applet-f0942f5bb84e368e99b15ef730bc3ad62d36fbff.tar.gz
shared: add "nm-libnm-compat.h"
In the past, when applet used a new API from libnm, we would just bump the required libnm version. As we anyway released new versions of the applet with every NetworkManager release, that was ok. But that means, that 'master' of nm-applet only works with the latest NetworkManager API. At the same time it means, that a user who is restricted to an older NetworkManager API cannot use the master build. Such a user had to rely on important fixes to be backported from master to the stable branch that was suitable for the NetworkManager API that he had. That means, upstream there are multiple versions of the applet, whereas most people would like to have the newest version (or at least the features and improvements from there). Now we don't want to branch anymore simply because we require a newer libnm API. This is somewhat more effort to maintain a master that works with different libnm APIs, but on the other hand, it saves work by having to maintain only one upstream branch. Preferably, we perform runtime detection of the present API. Otherwise, we do compile-time detection. "nm-libnm-compat.h" is to privide utilities to access new API or provide workarounds.
-rw-r--r--shared/Makefile.am1
-rw-r--r--shared/nm-default.h2
-rw-r--r--shared/nm-libnm-compat.h25
3 files changed, 28 insertions, 0 deletions
diff --git a/shared/Makefile.am b/shared/Makefile.am
index d8df46d6..1db99088 100644
--- a/shared/Makefile.am
+++ b/shared/Makefile.am
@@ -5,4 +5,5 @@ EXTRA_DIST = \
nm-utils/nm-test-utils.h \
nm-utils/nm-vpn-editor-plugin-call.h \
nm-default.h \
+ nm-libnm-compat.h \
$(NULL)
diff --git a/shared/nm-default.h b/shared/nm-default.h
index 5b3a8d3c..56c03dcb 100644
--- a/shared/nm-default.h
+++ b/shared/nm-default.h
@@ -75,6 +75,8 @@
#include <NetworkManager.h>
#endif /* NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY */
+#include "nm-libnm-compat.h"
+
/*****************************************************************************/
#endif /* __NM_DEFAULT_H__ */
diff --git a/shared/nm-libnm-compat.h b/shared/nm-libnm-compat.h
new file mode 100644
index 00000000..7023cb3f
--- /dev/null
+++ b/shared/nm-libnm-compat.h
@@ -0,0 +1,25 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager -- Network link manager
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ *
+ * (C) Copyright 2016 Red Hat, Inc.
+ */
+
+#ifndef __NM_LIBNM_COMPAT_H__
+#define __NM_LIBNM_COMPAT_H__
+
+#endif /* __NM_LIBNM_COMPAT_H__ */