[x264-devel] [PATCH 1 of 3] Add support for VC12 compiler
Steve Borho
steve at borho.org
Wed Mar 19 01:07:30 CET 2014
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1395186574 18000
# Tue Mar 18 18:49:34 2014 -0500
# Node ID 3fdb434e2e5d411d04a4e6a753d9393455a955cc
# Parent 55d9d8828ea5a9d5997aca2b6bd9dc7410a859c5
Add support for VC12 compiler
diff -r 55d9d8828ea5 -r 3fdb434e2e5d common/osdep.h
--- a/common/osdep.h Fri Mar 14 16:34:06 2014 +0530
+++ b/common/osdep.h Tue Mar 18 18:49:34 2014 -0500
@@ -48,7 +48,7 @@
#define log2(x) (log(x)/0.693147180559945)
#endif
-#ifdef __ICL
+#if defined(__ICL) || defined(_MSC_VER)
#define inline __inline
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
@@ -89,11 +89,14 @@
#define x264_is_pipe(x) 0
#endif
-#ifdef __ICL
+#if defined(__ICL) || defined(_MSC_VER)
#define DECLARE_ALIGNED( var, n ) __declspec(align(n)) var
-#else
+#endif
+
+#ifndef DECLARE_ALIGNED
#define DECLARE_ALIGNED( var, n ) var __attribute__((aligned(n)))
#endif
+
#define ALIGNED_32( var ) DECLARE_ALIGNED( var, 32 )
#define ALIGNED_16( var ) DECLARE_ALIGNED( var, 16 )
#define ALIGNED_8( var ) DECLARE_ALIGNED( var, 8 )
@@ -146,7 +149,11 @@
#define ALIGNED_ARRAY_N ALIGNED_ARRAY_16
#endif
+#if _MSC_VER
+#define UNINIT(x) x
+#else
#define UNINIT(x) x=x
+#endif
#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
#define UNUSED __attribute__((unused))
@@ -160,7 +167,15 @@
#define ALWAYS_INLINE __forceinline
#define NOINLINE __declspec(noinline)
#else
-#define ALWAYS_INLINE inline
+
+#if _MSC_VER
+#define ALWAYS_INLINE __inline
+#endif
+
+#ifndef ALWAYS_INLINE
+#define ALWAYS_INLINE __inline
+#endif
+
#define NOINLINE
#endif
#define UNUSED
diff -r 55d9d8828ea5 -r 3fdb434e2e5d x264.h
--- a/x264.h Fri Mar 14 16:34:06 2014 +0530
+++ b/x264.h Tue Mar 18 18:49:34 2014 -0500
@@ -29,7 +29,7 @@
#define X264_X264_H
#if !defined(_STDINT_H) && !defined(_STDINT_H_) && !defined(_STDINT_H_INCLUDED) &&\
- !defined(_INTTYPES_H) && !defined(_INTTYPES_H_)
+ !defined(_INTTYPES_H) && !defined(_INTTYPES_H_) && !defined(_STDINT)
# ifdef _MSC_VER
# pragma message("You must include stdint.h or inttypes.h before x264.h")
# else
More information about the x264-devel
mailing list