]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/internal.h
h264: K&R formatting cosmetics
[ffmpeg] / libavutil / internal.h
index 355a42a7b47ba5bc317e50e74a76dcd441cc75f0..210c52437ee37c904942ddc441d0445c7d655d83 100644 (file)
@@ -36,7 +36,6 @@
 #include <assert.h>
 #include "config.h"
 #include "attributes.h"
-#include "timer.h"
 #include "dict.h"
 
 #if ARCH_X86
 #endif
 
 #if HAVE_PRAGMA_DEPRECATED
-#    define FF_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
-#    define FF_ENABLE_DEPRECATION_WARNINGS  _Pragma("GCC diagnostic warning \"-Wdeprecated-declarations\"")
+#    if defined(__ICL)
+#        define FF_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:1478))
+#        define FF_ENABLE_DEPRECATION_WARNINGS  __pragma(warning(pop))
+#    elif defined(_MSC_VER)
+#        define FF_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:4996))
+#        define FF_ENABLE_DEPRECATION_WARNINGS  __pragma(warning(pop))
+#    else
+#        define FF_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
+#        define FF_ENABLE_DEPRECATION_WARNINGS  _Pragma("GCC diagnostic warning \"-Wdeprecated-declarations\"")
+#    endif
 #else
 #    define FF_DISABLE_DEPRECATION_WARNINGS
 #    define FF_ENABLE_DEPRECATION_WARNINGS
 // to be forced to tokenize __VA_ARGS__
 #define E1(x) x
 
+/* Check if the hard coded offset of a struct member still matches reality.
+ * Induce a compilation failure if not.
+ */
+#define AV_CHECK_OFFSET(s, m, o) struct check_##o {    \
+        int x_##o[offsetof(s, m) == o? 1: -1];         \
+    }
+
 #define LOCAL_ALIGNED_A(a, t, v, s, o, ...)             \
     uint8_t la_##v[sizeof(t s o) + (a)];                \
     t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a)
@@ -196,6 +210,10 @@ void avpriv_report_missing_feature(void *avc,
 void avpriv_request_sample(void *avc,
                            const char *msg, ...) av_printf_format(2, 3);
 
+#if HAVE_LIBC_MSVCRT
+#define avpriv_open ff_open
+#endif
+
 /**
  * A wrapper for open() setting O_CLOEXEC.
  */