summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/AppHdr.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2011-06-12 15:52:11 +0200
committerAdam Borowski <kilobyte@angband.pl>2011-06-12 19:32:34 +0200
commitbe87e5b3243ea058d505908f331f431c9ab7b28b (patch)
treebca3870a8755306567bbbec2b2e03ca4e6930a2a /crawl-ref/source/AppHdr.h
parentd4069b32f4254220840ebb9c94d212cb7fa3af07 (diff)
downloadcrawl-ref-be87e5b3243ea058d505908f331f431c9ab7b28b.tar.gz
crawl-ref-be87e5b3243ea058d505908f331f431c9ab7b28b.zip
Fix build failure on certain configurations of mingw.
CreateTimerQueueTimer() is available on Win2k and higher, which is ok for us since that's the lowest supported version of Windows anyway. The alternatives would be SetTimer(), which contrary to official documentation, doesn't work on console programs, multimedia timers (quite strongly deprecated), and several more heavyweight alternatives (waitable timers, etc). Doing complex things from inside an event callback is a bad idea, thus we want a single syscall that doesn't depend on the process' state being sound. For this reason, I picked this one even though it can make porting to Win98 harder (assuming someone wants that...). Almost all versions of mingw, including those truly ancient, define this function by default, yet the one shipped in msysgit and one hand-built by Napkin have it configured off and need forcing a win32 version, which is what this commit does.
Diffstat (limited to 'crawl-ref/source/AppHdr.h')
-rw-r--r--crawl-ref/source/AppHdr.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h
index 5ddf09822e..369cf2a7d8 100644
--- a/crawl-ref/source/AppHdr.h
+++ b/crawl-ref/source/AppHdr.h
@@ -162,6 +162,11 @@
#error Missing platform #define or unsupported compiler.
#endif
+#ifndef _WIN32_WINNT
+// Allow using Win2000 syscalls.
+# define _WIN32_WINNT 0x501
+#endif
+
#if defined(__GNUC__)
# define NORETURN __attribute__ ((noreturn))
#elif defined(_MSC_VER)