[FFmpeg-cvslog] r24086 - in trunk/libavutil: common.h intmath.h

mru subversion
Wed Jul 7 19:27:43 CEST 2010


Author: mru
Date: Wed Jul  7 19:27:43 2010
New Revision: 24086

Log:
Remove macro duplication between common.h and intmath.h

Modified:
   trunk/libavutil/common.h
   trunk/libavutil/intmath.h

Modified: trunk/libavutil/common.h
==============================================================================
--- trunk/libavutil/common.h	Wed Jul  7 19:27:39 2010	(r24085)
+++ trunk/libavutil/common.h	Wed Jul  7 19:27:43 2010	(r24086)
@@ -90,12 +90,8 @@ static inline av_const int av_log2_16bit
 #   include "intmath.h"
 #endif
 
-#ifndef av_log2
-#   define av_log2       av_log2_c
-#endif
-#ifndef av_log2_16bit
-#   define av_log2_16bit av_log2_16bit_c
-#endif
+/* Pull in unguarded fallback defines at the end of this file. */
+#include "common.h"
 
 /**
  * Clip a signed integer value into the amin-amax range.
@@ -312,3 +308,15 @@ static inline av_const int av_ceil_log2(
 #endif /* HAVE_AV_CONFIG_H */
 
 #endif /* AVUTIL_COMMON_H */
+
+/*
+ * The following definitions are outside the multiple inclusion guard
+ * to ensure they are immediately available in intmath.h.
+ */
+
+#ifndef av_log2
+#   define av_log2       av_log2_c
+#endif
+#ifndef av_log2_16bit
+#   define av_log2_16bit av_log2_16bit_c
+#endif

Modified: trunk/libavutil/intmath.h
==============================================================================
--- trunk/libavutil/intmath.h	Wed Jul  7 19:27:39 2010	(r24085)
+++ trunk/libavutil/intmath.h	Wed Jul  7 19:27:43 2010	(r24086)
@@ -52,22 +52,8 @@ extern const uint32_t ff_inverse[257];
 #   endif
 #endif /* FASTDIV */
 
-/*
- * Get definition of av_log2_c from common.h.  In the event we got
- * here through common.h including this file, including it again will
- * be a no-op due to multi-inclusion guards, so we must duplicate the
- * fallback defines here.
- */
-
 #include "common.h"
 
-#ifndef av_log2
-#   define av_log2       av_log2_c
-#endif
-#ifndef av_log2_16bit
-#   define av_log2_16bit av_log2_16bit_c
-#endif
-
 extern const uint8_t ff_sqrt_tab[256];
 
 static inline av_const unsigned int ff_sqrt(unsigned int a)



More information about the ffmpeg-cvslog mailing list