[FFmpeg-devel] [PATCH 08/10] Add a check for __attribute__((used)) in GCC.

Diego 'Flameeyes' Pettenò flameeyes
Fri Oct 3 15:06:39 CEST 2008


This is needed to tell GCC to emit definitions even when it thinks
they are not going to be used. Without this some static constant
definitions will be removed when they are only used by ASM code.
---

 libavutil/common.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libavutil/common.h b/libavutil/common.h
index 01ead54..8650c2f 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -101,6 +101,14 @@
 #endif
 #endif
 
+#ifndef av_used
+#if defined(__GNUC__)
+#    define av_used __attribute__((used))
+#else
+#    define av_used
+#endif
+#endif
+
 #include "mem.h"
 
 //rounded divison & shift





More information about the ffmpeg-devel mailing list