summaryrefslogtreecommitdiffstats
path: root/libvncclient
diff options
context:
space:
mode:
Diffstat (limited to 'libvncclient')
-rw-r--r--libvncclient/rfbproto.c1
-rw-r--r--libvncclient/sockets.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c
index 505ef50..d18459e 100644
--- a/libvncclient/rfbproto.c
+++ b/libvncclient/rfbproto.c
@@ -26,6 +26,7 @@
#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
#define _POSIX_SOURCE
+#define _XOPEN_SOURCE 600
#endif
#ifndef WIN32
#include <unistd.h>
diff --git a/libvncclient/sockets.c b/libvncclient/sockets.c
index 6c47491..c97a90f 100644
--- a/libvncclient/sockets.c
+++ b/libvncclient/sockets.c
@@ -24,6 +24,11 @@
#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
+#ifdef __linux__
+/* Setting this on other systems hides definitions such as INADDR_LOOPBACK.
+ * The check should be for __GLIBC__ in fact. */
+# define _POSIX_SOURCE
+#endif
#endif
#include <unistd.h>
#include <errno.h>