diff options
author | Daniel Cohen Gindi <danielgindi@gmail.com> | 2014-09-01 11:39:56 +0300 |
---|---|---|
committer | Johannes Schindelin <johannes.schindelin@gmx.de> | 2014-09-02 16:43:16 +0200 |
commit | cd578bf5294e5afca8d66e01173c50f0aa86ac3d (patch) | |
tree | 6a0ca6bc5eb1674752b73d46988208f3075f233c | |
parent | 8175f428dc003b6a4564deee7ae78bc3b3b62ebf (diff) | |
download | libvncserver-cd578bf5294e5afca8d66e01173c50f0aa86ac3d.zip libvncserver-cd578bf5294e5afca8d66e01173c50f0aa86ac3d.tar.gz |
MSVC: Use _snprintf instead of snprintf
In Microsoft's Visual C runtime, the snprintf() function is actually
called _snprintf. Let's just #define the former to call the latter.
[JES: fixed commit message]
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
-rw-r--r-- | libvncclient/rfbproto.c | 4 | ||||
-rw-r--r-- | libvncclient/sockets.c | 4 | ||||
-rw-r--r-- | libvncclient/tls_openssl.c | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c index 9d48b16..0afa3dc 100644 --- a/libvncclient/rfbproto.c +++ b/libvncclient/rfbproto.c @@ -64,6 +64,10 @@ #include "minilzo.h" #include "tls.h" +#ifdef _MSC_VER +# define snprintf _snprintf +#endif + /* * rfbClientLog prints a time-stamped message to the log file (stderr). */ diff --git a/libvncclient/sockets.c b/libvncclient/sockets.c index c97a90f..7ddf1b2 100644 --- a/libvncclient/sockets.c +++ b/libvncclient/sockets.c @@ -57,6 +57,10 @@ #endif #include "tls.h" +#ifdef _MSC_VER +# define snprintf _snprintf +#endif + void PrintInHex(char *buf, int len); rfbBool errorMessageOnReadFailure = TRUE; diff --git a/libvncclient/tls_openssl.c b/libvncclient/tls_openssl.c index b7a0911..8af96a4 100644 --- a/libvncclient/tls_openssl.c +++ b/libvncclient/tls_openssl.c @@ -31,6 +31,10 @@ #include "tls.h" +#ifdef _MSC_VER +#define snprintf _snprintf +#endif + static rfbBool rfbTLSInitialized = FALSE; static pthread_mutex_t *mutex_buf = NULL; |