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 */ 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 #include -#include -#include /* for time_t */ - -#include "gpsd_config.h" - #include -#include +#include #include +#include /* 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 }