summaryrefslogtreecommitdiff
path: root/win32.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-12-23 22:31:46 +0000
committerdarkvater <darkvater@openttd.org>2004-12-23 22:31:46 +0000
commitb2499545385caeb4d9ccc8b8d1c8737441ae5ae9 (patch)
tree0c36d0f7aed9d6abbdcb4025305824270c0169da /win32.c
parentdda14faac5242af4940dd012f32f9cfbea0738f2 (diff)
downloadopenttd-b2499545385caeb4d9ccc8b8d1c8737441ae5ae9.tar.xz
(svn r1266) -Fix: fix some cygwin/mingw warnings
-Note: when compiling with MinGW (-mno-cygwin) __MINGW32__ is defined; when compiling without it __CYGWIN32__ is defined. You need to set either -mno-cygwin (MinGW) or -mwin32 (Cygwin) to have WIN32 defined
Diffstat (limited to 'win32.c')
-rw-r--r--win32.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/win32.c b/win32.c
index 8e07c41d1..4366d62a7 100644
--- a/win32.c
+++ b/win32.c
@@ -35,7 +35,7 @@ static struct {
static HINSTANCE _inst;
static bool _has_console;
-#if defined(MINGW32) || defined(__CYGWIN__)
+#if defined(__MINGW32__) || defined(__CYGWIN__)
#define __TIMESTAMP__ __DATE__ __TIME__
#endif
@@ -993,6 +993,8 @@ bool LoadLibraryList(void **proc, const char *dll)
return true;
}
+#ifdef _MSC_VER
+
static const char *_exception_string;
static void *_safe_esp;
static char *_crash_msg;
@@ -1012,19 +1014,14 @@ void ShowOSErrorBox(const char *buf)
*(byte*)0 = 0;
}
#endif
-
}
-#ifdef _MSC_VER
-
typedef struct DebugFileInfo {
uint32 size;
uint32 crc32;
SYSTEMTIME file_time;
} DebugFileInfo;
-
-
static uint32 *_crc_table;
static void MakeCRCTable(uint32 *table) {
@@ -1462,6 +1459,15 @@ static void Win32InitializeExceptions()
SetUnhandledExceptionFilter(ExceptionHandler);
}
+#else
+/* Get rid of unused variable warnings.. ShowOSErrorBox
+ * is now used twice, once in MSVC, and once in all other Win
+ * compilers (cygwin, mingw, etc.) */
+void ShowOSErrorBox(const char *buf)
+{
+ MyShowCursor(true);
+ MessageBoxA(GetActiveWindow(), buf, "Error!", MB_ICONSTOP);
+}
#endif
static char *_fios_path;