diff --git a/src/utils/bit_reader_inl_utils.h b/src/utils/bit_reader_inl_utils.h index 46b38807..c5f9ae5c 100644 --- a/src/utils/bit_reader_inl_utils.h +++ b/src/utils/bit_reader_inl_utils.h @@ -104,7 +104,7 @@ void VP8LoadNewBytes(VP8BitReader* const br) { } // Read a bit with proba 'prob'. Speed-critical function! -static WEBP_INLINE int VP8GetBit(VP8BitReader* const br, +static WEBP_INLINE int VP8GetBit(VP8BitReader* WEBP_RESTRICT const br, int prob, const char label[]) { // Don't move this declaration! It makes a big speed difference to store // 'range' *before* calling VP8LoadNewBytes(), even if this function doesn't diff --git a/src/utils/utils.h b/src/utils/utils.h index ef04f108..0026a747 100644 --- a/src/utils/utils.h +++ b/src/utils/utils.h @@ -25,6 +25,16 @@ #include "src/dsp/dsp.h" #include "src/webp/types.h" +//------------------------------------------------------------------------------ +// restrict + +#if defined(__GNUC__) || defined(__clang__) +#define WEBP_RESTRICT __restrict +#else +#define WEBP_RESTRICT +#endif + + #ifdef __cplusplus extern "C" { #endif