summaryrefslogtreecommitdiff
path: root/compiler.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 /compiler.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 'compiler.h')
-rw-r--r--compiler.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler.h b/compiler.h
index 7d664b18..71d26f68 100644
--- a/compiler.h
+++ b/compiler.h
@@ -90,7 +90,7 @@ static inline void memory_barrier(void)
/* we are C++ */
#if __cplusplus >= 201103L
/* C++11 and later has atomics, earlier do not */
- atomic_thread_fence(memory_order_seq_cst);
+ std::atomic_thread_fence(std::memory_order_seq_cst);
#endif
#elif defined HAVE_STDATOMIC_H
/* we are C and atomics are in C98 and newer */