summaryrefslogtreecommitdiff
path: root/compiler.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-07 12:34:15 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-03-07 12:34:15 -0500
commit955b82d9ee173de7a0410f7b39c9f7f0999e4633 (patch)
tree4d7b0e267ab5e9cba62e643b578b4508ae0238cd /compiler.h
parent95c343b2b266c17defd8836c8b515848786b755d (diff)
downloadgpsd-955b82d9ee173de7a0410f7b39c9f7f0999e4633.tar.gz
Move some toolchain settings into compiler.h, all that stuff should live there.
Diffstat (limited to 'compiler.h')
-rw-r--r--compiler.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/compiler.h b/compiler.h
index 0e704527..b6919aaa 100644
--- a/compiler.h
+++ b/compiler.h
@@ -7,6 +7,23 @@
#ifndef _GPSD_COMPILER_H_
#define _GPSD_COMPILER_H_
+/*
+ * Tell GCC that we want thread-safe behavior with _REENTRANT;
+ * in particular, errno must be thread-local.
+ * Tell POSIX-conforming implementations with _POSIX_THREAD_SAFE_FUNCTIONS.
+ * See http://www.unix.org/whitepapers/reentrant.html
+ */
+#ifndef _REENTRANT
+#define _REENTRANT
+#endif
+#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
+#define _POSIX_THREAD_SAFE_FUNCTIONS
+#endif
+
+#ifdef _WIN32
+typedef unsigned int speed_t;
+#endif
+
#include "gpsd_config.h" /* is HAVE_STDATOMIC defined? */
/* Macro for declaring function with printf-like arguments. */