Skip to content

Commit

Permalink
Remove useless feature test macros
Browse files Browse the repository at this point in the history
  • Loading branch information
any1 committed Jul 2, 2022
1 parent 9a2a318 commit d4faccb
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 45 deletions.
5 changes: 0 additions & 5 deletions include/rfb/rfbproto.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@
#endif
#endif

/* MS compilers don't have strncasecmp */
#ifdef _MSC_VER
#define strncasecmp _strnicmp
#endif

#define rfbMax(a,b) (((a)>(b))?(a):(b))
#include <sys/time.h>
#include <netinet/in.h>
Expand Down
7 changes: 1 addition & 6 deletions src/encodings/vncauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@
* vncauth.c - Functions for VNC password management and authentication.
*/

#include <rfb/rfbproto.h>
#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
#define _POSIX_SOURCE
#define _XOPEN_SOURCE 600
#endif
#include "rfb/rfbproto.h"
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
5 changes: 0 additions & 5 deletions src/rfbproto.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
* rfbproto.c - functions to deal with client side of RFB protocol.
*/

#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
#define _POSIX_SOURCE
#define _XOPEN_SOURCE 600
#endif
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
Expand Down
12 changes: 1 addition & 11 deletions src/sasl.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,15 @@
* sasl.c - functions to deal with client side of the SASL protocol.
*/

#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
#define _POSIX_SOURCE
#define _XOPEN_SOURCE 600
#endif

#include <errno.h>
#include <rfb/rfbclient.h>
#include "rfb/rfbclient.h"

#include "sockets.h"

#include "sasl.h"

#include "tls.h"

#ifdef _MSC_VER
# define snprintf _snprintf /* MSVC went straight to the underscored syntax */
#endif

/*
* NB, keep in sync with similar method in qemud/remote.c
*/
Expand Down
8 changes: 0 additions & 8 deletions src/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@
* sockets.c - functions to deal with sockets.
*/

#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>
#include <fcntl.h>
Expand Down
11 changes: 1 addition & 10 deletions src/vncviewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,11 @@
/*
* vncviewer.c - the Xt-based VNC viewer.
*/

#ifdef _MSC_VER
#define strdup _strdup /* Prevent POSIX deprecation warnings */
#endif

#ifdef __STRICT_ANSI__
#define _BSD_SOURCE
#define _POSIX_SOURCE
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <rfb/rfbclient.h>
#include "rfb/rfbclient.h"
#include "tls.h"

static void Dummy(rfbClient* client) {
Expand Down

0 comments on commit d4faccb

Please sign in to comment.