summaryrefslogtreecommitdiff
path: root/gpsd.h
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2017-01-24 16:18:50 -0800
committerFred Wright <fw@fwright.net>2017-01-24 20:00:37 -0800
commitd287c76f4f2e1ffd275da41b84f9e08ea7f74344 (patch)
treefd861d89cfdf62ea2b3e1d5522295bf4c5620514 /gpsd.h
parent744959a2aa3f913e5491c9fe9bac067a670f7de6 (diff)
downloadgpsd-d287c76f4f2e1ffd275da41b84f9e08ea7f74344.tar.gz
Fixes some issues with C++11.
In compiler.h, it adds the missing "std::" namespace prefixes to the memory_barrier() definition. In gpsd.h it: 1) Moves the include of compiler.h outside the conditional 'extern "C"', since the "atomic" stuff in the former is incompatible with the latter. 2) Fixes DEVICEHOOKPATH for C++11 (C++11 requires spaces between literals and string macros). 3) Cleans up some ordering of system includes left over from the former head/tail setup. TESTED: Ran "scons build-all check" on OSX 10.5-10.12, Ubuntu 14, CentOS 7, Fedora 25, FreeBSD 10.3, OpenBSD 5.6 (32- and 64-bit), and NetBSD 6.1.5. Also tested Qt builds with OSX 10.9 (Qt4 and Qt5), OSX 10.12 (Qt5), and Fedora 25 (Qt5). Observed the correct DEVICEHOOKPATH in the log on OSX.
Diffstat (limited to 'gpsd.h')
-rw-r--r--gpsd.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/gpsd.h b/gpsd.h
index c69facd0..b3dc3c97 100644
--- a/gpsd.h
+++ b/gpsd.h
@@ -7,22 +7,21 @@
#ifndef _GPSD_H_
#define _GPSD_H_
+#include "compiler.h" /* Must be outside extern "C" for "atomic" */
+
# ifdef __cplusplus
extern "C" {
# endif
+#include <stdarg.h>
#include <stdbool.h>
-#include <stdio.h>
-#include <time.h> /* for time_t */
-
-#include "gpsd_config.h"
-
#include <stdint.h>
-#include <stdarg.h>
+#include <stdio.h>
#include <termios.h>
+#include <time.h> /* for time_t */
#include "gps.h"
-#include "compiler.h"
+#include "gpsd_config.h"
#include "os_compat.h"
/*
@@ -991,7 +990,7 @@ PRINTF_FUNC(3, 4) void gpsd_log(const struct gpsd_errout_t *, const int, const c
void cfmakeraw(struct termios *);
#endif /* defined(__CYGWIN__) */
-#define DEVICEHOOKPATH "/"SYSCONFDIR"/gpsd/device-hook"
+#define DEVICEHOOKPATH "/" SYSCONFDIR "/gpsd/device-hook"
# ifdef __cplusplus
}