diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-09-18 21:38:36 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-09-18 21:47:12 +0200 |
commit | 914591c9ae2676f7c39bfd65277471cd02f3a85f (patch) | |
tree | 0fa9ec5fe6e822cdd02a89b1b1476c32c5376b22 /thirdparty/zstd/common/error_private.h | |
parent | a332e2f5b2d4acfda639701d719ff415d73c5d0b (diff) |
zstd: Update to upstream version 1.4.5
Diffstat (limited to 'thirdparty/zstd/common/error_private.h')
-rw-r--r-- | thirdparty/zstd/common/error_private.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/thirdparty/zstd/common/error_private.h b/thirdparty/zstd/common/error_private.h index 0d2fa7e34b..982cf8e9fe 100644 --- a/thirdparty/zstd/common/error_private.h +++ b/thirdparty/zstd/common/error_private.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -49,7 +49,7 @@ typedef ZSTD_ErrorCode ERR_enum; /*-**************************************** * Error codes handling ******************************************/ -#undef ERROR /* reported already defined on VS 2015 (Rich Geldreich) */ +#undef ERROR /* already defined on Visual Studio */ #define ERROR(name) ZSTD_ERROR(name) #define ZSTD_ERROR(name) ((size_t)-PREFIX(name)) @@ -57,6 +57,10 @@ ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); } ERR_STATIC ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0; return (ERR_enum) (0-code); } +/* check and forward error code */ +#define CHECK_V_F(e, f) size_t const e = f; if (ERR_isError(e)) return e +#define CHECK_F(f) { CHECK_V_F(_var_err__, f); } + /*-**************************************** * Error Strings |