From: Mika Lindqvist Date: Wed, 29 Apr 2015 16:09:26 +0000 (+0300) Subject: Fix forced inlining to work with Visual Studio. X-Git-Tag: 1.9.9-b1~872^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10%2Fhead;p=thirdparty%2Fzlib-ng.git Fix forced inlining to work with Visual Studio. --- diff --git a/deflate.c b/deflate.c index da42bb30..09d486c4 100644 --- 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++) { diff --git a/win32/Makefile.msc b/win32/Makefile.msc index d7a9ec8d..318be92e 100644 --- a/win32/Makefile.msc +++ b/win32/Makefile.msc @@ -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 5feddb24..d0cab497 100644 --- 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 */