summaryrefslogtreecommitdiff
path: root/vp8/vp8_cx_iface.c
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2020-01-17 23:15:19 -0800
committerJames Zern <jzern@google.com>2020-01-17 23:17:46 -0800
commitbc9b7f50bb0241f774fab701d66fa5a02157ad27 (patch)
tree88032c974bb5f42fd3b77986ac38c564b81d1692 /vp8/vp8_cx_iface.c
parent49aa77c61fc1d2dc369594fb19c3165f9c56bd18 (diff)
downloadlibvpx-bc9b7f50bb0241f774fab701d66fa5a02157ad27.tar.gz
libvpx-bc9b7f50bb0241f774fab701d66fa5a02157ad27.tar.bz2
libvpx-bc9b7f50bb0241f774fab701d66fa5a02157ad27.zip
add static_assert.h
unify COMPILE_TIME_ASSERT definitions and rename to VPX_STATIC_ASSERT Change-Id: Id51150c204e0c4eaf355ee45b20915113209d524
Diffstat (limited to 'vp8/vp8_cx_iface.c')
-rw-r--r--vp8/vp8_cx_iface.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c
index 07ea52c05..8f7617abf 100644
--- a/vp8/vp8_cx_iface.c
+++ b/vp8/vp8_cx_iface.c
@@ -16,6 +16,7 @@
#include "vpx/internal/vpx_codec_internal.h"
#include "vpx_version.h"
#include "vpx_mem/vpx_mem.h"
+#include "vpx_ports/static_assert.h"
#include "vpx_ports/system_state.h"
#include "vpx_ports/vpx_once.h"
#include "vpx_util/vpx_timestamp.h"
@@ -131,22 +132,6 @@ static vpx_codec_err_t update_error_state(
if (!!((p)->memb) != (p)->memb) ERROR(#memb " expected boolean"); \
} while (0)
-#if defined(_MSC_VER)
-#define COMPILE_TIME_ASSERT(boolexp) \
- do { \
- char compile_time_assert[(boolexp) ? 1 : -1]; \
- (void)compile_time_assert; \
- } while (0)
-#else /* !_MSC_VER */
-#define COMPILE_TIME_ASSERT(boolexp) \
- do { \
- struct { \
- unsigned int compile_time_assert : (boolexp) ? 1 : -1; \
- } compile_time_assert; \
- (void)compile_time_assert; \
- } while (0)
-#endif /* _MSC_VER */
-
static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
const vpx_codec_enc_cfg_t *cfg,
const struct vp8_extracfg *vp8_cfg,
@@ -751,8 +736,8 @@ static void pick_quickcompress_mode(vpx_codec_alg_priv_t *ctx,
/* Convert duration parameter from stream timebase to microseconds */
uint64_t duration_us;
- COMPILE_TIME_ASSERT(TICKS_PER_SEC > 1000000 &&
- (TICKS_PER_SEC % 1000000) == 0);
+ VPX_STATIC_ASSERT(TICKS_PER_SEC > 1000000 &&
+ (TICKS_PER_SEC % 1000000) == 0);
duration_us = duration * (uint64_t)ctx->timestamp_ratio.num /
(ctx->timestamp_ratio.den * (TICKS_PER_SEC / 1000000));