changeset 31931:cc96ac540245

swscale: Always define COMPILE_xxx to either 0 or 1.
author ramiro
date Wed, 25 Aug 2010 14:38:30 +0000
parents 99c8503d1be8
children 58ecd8282065
files libswscale/swscale.c
diffstat 1 files changed, 28 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libswscale/swscale.c	Mon Aug 23 21:22:24 2010 +0000
+++ b/libswscale/swscale.c	Wed Aug 25 14:38:30 2010 +0000
@@ -1151,41 +1151,57 @@
 //Note: we have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one
 //Plain C versions
 #if (!HAVE_MMX && !HAVE_ALTIVEC) || CONFIG_RUNTIME_CPUDETECT
-#define COMPILE_C
+#define COMPILE_C 1
 #endif
 
 #if ARCH_PPC
 #if HAVE_ALTIVEC
-#define COMPILE_ALTIVEC
+#define COMPILE_ALTIVEC 1
 #endif
 #endif //ARCH_PPC
 
 #if ARCH_X86
 
 #if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT
-#define COMPILE_MMX
+#define COMPILE_MMX 1
 #endif
 
 #if HAVE_MMX2 || CONFIG_RUNTIME_CPUDETECT
-#define COMPILE_MMX2
+#define COMPILE_MMX2 1
 #endif
 
 #if (HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT
-#define COMPILE_3DNOW
+#define COMPILE_3DNOW 1
 #endif
 #endif //ARCH_X86
 
+#ifndef COMPILE_C
+#  define COMPILE_C 0
+#endif
+#ifndef COMPILE_MMX
+#  define COMPILE_MMX 0
+#endif
+#ifndef COMPILE_MMX2
+#  define COMPILE_MMX2 0
+#endif
+#ifndef COMPILE_3DNOW
+#  define COMPILE_3DNOW 0
+#endif
+#ifndef COMPILE_ALTIVEC
+#  define COMPILE_ALTIVEC 0
+#endif
+
 #define COMPILE_TEMPLATE_MMX 0
 #define COMPILE_TEMPLATE_MMX2 0
 #define COMPILE_TEMPLATE_AMD3DNOW 0
 #define COMPILE_TEMPLATE_ALTIVEC 0
 
-#ifdef COMPILE_C
+#if COMPILE_C
 #define RENAME(a) a ## _C
 #include "swscale_template.c"
 #endif
 
-#ifdef COMPILE_ALTIVEC
+#if COMPILE_ALTIVEC
 #undef RENAME
 #undef COMPILE_TEMPLATE_ALTIVEC
 #define COMPILE_TEMPLATE_ALTIVEC 1
@@ -1196,7 +1212,7 @@
 #if ARCH_X86
 
 //MMX versions
-#ifdef COMPILE_MMX
+#if COMPILE_MMX
 #undef RENAME
 #undef COMPILE_TEMPLATE_MMX
 #undef COMPILE_TEMPLATE_MMX2
@@ -1209,7 +1225,7 @@
 #endif
 
 //MMX2 versions
-#ifdef COMPILE_MMX2
+#if COMPILE_MMX2
 #undef RENAME
 #undef COMPILE_TEMPLATE_MMX
 #undef COMPILE_TEMPLATE_MMX2
@@ -1222,7 +1238,7 @@
 #endif
 
 //3DNOW versions
-#ifdef COMPILE_3DNOW
+#if COMPILE_3DNOW
 #undef RENAME
 #undef COMPILE_TEMPLATE_MMX
 #undef COMPILE_TEMPLATE_MMX2
@@ -1258,7 +1274,7 @@
     }
 
 #else
-#ifdef COMPILE_ALTIVEC
+#if COMPILE_ALTIVEC
     if (flags & SWS_CPU_CAPS_ALTIVEC) {
         sws_init_swScale_altivec(c);
         return swScale_altivec;
@@ -1783,7 +1799,7 @@
     if(srcFormat == PIX_FMT_UYVY422 && dstFormat == PIX_FMT_YUV422P)
         c->swScale= uyvyToYuv422Wrapper;
 
-#ifdef COMPILE_ALTIVEC
+#if COMPILE_ALTIVEC
     if ((c->flags & SWS_CPU_CAPS_ALTIVEC) &&
         !(c->flags & SWS_BITEXACT) &&
         srcFormat == PIX_FMT_YUV420P) {