OSDN Git Service

Cygwin's mangling by Felix Buenemann <atmosfear@users.sourceforge.net>
authorNick Kurshev <nickols_k@mail.ru>
Sun, 20 Jan 2002 14:30:34 +0000 (14:30 +0000)
committerNick Kurshev <nickols_k@mail.ru>
Sun, 20 Jan 2002 14:30:34 +0000 (14:30 +0000)
Originally committed as revision 273 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/common.h
libavcodec/i386/simple_idct_mmx.c
libavcodec/mangle.h [new file with mode: 0644]
mangle.h [new file with mode: 0644]

index 1ecc49b..f359216 100644 (file)
@@ -4,7 +4,7 @@
 #define FFMPEG_VERSION_INT 0x000406
 #define FFMPEG_VERSION     "0.4.6"
 
-#if defined(WIN32) && !defined(__MINGW32__)
+#if defined(WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
 #define CONFIG_WIN32
 #endif
 
index 80ca2df..163097d 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <inttypes.h>
 #include "../dsputil.h"
+#include "../mangle.h"
 
 #define C0 23170 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
 #define C1 22725 //cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5
@@ -345,7 +346,7 @@ static inline void idct(int16_t *block)
        "movq " #src4 ", %%mm1                  \n\t" /* R6     R2      r6      r2 */\
        "movq " #src1 ", %%mm2                  \n\t" /* R3     R1      r3      r1 */\
        "movq " #src5 ", %%mm3                  \n\t" /* R7     R5      r7      r5 */\
-       "movq wm1010, %%mm4                     \n\t"\
+       "movq "MANGLE(wm1010)", %%mm4           \n\t"\
        "pand %%mm0, %%mm4                      \n\t"\
        "por %%mm1, %%mm4                       \n\t"\
        "por %%mm2, %%mm4                       \n\t"\
@@ -419,7 +420,7 @@ static inline void idct(int16_t *block)
        "jmp 2f                                 \n\t"\
        "1:                                     \n\t"\
        "pslld $16, %%mm0                       \n\t"\
-       "#paddd d40000, %%mm0                   \n\t"\
+       "#paddd "MANGLE(d40000)", %%mm0         \n\t"\
        "psrad $13, %%mm0                       \n\t"\
        "packssdw %%mm0, %%mm0                  \n\t"\
        "movq %%mm0, " #dst "                   \n\t"\
@@ -453,7 +454,7 @@ COL_IDCT(  24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
        "movq " #src4 ", %%mm1                  \n\t" /* R6     R2      r6      r2 */\
        "movq " #src1 ", %%mm2                  \n\t" /* R3     R1      r3      r1 */\
        "movq " #src5 ", %%mm3                  \n\t" /* R7     R5      r7      r5 */\
-       "movq wm1010, %%mm4                     \n\t"\
+       "movq "MANGLE(wm1010)", %%mm4           \n\t"\
        "pand %%mm0, %%mm4                      \n\t"\
        "por %%mm1, %%mm4                       \n\t"\
        "por %%mm2, %%mm4                       \n\t"\
@@ -527,7 +528,7 @@ COL_IDCT(  24(%1), 88(%1), 56(%1), 120(%1), 12(%0),/nop, 20)
        "jmp 2f                                 \n\t"\
        "1:                                     \n\t"\
        "pslld $16, %%mm0                       \n\t"\
-       "paddd d40000, %%mm0                    \n\t"\
+       "paddd "MANGLE(d40000)", %%mm0          \n\t"\
        "psrad $13, %%mm0                       \n\t"\
        "packssdw %%mm0, %%mm0                  \n\t"\
        "movq %%mm0, " #dst "                   \n\t"\
diff --git a/libavcodec/mangle.h b/libavcodec/mangle.h
new file mode 100644 (file)
index 0000000..8709cd1
--- /dev/null
@@ -0,0 +1,2 @@
+#include "../mangle.h"
+
diff --git a/mangle.h b/mangle.h
new file mode 100644 (file)
index 0000000..df74777
--- /dev/null
+++ b/mangle.h
@@ -0,0 +1,18 @@
+/* mangle.h - This file has some CPP macros to deal with different symbol
+ * mangling across binary formats.
+ * (c)2002 by Felix Buenemann <atmosfear at users.sourceforge.net>
+ * File licensed under the GPL, see http://www.fsf.org/ for more info.
+ */
+
+#ifndef __MANGLE_H
+#define __MANGLE_H
+
+/* Feel free to add more to the list, eg. a.out IMO */
+#if defined(__CYGWIN__)
+#define MANGLE(a) "_" #a
+#else
+#define MANGLE(a) #a
+#endif
+
+#endif /* !__MANGLE_H */
+