]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Improve compatability with MSVC compiler by allowing usage of inline
authorroot <root@hk.drivdigital.no>
Thu, 11 Dec 2014 10:47:56 +0000 (11:47 +0100)
committerroot <root@hk.drivdigital.no>
Thu, 11 Dec 2014 10:47:56 +0000 (11:47 +0100)
zutil.h

diff --git a/zutil.h b/zutil.h
index 470aab77661e720e599e366bb25de0c7eb3a1f8d..e6851679cf7f77dc7a7b17474f252536ac40fe38 100644 (file)
--- a/zutil.h
+++ b/zutil.h
@@ -97,12 +97,17 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
 #endif
 
 /* provide prototypes for these when building zlib without LFS */
-#if !defined(_WIN32) && \
-    (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
+#if !defined(_WIN32) && (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
     ZEXTERN uLong ZEXPORT adler32_combine64 (uLong, uLong, z_off_t);
     ZEXTERN uLong ZEXPORT crc32_combine64 (uLong, uLong, z_off_t);
 #endif
 
+/* MS Visual Studio does not allow inline in C, only C++.
+   But it provides __inline instead, so use that. */
+#if defined(_MSC_VER) && !defined(inline)
+#  define inline __inline
+#endif
+
         /* common defaults */
 
 #ifndef OS_CODE