summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordscho <dscho>2005-05-18 08:12:28 +0000
committerdscho <dscho>2005-05-18 08:12:28 +0000
commitee5244137266e2945b596f63ce4f60cfef6cdaf3 (patch)
treec04ef01921e633e910f6fdafa7ad335c53950b1e
parenta5524005d6c9f34facb3ff0aabced4e76fe314b0 (diff)
downloadlibvncserver-ee5244137266e2945b596f63ce4f60cfef6cdaf3.zip
libvncserver-ee5244137266e2945b596f63ce4f60cfef6cdaf3.tar.gz
hide strict ansi stuff if not explicitely turned on; actually use the socklen_t test from configure.ac
-rw-r--r--examples/vncev.c2
-rw-r--r--libvncclient/listen.c2
-rw-r--r--libvncclient/rfbproto.c2
-rw-r--r--libvncclient/sockets.c2
-rw-r--r--libvncclient/vncviewer.c2
-rw-r--r--libvncserver/main.c2
-rw-r--r--libvncserver/rfbserver.c2
-rw-r--r--libvncserver/vncauth.c8
-rw-r--r--rfb/rfb.h4
-rw-r--r--test/copyrecttest.c2
-rw-r--r--test/encodingstest.c2
-rw-r--r--vncterm/VNCommand.c2
12 files changed, 29 insertions, 3 deletions
diff --git a/examples/vncev.c b/examples/vncev.c
index e93dc57..affac00 100644
--- a/examples/vncev.c
+++ b/examples/vncev.c
@@ -1,5 +1,7 @@
/* This program is a simple server to show events coming from the client */
+#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
diff --git a/libvncclient/listen.c b/libvncclient/listen.c
index 7e0ed1d..7347a27 100644
--- a/libvncclient/listen.c
+++ b/libvncclient/listen.c
@@ -21,7 +21,9 @@
* listen.c - listen for incoming connections
*/
+#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
+#endif
#include <unistd.h>
#include <sys/types.h>
#ifdef __MINGW32__
diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c
index 72c06a1..211a478 100644
--- a/libvncclient/rfbproto.c
+++ b/libvncclient/rfbproto.c
@@ -23,8 +23,10 @@
* rfbproto.c - functions to deal with client side of RFB protocol.
*/
+#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
#define _POSIX_SOURCE
+#endif
#include <unistd.h>
#include <errno.h>
#ifndef __MINGW32__
diff --git a/libvncclient/sockets.c b/libvncclient/sockets.c
index 977912d..6ee5a9d 100644
--- a/libvncclient/sockets.c
+++ b/libvncclient/sockets.c
@@ -21,7 +21,9 @@
* sockets.c - functions to deal with sockets.
*/
+#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
+#endif
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/libvncclient/vncviewer.c b/libvncclient/vncviewer.c
index 4427335..87c708d 100644
--- a/libvncclient/vncviewer.c
+++ b/libvncclient/vncviewer.c
@@ -21,8 +21,10 @@
* vncviewer.c - the Xt-based VNC viewer.
*/
+#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
#define _POSIX_SOURCE
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/libvncserver/main.c b/libvncserver/main.c
index 7c7bc3d..5cac343 100644
--- a/libvncserver/main.c
+++ b/libvncserver/main.c
@@ -10,7 +10,9 @@
* see GPL (latest version) for full details
*/
+#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
+#endif
#include <rfb/rfb.h>
#include <rfb/rfbregion.h>
#include "private.h"
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index 22bdc98..745589e 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -24,7 +24,9 @@
* USA.
*/
+#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
+#endif
#include <string.h>
#include <rfb/rfb.h>
#include <rfb/rfbregion.h>
diff --git a/libvncserver/vncauth.c b/libvncserver/vncauth.c
index 4c81d30..b8ee288 100644
--- a/libvncserver/vncauth.c
+++ b/libvncserver/vncauth.c
@@ -21,8 +21,13 @@
* vncauth.c - Functions for VNC password management and authentication.
*/
+#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
#define _POSIX_SOURCE
+#endif
+#ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -32,9 +37,6 @@
#include <string.h>
#include <math.h>
-#ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
#ifdef LIBVNCSERVER_HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
diff --git a/rfb/rfb.h b/rfb/rfb.h
index 5866cd6..007c13c 100644
--- a/rfb/rfb.h
+++ b/rfb/rfb.h
@@ -45,6 +45,10 @@ extern "C"
#include <winsock2.h>
#endif
+#ifndef LIBVNCSERVER_HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
#include <pthread.h>
#if 0 /* debugging */
diff --git a/test/copyrecttest.c b/test/copyrecttest.c
index 1986f72..5521595 100644
--- a/test/copyrecttest.c
+++ b/test/copyrecttest.c
@@ -1,4 +1,6 @@
+#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
+#endif
#include <rfb/rfb.h>
#include <math.h>
diff --git a/test/encodingstest.c b/test/encodingstest.c
index 5f84a5b..821b2ae 100644
--- a/test/encodingstest.c
+++ b/test/encodingstest.c
@@ -1,4 +1,6 @@
+#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
+#endif
#include <time.h>
#include <stdarg.h>
#include <rfb/rfb.h>
diff --git a/vncterm/VNCommand.c b/vncterm/VNCommand.c
index d53605a..ecf2543 100644
--- a/vncterm/VNCommand.c
+++ b/vncterm/VNCommand.c
@@ -1,5 +1,7 @@
+#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
#define _POSIX_SOURCE
+#endif
#include "VNConsole.h"
#include "vga.h"
#ifdef LIBVNCSERVER_HAVE_FCNTL_H
OpenPOWER on IntegriCloud