From d0aa40a0f8c2a7e959628ee2d13c42e1bbbb643a Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sun, 2 Mar 2025 15:27:48 +0100 Subject: [PATCH 1/2] avutil/attributes_internal: Add EXTERN macro for extern+hidden This is inspired by the equivalent dav1d attribute introduced by Henrik Gramner in e4c4af02f3de5e6cea6f81272a2981c0fa7bae28. Also already use it to beautify declarations. Signed-off-by: Andreas Rheinhardt --- libavcodec/mathops.h | 2 +- libavcodec/me_cmp.h | 2 +- libavcodec/vp9dsp.h | 2 +- libavutil/attributes_internal.h | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index 84a924f31b..3e074ddf47 100644 --- a/libavcodec/mathops.h +++ b/libavcodec/mathops.h @@ -33,7 +33,7 @@ extern const uint32_t ff_inverse[257]; extern const uint8_t ff_log2_run[41]; extern const uint8_t ff_sqrt_tab[256]; -extern const uint8_t attribute_visibility_hidden ff_crop_tab[256 + 2 * MAX_NEG_CROP]; +EXTERN const uint8_t ff_crop_tab[256 + 2 * MAX_NEG_CROP]; extern const uint8_t ff_zigzag_direct[64]; extern const uint8_t ff_zigzag_scan[16+1]; diff --git a/libavcodec/me_cmp.h b/libavcodec/me_cmp.h index 9053327c4c..8fcfa38dae 100644 --- a/libavcodec/me_cmp.h +++ b/libavcodec/me_cmp.h @@ -25,7 +25,7 @@ #include "avcodec.h" -extern const uint32_t attribute_visibility_hidden ff_square_tab[512]; +EXTERN const uint32_t ff_square_tab[512]; /* minimum alignment rules ;) diff --git a/libavcodec/vp9dsp.h b/libavcodec/vp9dsp.h index 772848e349..0e93224e17 100644 --- a/libavcodec/vp9dsp.h +++ b/libavcodec/vp9dsp.h @@ -121,7 +121,7 @@ typedef struct VP9DSPContext { vp9_scaled_mc_func smc[5][N_FILTERS][2]; } VP9DSPContext; -extern const int16_t attribute_visibility_hidden ff_vp9_subpel_filters[3][16][8]; +EXTERN const int16_t ff_vp9_subpel_filters[3][16][8]; void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp, int bitexact); diff --git a/libavutil/attributes_internal.h b/libavutil/attributes_internal.h index 3df1ee6af3..bc85ce77ff 100644 --- a/libavutil/attributes_internal.h +++ b/libavutil/attributes_internal.h @@ -31,4 +31,6 @@ # define FF_VISIBILITY_POP_HIDDEN #endif +#define EXTERN extern attribute_visibility_hidden + #endif /* AVUTIL_ATTRIBUTES_INTERNAL_H */ -- 2.45.2