summaryrefslogtreecommitdiff
path: root/os_compat.h
diff options
context:
space:
mode:
authorRobert Norris <rw_norris@hotmail.com>2017-03-05 18:43:40 +0000
committerFred Wright <fw@fwright.net>2017-03-05 13:43:14 -0800
commite8d8c8bc9ea7a5d4aa87831835d0228743ea964a (patch)
tree7df7d2fb636405df2528ebbc0ed68b78f5a9cf3e /os_compat.h
parent9f870a11218d0bc6364d6b333fd878106746adf9 (diff)
downloadgpsd-e8d8c8bc9ea7a5d4aa87831835d0228743ea964a.tar.gz
Enable Windows version of gpspipe
Use recv() rather than read() for Windows compatibility. Disable serial port code not available on Windows. Add open flag that's not available on Windows. TESTED: Built gpspipe for Windows under cross compiler. Run gpspipe on a Windows system and successfully connects to an instance of gpsd and dumps NMEA output to the terminal or a specified output file. Still builds and runs on a Linux system including the daemon option. Signed-off-by: Fred Wright <fw@fwright.net>
Diffstat (limited to 'os_compat.h')
-rw-r--r--os_compat.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/os_compat.h b/os_compat.h
index 9321809f..2b4189f0 100644
--- a/os_compat.h
+++ b/os_compat.h
@@ -114,6 +114,12 @@ size_t strlcpy(char *dst, const char *src, size_t size);
#define SIGQUIT 3
#endif
+/* Provide missing open flags for non-POSIX builds */
+
+#ifndef O_NOCTTY
+#define O_NOCTTY 0400
+#endif
+
# ifdef __cplusplus
}
# endif