]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[threading] Fix ERROR macro after including windows.h
authorNick Terrell <terrelln@fb.com>
Sat, 26 Aug 2017 00:44:32 +0000 (17:44 -0700)
committerNick Terrell <terrelln@fb.com>
Mon, 28 Aug 2017 23:25:02 +0000 (16:25 -0700)
lib/common/error_private.h
lib/common/threading.h

index 9dd9a87cfac83093b50f720841a22e08b3453374..f8e68016a687015136a7d7e26b03e640fba3ea61 100644 (file)
@@ -51,7 +51,8 @@ typedef ZSTD_ErrorCode ERR_enum;
 #ifdef ERROR
 #  undef ERROR   /* reported already defined on VS 2015 (Rich Geldreich) */
 #endif
-#define ERROR(name) ((size_t)-PREFIX(name))
+#define ERROR(name) ZSTD_ERROR(name)
+#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
 
 ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
 
index ab09977a86dc31e5e49a616bc7fa97929622937f..0a9fcf8575751535d33d7eea15343a3737420d67 100644 (file)
@@ -37,7 +37,15 @@ extern "C" {
 #  define WIN32_LEAN_AND_MEAN
 #endif
 
+#ifdef ERROR
+#  undef ERROR   /* reported already defined on VS 2015 (Rich Geldreich) */
+#endif
 #include <windows.h>
+#ifdef ERROR
+#  undef ERROR   /* reported already defined on VS 2015 (Rich Geldreich) */
+#endif
+#define ERROR(name) ZSTD_ERROR(name)
+
 
 /* mutex */
 #define pthread_mutex_t           CRITICAL_SECTION