Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[minizip] Ensure we don't ever accidentally change calling convention

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.
  • Loading branch information...
commit b5a0b8e0a8bb2fe790dc2f34a1a846f8efc470db 1 parent 2685feb
@alanmcgovern alanmcgovern authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 support/minizip/ioapi.h
View
14 support/minizip/ioapi.h
@@ -23,12 +23,16 @@
#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
Please sign in to comment.
Something went wrong with that request. Please try again.