summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-08-10 15:04:58 +0200
committerAttila Molnar <attilamolnar@hush.com>2015-08-10 15:04:58 +0200
commitb7189fdb5bdb2771e2d88ad29702ae4590e1a40a (patch)
tree03f6ec805e6489cccda0532a8cb6b221521a6e20 /win
parent9c6a2d1b5ba5a2aeb91d00e1115534fbde670841 (diff)
parent234c23499308c0fb234f3408bebb990418205fd9 (diff)
Merge pull request #1089 from SaberUK/insp20+fix-msvc
[2.0] Fix compilation with Microsoft Visual C++ 14.
Diffstat (limited to 'win')
-rw-r--r--win/inspircd_win32wrapper.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/win/inspircd_win32wrapper.h b/win/inspircd_win32wrapper.h
index be437d4a3..d7ceb73aa 100644
--- a/win/inspircd_win32wrapper.h
+++ b/win/inspircd_win32wrapper.h
@@ -63,6 +63,7 @@
/* Disable the deprecation warnings.. it spams :P */
#define _CRT_SECURE_NO_DEPRECATE
+#define _WINSOCK_DEPRECATED_NO_WARNINGS
/* Normal windows (platform-specific) includes */
#include <winsock2.h>
@@ -90,9 +91,11 @@ CoreExport const char * insp_inet_ntop(int af, const void * src, char * dst, soc
#define inet_pton insp_inet_pton
#define inet_ntop insp_inet_ntop
-/* Safe printf functions aren't defined in VC++ */
+/* Safe printf functions aren't defined in VC++ releases older than v14 */
+#if _MSC_VER <= 1800
#define snprintf _snprintf
#define vsnprintf _vsnprintf
+#endif
/* Unix-style sleep (argument is in seconds) */
__inline void sleep(int seconds) { Sleep(seconds * 1000); }
@@ -136,11 +139,13 @@ struct DIR
bool first;
};
+#if _MSC_VER <= 1800
struct timespec
{
time_t tv_sec;
long tv_nsec;
};
+#endif
CoreExport DIR * opendir(const char * path);
CoreExport dirent * readdir(DIR * handle);