[Zlib-devel] The calling convention in zlibCompileFlags()
Cosmin Truta
cosmin at cs.toronto.edu
Sat Aug 2 17:44:58 EDT 2003
Hi,
At Gerard's suggestion, I propose to add the calling convention flags to
the report given by zlibCompileFlags(). Given the fact that the function
does not have arguments, it can be safely called from any application,
using any convention.
Since there are 3 conventions, CDECL (default), ZLIB_STDCALL and
ZLIB_FASTCALL, we need 2 flags. I chose 28 and 29, but if you think
these numbers are not the best choice, feel free to change them.
ZLIB_STDCALL and ZLIB_FASTCALL are mutually exclusive, and even though
both flags can be set in theory, exclusivity will be guaranteed by
zconf.h. Maybe ((1 << 28) | (1 << 29)) will be used by who knows what
other convention that may appear and be used in some future.
The patch to 1.2.0.3 is cummulative; it includes the proposal that came
with zlib-1.2.0.x-cos1.
Best regards,
Cosmin
--- zlib-1.2.0.3/zutil.c Sun Jul 13 00:46:27 2003
+++ zlib-1.2.0.f-cos2/zutil.c Sat Aug 02 15:40:38 2003
@@ -65,6 +65,9 @@
#ifdef DEBUG
flags += 1 << 8;
#endif
+#ifdef ASMV
+ flags += 1 << 9;
+#endif
#ifdef BUILDFIXED
flags += 1 << 12;
#endif
@@ -106,6 +109,12 @@
flags += 1 << 26;
# endif
# endif
+#endif
+#ifdef ZLIB_STDCALL
+ flags += 1 << 28;
+#endif
+#ifdef ZLIB_FASTCALL
+ flags += 1 << 29;
#endif
return flags;
}
More information about the Zlib-devel
mailing list