diff --git a/bitstream.h b/bitstream.h index c25643a..00509a7 100644 --- a/bitstream.h +++ b/bitstream.h @@ -11,7 +11,6 @@ #include #include "internals.h" -#include "error.h" #include "mem.h" struct bswriter { diff --git a/decode_generic.h b/decode_generic.h index dc91e92..ec15a22 100644 --- a/decode_generic.h +++ b/decode_generic.h @@ -8,7 +8,6 @@ #include "bitstream.h" #include "common.h" -#include "error.h" #include "internals.h" #define decctx_(_width_) BITWIDTH_SUFFIX(decctx, _width_) diff --git a/encode_generic.h b/encode_generic.h index b3556cc..c0d630c 100644 --- a/encode_generic.h +++ b/encode_generic.h @@ -9,7 +9,6 @@ #include "bitstream.h" #include "common.h" #include "countbits.h" -#include "error.h" #include "internals.h" #define encctx_(_width_) BITWIDTH_SUFFIX(encctx, _width_) diff --git a/error.h b/error.h deleted file mode 100644 index 375df88..0000000 --- a/error.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - Copyright (c) 2019 Vicente Romero Calero. All rights reserved. - Licensed under the MIT License. - See LICENSE file in the project root for full license information. - */ -#ifndef VTENC_ERROR_H_ -#define VTENC_ERROR_H_ - -#include "internals.h" - -#define return_if_error(exp) \ -do { \ - const int code = (exp); \ - if (code != VTENC_OK) { \ - return code; \ - } \ -} while(0) - -#endif /* VTENC_ERROR_H_ */ diff --git a/internals.h b/internals.h index 977367a..9a20c22 100644 --- a/internals.h +++ b/internals.h @@ -40,4 +40,13 @@ struct vtenc { size_t out_size; /* Output size in bytes */ }; +/* Error-handling helper macro */ +#define return_if_error(exp) \ +do { \ + const int code = (exp); \ + if (code != VTENC_OK) { \ + return code; \ + } \ +} while(0) + #endif /* VTENC_INTERNALS_H_ */