]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/internal.h
Use full internal pathname in doxygen @file directives.
[ffmpeg] / libavutil / internal.h
index 2010e3008a75b63c9ca91246ba0802201cc49887..7041be2d6b72ad3e64b7a2ba9b53a31228b2532f 100644 (file)
@@ -19,8 +19,8 @@
  */
 
 /**
- * @file internal.h
- * common internal api header.
+ * @file libavutil/internal.h
+ * common internal API header
  */
 
 #ifndef AVUTIL_INTERNAL_H
 #    define NDEBUG
 #endif
 
+#include <limits.h>
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
+#include "config.h"
 #include "common.h"
+#include "mem.h"
 #include "timer.h"
 
 #ifndef attribute_align_arg
@@ -96,8 +99,6 @@
 #    define PIC
 #endif
 
-#include "config.h"
-
 #ifndef offsetof
 #    define offsetof(T,F) ((unsigned int)((char *)&((T *)0)->F))
 #endif
@@ -164,8 +165,6 @@ static inline av_const int FASTDIV(int a, int b)
 
 extern const uint8_t ff_sqrt_tab[256];
 
-static inline int av_log2_16bit(unsigned int v);
-
 static inline av_const unsigned int ff_sqrt(unsigned int a)
 {
     unsigned int b;
@@ -219,7 +218,7 @@ if((y)<(x)){\
 }
 #endif
 
-/* avoid usage of various functions */
+/* avoid usage of dangerous/inappropriate system functions */
 #undef  malloc
 #define malloc please_use_av_malloc
 #undef  free
@@ -242,11 +241,11 @@ if((y)<(x)){\
 #define exit exit_is_forbidden
 #ifndef LIBAVFORMAT_BUILD
 #undef  printf
-#define printf please_use_av_log
+#define printf please_use_av_log_instead_of_printf
 #undef  fprintf
-#define fprintf please_use_av_log
+#define fprintf please_use_av_log_instead_of_fprintf
 #undef  puts
-#define puts please_use_av_log
+#define puts please_use_av_log_instead_of_puts
 #undef  perror
 #define perror please_use_av_log_instead_of_perror
 #endif
@@ -260,6 +259,23 @@ if((y)<(x)){\
     }\
 }
 
+#if defined(__ICC) || defined(__SUNPRO_C)
+    #define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
+    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
+#elif defined(__GNUC__)
+    #define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
+    #define DECLARE_ASM_CONST(n,t,v)    static const t v attribute_used __attribute__ ((aligned (n)))
+#elif defined(_MSC_VER)
+    #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
+    #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v
+#elif HAVE_INLINE_ASM
+    #error The asm code needs alignment, but we do not know how to do it for this compiler.
+#else
+    #define DECLARE_ALIGNED(n,t,v)      t v
+    #define DECLARE_ASM_CONST(n,t,v)    static const t v
+#endif
+
+
 #if !HAVE_LLRINT
 static av_always_inline av_const long long llrint(double x)
 {
@@ -303,8 +319,8 @@ static av_always_inline av_const float truncf(float x)
 #endif /* HAVE_TRUNCF */
 
 /**
- * Returns NULL if CONFIG_SMALL is true otherwise the argument
- * without modifications, used to disable the definition of strings
+ * Returns NULL if CONFIG_SMALL is true, otherwise the argument
+ * without modification. Used to disable the definition of strings
  * (for example AVCodec long_names).
  */
 #if CONFIG_SMALL