]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix forced inlining to work with Visual Studio. 10/head
authorMika Lindqvist <postmaster@raasu.org>
Wed, 29 Apr 2015 16:09:26 +0000 (19:09 +0300)
committerMika Lindqvist <postmaster@raasu.org>
Wed, 29 Apr 2015 16:09:26 +0000 (19:09 +0300)
deflate.c
win32/Makefile.msc
zutil.h

index da42bb30790099bdb79b788933398b9e3d4803a9..09d486c43f70d9003e7162dbce0c75c74c11d1d5 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -213,7 +213,7 @@ local inline Pos insert_string(deflate_state *z_const s, z_const Pos str)
 
 
 #ifndef NOT_TWEAK_COMPILER
-__attribute__ ((always_inline)) local void 
+alwaysinline local void 
 bulk_insert_str(deflate_state *s, Pos startpos, uInt count) {
     uInt idx;
     for (idx = 0; idx < count; idx++) {
index d7a9ec8d508f55910d846ea03ec4ff11864eab4a..318be92efbbbcd09f69f6a9af6ef6b9f221f2c6f 100644 (file)
@@ -22,7 +22,7 @@ LD = link
 AR = lib
 RC = rc
 CFLAGS  = -nologo -MD -W3 -O2 -Oy- -Zi -Fd"zlib" $(LOC)
-WFLAGS  = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DNOT_TWEAK_COMPILER
+WFLAGS  = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
 LDFLAGS = -nologo -debug -incremental:no -opt:ref -manifest
 ARFLAGS = -nologo
 RCFLAGS = /dWIN32 /r
diff --git a/zutil.h b/zutil.h
index 5feddb24e3a4b3206166b9b96028a0d5717b5072..d0cab49739778037fb1615e1a3381b08a29bec95 100644 (file)
--- a/zutil.h
+++ b/zutil.h
@@ -96,6 +96,12 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
    But it provides __inline instead, so use that. */
 #if defined(_MSC_VER) && !defined(inline)
 #  define inline __inline
+#endif
+
+#if defined(_MSC_VER)
+#  define alwaysinline __forceinline
+#else
+#  define alwaysinline __attribute__ ((always_inline))
 #endif
 
         /* common defaults */