diff options
author | Thomas Haller <thaller@redhat.com> | 2017-03-09 13:02:20 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-03-09 14:12:35 +0100 |
commit | 831286df3001e6b76b7baeb10a7723841ab8b35e (patch) | |
tree | b042134ef04427c961379f298512e4200c620901 /examples/C | |
parent | afd1bde36683fd73516f267dd98160c1b54f4ad7 (diff) | |
download | NetworkManager-831286df3001e6b76b7baeb10a7723841ab8b35e.tar.gz |
include: use double-quotes to include our own headers
In practice, this should only matter when there are multiple
header files with the same name. That is something we try
to avoid already, by giving headers a distinct name.
When building NetworkManager itself, we clearly want to use
double-quotes for including our own headers.
But we also want to do that in our public headers. For example:
./a.c
#include <stdio.h>
#include <nm-1.h>
void main() {
printf ("INCLUDED %s/nm-2.h\n", SYMB);
}
./1/nm-1.h
#include <nm-2.h>
./1/nm-2.h
#define SYMB "1"
./2/nm-2.h
#define SYMB "2"
$ cc -I./2 -I./1 ./a.c
$ ./a.out
INCLUDED 2/nm-2.h
Exceptions to this are
- headers in "shared/nm-utils" that include <NetworkManager.h>. These
headers are copied into projects and hence used like headers owned by
those projects.
- examples/C
Diffstat (limited to 'examples/C')
-rw-r--r-- | examples/C/qt/add-connection-wired.cpp | 3 | ||||
-rw-r--r-- | examples/C/qt/change-ipv4-addresses.cpp | 4 | ||||
-rw-r--r-- | examples/C/qt/list-connections.cpp | 3 |
3 files changed, 4 insertions, 6 deletions
diff --git a/examples/C/qt/add-connection-wired.cpp b/examples/C/qt/add-connection-wired.cpp index fe790ecdbf..c06ed71f29 100644 --- a/examples/C/qt/add-connection-wired.cpp +++ b/examples/C/qt/add-connection-wired.cpp @@ -28,10 +28,9 @@ #include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusMetaType>
#include <QtDBus/QDBusReply>
-
#include <QtCore/QDebug>
-#include "nm-dbus-interface.h"
+#include <nm-dbus-interface.h>
typedef QMap<QString, QMap<QString, QVariant> > Connection;
Q_DECLARE_METATYPE(Connection)
diff --git a/examples/C/qt/change-ipv4-addresses.cpp b/examples/C/qt/change-ipv4-addresses.cpp index 8ca3dde2fb..d403900ad1 100644 --- a/examples/C/qt/change-ipv4-addresses.cpp +++ b/examples/C/qt/change-ipv4-addresses.cpp @@ -38,9 +38,9 @@ #include <QtCore/QDebug> #include <QtNetwork/QHostAddress> -#include "arpa/inet.h" +#include <arpa/inet.h> -#include "nm-dbus-interface.h" +#include <nm-dbus-interface.h> typedef QMap<QString, QMap<QString, QVariant> > Connection; Q_DECLARE_METATYPE(Connection) diff --git a/examples/C/qt/list-connections.cpp b/examples/C/qt/list-connections.cpp index 66f309c83c..48dd685ef8 100644 --- a/examples/C/qt/list-connections.cpp +++ b/examples/C/qt/list-connections.cpp @@ -25,10 +25,9 @@ #include <QtDBus/QDBusConnection> #include <QtDBus/QDBusInterface> #include <QtDBus/QDBusReply> - #include <QtCore/QDebug> -#include "nm-dbus-interface.h" +#include <nm-dbus-interface.h> void listConnections(QDBusInterface& interface) { |