(svn r3236) - Fix: warnings about 'CDECL must be used with ...' on VS6
authorDarkvater
Sat, 26 Nov 2005 12:57:42 +0000
changeset 2694 99d88a9d5337
parent 2693 4c9f68543198
child 2695 395110265c87
(svn r3236) - Fix: warnings about 'CDECL must be used with ...' on VS6
ai/ai_event.h
saveload.c
stdafx.h
--- a/ai/ai_event.h	Sat Nov 26 12:45:53 2005 +0000
+++ b/ai/ai_event.h	Sat Nov 26 12:57:42 2005 +0000
@@ -20,9 +20,9 @@
  *  Ugly, I know, but it works! */
 
 #	ifdef DEF_EVENTS
-	void empty_function(PlayerID player, int event, ...) {}
+	void CDECL empty_function(PlayerID player, int event, ...) {}
 #	else
-	extern void empty_function(PlayerID player, int event, ...);
+	extern void CDECL empty_function(PlayerID player, int event, ...);
 #	endif
 #	define ai_event empty_function
 
--- a/saveload.c	Sat Nov 26 12:45:53 2005 +0000
+++ b/saveload.c	Sat Nov 26 12:57:42 2005 +0000
@@ -953,15 +953,8 @@
 //********************************************
 
 #if defined(WITH_ZLIB)
+#include <zlib.h>
 
-// This is needed to zlib uses the stdcall calling convention on visual studio
-#ifdef _MSC_VER
-#	ifndef ZLIB_WINAPI
-#		define ZLIB_WINAPI
-#	endif
-#endif
-
-#include <zlib.h>
 static z_stream _z;
 
 static bool InitReadZlib(void)
--- a/stdafx.h	Sat Nov 26 12:45:53 2005 +0000
+++ b/stdafx.h	Sat Nov 26 12:57:42 2005 +0000
@@ -142,6 +142,14 @@
 # undef TTD_ALIGNMENT_4
 # undef TTD_ALIGNMENT_2
 # define GCC_PACK
+
+// This is needed to zlib uses the stdcall calling convention on visual studio, also used with libpng (VS6 warning)
+# if defined(WITH_ZLIB) || defined(WITH_PNG)
+#  ifndef ZLIB_WINAPI
+#   define ZLIB_WINAPI
+#  endif
+# endif
+
 #endif /* defined(_MSC_VER) */