[x264-devel] [PATCH] osdep: make aware of MSVC

Diego Biurrun diego at biurrun.de
Tue May 20 22:59:34 CEST 2014


On Tue, May 20, 2014 at 01:29:47PM -0500, Steve Borho wrote:
> # HG changeset patch
> # User Steve Borho <steve at borho.org>
> # Date 1400609639 18000
> #      Tue May 20 13:13:59 2014 -0500
> # Node ID 0dc8611d2feec2d44ffba2a79472694a61fb0e66
> # Parent  b07a2ecf2c00fe76b497c3909bce5efb79ec4635

WTH?

> osdep: make aware of MSVC

What else is needed for full MSVC support?

> --- a/common/osdep.h	Wed Apr 09 03:33:06 2014 -0300
> +++ b/common/osdep.h	Tue May 20 13:13:59 2014 -0500
> @@ -146,27 +146,33 @@
>  
>  #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
> -#define UNUSED __attribute__((unused))
> -#define ALWAYS_INLINE __attribute__((always_inline)) inline
> -#define NOINLINE __attribute__((noinline))
> -#define MAY_ALIAS __attribute__((may_alias))
> -#define x264_constant_p(x) __builtin_constant_p(x)
> -#define x264_nonconstant_p(x) (!__builtin_constant_p(x))
> +# define UNUSED __attribute__((unused))
> +# define ALWAYS_INLINE __attribute__((always_inline)) inline
> +# define NOINLINE __attribute__((noinline))
> +# define MAY_ALIAS __attribute__((may_alias))
> +# define x264_constant_p(x) __builtin_constant_p(x)
> +# define x264_nonconstant_p(x) (!__builtin_constant_p(x))
> +#elif defined(__ICL) || defined(_MSC_VER)
> +# define ALWAYS_INLINE __forceinline
> +# define NOINLINE __declspec(noinline)
> +# define UNUSED
> +# define MAY_ALIAS
> +# define x264_constant_p(x) 0
> +# define x264_nonconstant_p(x) 0
>  #else
> -#ifdef __ICL
> -#define ALWAYS_INLINE __forceinline
> -#define NOINLINE __declspec(noinline)
> -#else
> -#define ALWAYS_INLINE inline
> -#define NOINLINE
> -#endif
> -#define UNUSED
> -#define MAY_ALIAS
> -#define x264_constant_p(x) 0
> -#define x264_nonconstant_p(x) 0
> +# define ALWAYS_INLINE inline
> +# define NOINLINE
> +# define UNUSED
> +# define MAY_ALIAS
> +# define x264_constant_p(x) 0
> +# define x264_nonconstant_p(x) 0
>  #endif

Dunno what the policy for whitespace changes folded into functional
changes is around here, but the rest of the file does not have spaces
after '#', so IMO you're just creating formatting inconsistencies.

Diego


More information about the x264-devel mailing list