Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Gramner <gramner@twoorioles.com>2022-09-30 01:11:29 +0300
committerHenrik Gramner <gramner@twoorioles.com>2022-09-30 18:04:20 +0300
commite4c4af02f3de5e6cea6f81272a2981c0fa7bae28 (patch)
treeaf7c69678a43322235e3abd85fd9cd6433690126 /include
parent58c856b76ad423efe59a518b5f02752354e0d0d8 (diff)
Specify hidden visibility for global data symbol declarations
'-fvisibility=hidden' only applies to definitions, not declarations, so the compiler has to be conservative about how references to global data symbols are performed. Explicitly specifying the visibility allows for better code generation.
Diffstat (limited to 'include')
-rw-r--r--include/common/attributes.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/common/attributes.h b/include/common/attributes.h
index ba04fcb..2af42ef 100644
--- a/include/common/attributes.h
+++ b/include/common/attributes.h
@@ -113,6 +113,12 @@
#define ALWAYS_INLINE __attribute__((always_inline)) inline
#endif
+#if (defined(__ELF__) || defined(__MACH__) || (defined(_WIN32) && defined(__clang__))) && __has_attribute(visibility)
+#define EXTERN extern __attribute__((visibility("hidden")))
+#else
+#define EXTERN extern
+#endif
+
#ifdef __clang__
#define NO_SANITIZE(x) __attribute__((no_sanitize(x)))
#else