diff mbox series

[FFmpeg-devel,1/9] avutil/attributes_internal: Add visibility pragma

Message ID GV1P250MB0737B923F3D6B89664C7F2E68F5B9@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Superseded
Headers show
Series [FFmpeg-devel,1/9] avutil/attributes_internal: Add visibility pragma | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 3, 2022, 10:32 p.m. UTC
GCC 4.0 not only added a visibility attribute, but also
a pragma to set it for a whole region of code.*
This commit exposes this via macros.

*: See https://gcc.gnu.org/gcc-4.0/changes.html

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavutil/attributes_internal.h | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/libavutil/attributes_internal.h b/libavutil/attributes_internal.h
index 9d3d10b63e..c81e9b8204 100644
--- a/libavutil/attributes_internal.h
+++ b/libavutil/attributes_internal.h
@@ -23,8 +23,12 @@ 
 
 #if (AV_GCC_VERSION_AT_LEAST(4,0) || defined(__clang__)) && (defined(__ELF__) || defined(__MACH__))
 #    define attribute_visibility_hidden __attribute__((visibility("hidden")))
+#    define FF_VISIBILITY_PUSH_HIDDEN   _Pragma("GCC visibility push(hidden)")
+#    define FF_VISIBILITY_POP_HIDDEN    _Pragma("GCC visibility pop")
 #else
 #    define attribute_visibility_hidden
+#    define FF_VISIBILITY_START_HIDDEN
+#    define FF_VISIBILITY_END_HIDDEN
 #endif
 
 #endif /* AVUTIL_ATTRIBUTES_INTERNAL_H */