]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/internal.h
fix decoding of dracula.4xm before diego complains
[ffmpeg] / libavutil / internal.h
index af32f56907e4909e849c41aa681113f863dcf853..1ae163f4fac5fb2dbbf35baf0c592c36c83b4025 100644 (file)
 #ifndef INTERNAL_H
 #define INTERNAL_H
 
+#if !defined(DEBUG) && !defined(NDEBUG)
+#    define NDEBUG
+#endif
+
 #include <stdint.h>
+#include <stddef.h>
 #include <assert.h>
 
+#ifndef attribute_align_arg
+#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__>1)
+#    define attribute_align_arg __attribute__((force_align_arg_pointer))
+#else
+#    define attribute_align_arg
+#endif
+#endif
+
 #ifndef attribute_used
 #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
 #    define attribute_used __attribute__((used))
 #endif
 #endif
 
+/* Use Apple-specific AltiVec syntax for vector declarations when necessary. */
+#ifdef __APPLE_CC__
+#define AVV(x...) (x)
+#else
+#define AVV(x...) {x}
+#endif
+
 #ifndef M_PI
 #define M_PI    3.14159265358979323846
 #endif
 #include "intreadwrite.h"
 #include "bswap.h"
 
-#include <stddef.h>
 #ifndef offsetof
 #    define offsetof(T,F) ((unsigned int)((char *)&((T *)0)->F))
 #endif
 
-#ifdef __MINGW32__
-#    ifdef _DEBUG
-#        define DEBUG
-#    endif
-
-#    define snprintf _snprintf
-#    define vsnprintf _vsnprintf
-
-/* __MINGW32__ end */
-#elif defined (CONFIG_OS2)
-/* OS/2 EMX */
-
-#    include <float.h>
-
-#endif /* !__MINGW32__ && CONFIG_OS2 */
-
 #ifdef USE_FASTMEMCPY
 #    include "libvo/fastmemcpy.h"
 #    define memcpy(a,b,c) fast_memcpy(a,b,c)
 #else
 #    if defined(ARCH_X86_64) && defined(PIC)
 #        define MANGLE(a) #a"(%%rip)"
-#    elif defined(CONFIG_DARWIN)
+#    elif defined(__APPLE__)
 #        define MANGLE(a) "_" #a
 #    else
 #        define MANGLE(a) #a
 
 /* debug stuff */
 
-#if !defined(DEBUG) && !defined(NDEBUG)
-#    define NDEBUG
-#endif
-#include <assert.h>
-
 /* dprintf macros */
 #ifdef DEBUG
 #    define dprintf(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
@@ -276,21 +274,7 @@ if((y)<(x)){\
 /* btw, rintf() is existing on fbsd too -- alex */
 static av_always_inline long int lrintf(float x)
 {
-#ifdef __MINGW32__
-#  ifdef ARCH_X86_32
-    int32_t i;
-    asm volatile(
-        "fistpl %0\n\t"
-        : "=m" (i) : "t" (x) : "st"
-    );
-    return i;
-#  else
-    /* XXX: incorrect, but make it compile */
-    return (int)(x + (x < 0 ? -0.5 : 0.5));
-#  endif /* ARCH_X86_32 */
-#else
     return (int)(rint(x));
-#endif /* __MINGW32__ */
 }
 #endif /* HAVE_LRINTF */