From 1b345c8cda78f4da7316a05f84a5bfc7f5865dbd Mon Sep 17 00:00:00 2001 From: Daniel Bermond Date: Mon, 25 May 2020 16:04:32 +0000 Subject: [PATCH] Fix build with gcc 10 gcc 10 uses '-fno-common' by default[1]. It means that global variables must be declared with the 'extern' keyword, otherwise a link error will occur. References ---------- [1] https://gcc.gnu.org/gcc-10/porting_to.html#common Author: Daniel Bermond Date: Mon May 25 16:04:32 2020 +0000 Change-Id: I9a326388588679722a33d62986ba2ff056524d7c Signed-off-by: Ding Wei --- mpp/codec/dec/h264/h264d_global.h | 2 +- mpp/hal/common/h264/hal_h264e_com.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mpp/codec/dec/h264/h264d_global.h b/mpp/codec/dec/h264/h264d_global.h index 4f3a4af6..29acdfcc 100644 --- a/mpp/codec/dec/h264/h264d_global.h +++ b/mpp/codec/dec/h264/h264d_global.h @@ -139,7 +139,7 @@ if ((val) < 0) {\ //!< PPS parameters #define MAXnum_slice_groups_minus1 8 -enum { +typedef enum { H264ScalingList4x4Length = 16, H264ScalingList8x8Length = 64, } ScalingListLength; diff --git a/mpp/hal/common/h264/hal_h264e_com.h b/mpp/hal/common/h264/hal_h264e_com.h index 50082f55..95afbf80 100644 --- a/mpp/hal/common/h264/hal_h264e_com.h +++ b/mpp/hal/common/h264/hal_h264e_com.h @@ -311,9 +311,9 @@ MPP_RET h264e_set_sps(H264eHalContext *ctx, H264eSps *sps); MPP_RET h264e_set_pps(H264eHalContext *ctx, H264ePps *pps, H264eSps *sps); void h264e_set_param(H264eHalParam *p, RK_S32 hw_type); -const RK_U8 * const h264e_cqm_jvt[8]; -const RK_U8 h264e_zigzag_scan4[2][16]; -const RK_U8 h264e_zigzag_scan8[2][64]; +extern const RK_U8 * const h264e_cqm_jvt[8]; +extern const RK_U8 h264e_zigzag_scan4[2][16]; +extern const RK_U8 h264e_zigzag_scan8[2][64]; void h264e_rkv_set_format(H264eHwCfg *hw_cfg, MppEncPrepCfg *prep_cfg); void h264e_vpu_set_format(H264eHwCfg *hw_cfg, MppEncPrepCfg *prep_cfg); void h264e_sei_pack2str(char *str, H264eHalContext *ctx, RcSyntax *rc_syn);