Fix build issues with Visual C++ (implemented macro version of snprintf + re-ordered headers to ensure that winsock is included ahead of windows.h)


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4527 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/vncviewer/win32.h b/vncviewer/win32.h
index 0cc1c11..35be77b 100644
--- a/vncviewer/win32.h
+++ b/vncviewer/win32.h
@@ -1,5 +1,6 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright 2011 Pierre Ossman <ossman@cendio.se> for Cendio AB
+ * Copyright (C) 2011 D. R. Commander.  All Rights Reserved.
  * 
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -20,6 +21,10 @@
 #ifndef __VNCVIEWER_WIN32_H__
 #define __VNCVIEWER_WIN32_H__
 
+#ifdef _MSC_VER
+#define snprintf(str, n, format, ...) _snprintf_s(str, n, _TRUNCATE, format, __VA_ARGS__)
+#endif
+
 extern "C" {
 
 int win32_enable_lowlevel_keyboard(HWND hwnd);