diff --git a/lib/common/error_private.h b/lib/common/error_private.h index 9dd9a87c..f8e68016 100644 --- a/lib/common/error_private.h +++ b/lib/common/error_private.h @@ -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)); } diff --git a/lib/common/threading.h b/lib/common/threading.h index ab09977a..0a9fcf85 100644 --- a/lib/common/threading.h +++ b/lib/common/threading.h @@ -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 +#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