[minizip] Ensure we don't ever accidentally change calling convention
authorAlan McGovern <alan.mcgovern@gmail.com>
Wed, 17 Aug 2011 12:23:05 +0000 (13:23 +0100)
committerAlan McGovern <alan.mcgovern@gmail.com>
Wed, 17 Aug 2011 12:23:05 +0000 (13:23 +0100)
Make sure we always #define ZCALLBACK to empty so we don't change
the calling convention on windows by including a header which defines
'CALLBACK'. This will keep things as cdecl as required by the c#
pinvokes.

support/minizip/ioapi.h

index 7d457baab34180639d97e82ffdf53d69df5cc6e2..ff8470389618d93df5307f98f5fc27cc5fb7325a 100644 (file)
 
 
 #ifndef ZCALLBACK
-
-#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
-#define ZCALLBACK CALLBACK
-#else
+// Nothing defines 'CALLBACK' anyway so to avoid accidentally changing
+// the calling convention by including a header which defines this, just
+// define ZCALLBACK as empty so we always get cdecl and our P/Invokes don't break.
 #define ZCALLBACK
-#endif
+
+//#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
+//#define ZCALLBACK CALLBACK
+//#else
+//#define ZCALLBACK
+//#endif
 #endif
 
 #ifdef __cplusplus