From c2bb2fbfadf539ad3d6a5120f559342bfa9a2f1d Mon Sep 17 00:00:00 2001 From: Pav Lucistnik Date: Sun, 8 Aug 2004 19:41:37 +0000 Subject: - Fix build with gcc-3.4 Submitted by: Vyacheslav I. Ivanchenko --- multimedia/avifile/Makefile | 15 ++++++ ...a-patch-ffmpeg::libavcodec::i386::dsputil_mmx.c | 13 +++++ ...atch-ffmpeg::libavcodec::i386::motion_est_mmx.c | 11 ++++ ...tch-ffmpeg::libavcodec::i386::simple_idct_mmx.c | 13 +++++ ...atch-ffmpeg::libavcodec::liba52::resample_mmx.c | 17 ++++++ .../avifile/files/extra-patch-include::aviplay.h | 13 +++++ .../avifile/files/extra-patch-include::avm_map.h | 12 +++++ .../avifile/files/extra-patch-include::avm_stl.h | 61 ++++++++++++++++++++++ ...a-patch-lib::aviread::AsfNetworkInputStream.cpp | 39 ++++++++++++++ .../files/extra-patch-lib::common::image.cpp | 11 ++++ ...::libmp3lame_audioenc::lame3.70::quantize-pvt.c | 45 ++++++++++++++++ .../extra-patch-plugins::libvorbis::libvorbis.cpp | 29 ++++++++++ 12 files changed, 279 insertions(+) create mode 100644 multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::i386::dsputil_mmx.c create mode 100644 multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::i386::motion_est_mmx.c create mode 100644 multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::i386::simple_idct_mmx.c create mode 100644 multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::liba52::resample_mmx.c create mode 100644 multimedia/avifile/files/extra-patch-include::aviplay.h create mode 100644 multimedia/avifile/files/extra-patch-include::avm_map.h create mode 100644 multimedia/avifile/files/extra-patch-include::avm_stl.h create mode 100644 multimedia/avifile/files/extra-patch-lib::aviread::AsfNetworkInputStream.cpp create mode 100644 multimedia/avifile/files/extra-patch-lib::common::image.cpp create mode 100644 multimedia/avifile/files/extra-patch-plugins::libmp3lame_audioenc::lame3.70::quantize-pvt.c create mode 100644 multimedia/avifile/files/extra-patch-plugins::libvorbis::libvorbis.cpp (limited to 'multimedia/avifile') diff --git a/multimedia/avifile/Makefile b/multimedia/avifile/Makefile index 5bfa8399c6cc..fce121462e36 100644 --- a/multimedia/avifile/Makefile +++ b/multimedia/avifile/Makefile @@ -65,6 +65,21 @@ PLIST_SUB+= QT="@comment " .include +# fix compile with gcc-3.4.x +.if ${OSVERSION} >= 502126 +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-include::aviplay.h \ + ${FILESDIR}/extra-patch-include::avm_map.h \ + ${FILESDIR}/extra-patch-include::avm_stl.h \ + ${FILESDIR}/extra-patch-lib::aviread::AsfNetworkInputStream.cpp \ + ${FILESDIR}/extra-patch-lib::common::image.cpp \ + ${FILESDIR}/extra-patch-plugins::libvorbis::libvorbis.cpp \ + ${FILESDIR}/extra-patch-ffmpeg::libavcodec::i386::dsputil_mmx.c \ + ${FILESDIR}/extra-patch-ffmpeg::libavcodec::i386::motion_est_mmx.c \ + ${FILESDIR}/extra-patch-ffmpeg::libavcodec::i386::simple_idct_mmx.c \ + ${FILESDIR}/extra-patch-ffmpeg::libavcodec::liba52::resample_mmx.c \ + ${FILESDIR}/extra-patch-plugins::libmp3lame_audioenc::lame3.70::quantize-pvt.c +.endif + WITHOUT_XVID=yes # Does not support xvid 1.0.x .if (${ARCH} != "i386") && (${ARCH} != "amd64") diff --git a/multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::i386::dsputil_mmx.c b/multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::i386::dsputil_mmx.c new file mode 100644 index 000000000000..e1a56d291c6c --- /dev/null +++ b/multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::i386::dsputil_mmx.c @@ -0,0 +1,13 @@ +--- ffmpeg/libavcodec/i386/dsputil_mmx.c.orig Fri Aug 6 13:59:15 2004 ++++ ffmpeg/libavcodec/i386/dsputil_mmx.c Fri Aug 6 14:07:13 2004 +@@ -29,8 +29,8 @@ + static const uint64_t mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL; + static const uint64_t mm_wtwo __attribute__ ((aligned(8))) = 0x0002000200020002ULL; + +-static const uint64_t ff_pw_20 __attribute__ ((aligned(8))) = 0x0014001400140014ULL; +-static const uint64_t ff_pw_3 __attribute__ ((aligned(8))) = 0x0003000300030003ULL; ++static const uint64_t ff_pw_20 __attribute__ ((aligned(8))) __attribute__((used)) = 0x0014001400140014ULL; ++static const uint64_t ff_pw_3 __attribute__ ((aligned(8))) __attribute__((used)) = 0x0003000300030003ULL; + static const uint64_t ff_pw_16 __attribute__ ((aligned(8))) = 0x0010001000100010ULL; + static const uint64_t ff_pw_15 __attribute__ ((aligned(8))) = 0x000F000F000F000FULL; + diff --git a/multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::i386::motion_est_mmx.c b/multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::i386::motion_est_mmx.c new file mode 100644 index 000000000000..038802efa574 --- /dev/null +++ b/multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::i386::motion_est_mmx.c @@ -0,0 +1,11 @@ +--- ffmpeg/libavcodec/i386/motion_est_mmx.c.orig Fri Aug 6 13:59:15 2004 ++++ ffmpeg/libavcodec/i386/motion_est_mmx.c Fri Aug 6 14:08:21 2004 +@@ -26,7 +26,7 @@ + 0x0002000200020002, + }; + +-static __attribute__ ((aligned(8))) uint64_t bone= 0x0101010101010101LL; ++static __attribute__((aligned(8))) __attribute__((used)) uint64_t bone= 0x0101010101010101LL; + + static inline void sad8_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h) + { diff --git a/multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::i386::simple_idct_mmx.c b/multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::i386::simple_idct_mmx.c new file mode 100644 index 000000000000..3d88914c4b1f --- /dev/null +++ b/multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::i386::simple_idct_mmx.c @@ -0,0 +1,13 @@ +--- ffmpeg/libavcodec/i386/simple_idct_mmx.c.orig Fri Aug 6 13:59:15 2004 ++++ ffmpeg/libavcodec/i386/simple_idct_mmx.c Fri Aug 6 14:09:00 2004 +@@ -45,8 +45,8 @@ + #define ROW_SHIFT 11 + #define COL_SHIFT 20 // 6 + +-static const uint64_t __attribute__((aligned(8))) wm1010= 0xFFFF0000FFFF0000ULL; +-static const uint64_t __attribute__((aligned(8))) d40000= 0x0000000000040000ULL; ++static const uint64_t __attribute__((aligned(8))) __attribute__((used)) wm1010= 0xFFFF0000FFFF0000ULL; ++static const uint64_t __attribute__((aligned(8))) __attribute__((used)) d40000= 0x0000000000040000ULL; + static int16_t __attribute__((aligned(8))) temp[64]; + static int16_t __attribute__((aligned(8))) coeffs[]= { + 1<<(ROW_SHIFT-1), 0, 1<<(ROW_SHIFT-1), 0, diff --git a/multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::liba52::resample_mmx.c b/multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::liba52::resample_mmx.c new file mode 100644 index 000000000000..d4b176eac503 --- /dev/null +++ b/multimedia/avifile/files/extra-patch-ffmpeg::libavcodec::liba52::resample_mmx.c @@ -0,0 +1,17 @@ +--- ffmpeg/libavcodec/liba52/resample_mmx.c.orig Fri Aug 6 13:59:15 2004 ++++ ffmpeg/libavcodec/liba52/resample_mmx.c Fri Aug 6 14:09:51 2004 +@@ -7,10 +7,10 @@ + and it would mean (C / MMX2 / MMX / 3DNOW) versions + */ + +-static uint64_t __attribute__((aligned(8))) magicF2W= 0x43c0000043c00000LL; +-static uint64_t __attribute__((aligned(8))) wm1010= 0xFFFF0000FFFF0000LL; +-static uint64_t __attribute__((aligned(8))) wm0101= 0x0000FFFF0000FFFFLL; +-static uint64_t __attribute__((aligned(8))) wm1100= 0xFFFFFFFF00000000LL; ++static uint64_t __attribute__((aligned(8))) __attribute__((used)) magicF2W= 0x43c0000043c00000LL; ++static uint64_t __attribute__((aligned(8))) __attribute__((used)) wm1010= 0xFFFF0000FFFF0000LL; ++static uint64_t __attribute__((aligned(8))) __attribute__((used)) wm0101= 0x0000FFFF0000FFFFLL; ++static uint64_t __attribute__((aligned(8))) __attribute__((used)) wm1100= 0xFFFFFFFF00000000LL; + + static int a52_resample_MONO_to_5_MMX(float * _f, int16_t * s16){ + int32_t * f = (int32_t *) _f; diff --git a/multimedia/avifile/files/extra-patch-include::aviplay.h b/multimedia/avifile/files/extra-patch-include::aviplay.h new file mode 100644 index 000000000000..b2894f4f3d84 --- /dev/null +++ b/multimedia/avifile/files/extra-patch-include::aviplay.h @@ -0,0 +1,13 @@ +--- include/aviplay.h.orig Fri Aug 6 12:35:41 2004 ++++ include/aviplay.h Fri Aug 6 12:36:36 2004 +@@ -12,8 +12,8 @@ + #include "image.h" + #include "avm_args.h" + +-typedef void (*KILLHANDLER)(int, void* p = 0); +-typedef int (*AUDIOFUNC)(void* srcdata, unsigned int size, void* p = 0); ++typedef void (*KILLHANDLER)(int, void* p); ++typedef int (*AUDIOFUNC)(void* srcdata, unsigned int size, void* p); + + AVM_BEGIN_NAMESPACE; + diff --git a/multimedia/avifile/files/extra-patch-include::avm_map.h b/multimedia/avifile/files/extra-patch-include::avm_map.h new file mode 100644 index 000000000000..521dc866da7f --- /dev/null +++ b/multimedia/avifile/files/extra-patch-include::avm_map.h @@ -0,0 +1,12 @@ +--- include/avm_map.h.orig Fri Aug 6 12:35:41 2004 ++++ include/avm_map.h Fri Aug 6 12:37:10 2004 +@@ -198,7 +198,8 @@ + { + // cast to the needed type - used to prevent internal compiler error + // for old egcc +- avm_map::_Tnode* node = (avm_map::_Tnode*) n; ++ //avm_map::_Tnode* node = (avm_map::_Tnode*) n; ++ _Tnode* node = (_Tnode*) n; + + if(node->entry) + { diff --git a/multimedia/avifile/files/extra-patch-include::avm_stl.h b/multimedia/avifile/files/extra-patch-include::avm_stl.h new file mode 100644 index 000000000000..bc54511d2072 --- /dev/null +++ b/multimedia/avifile/files/extra-patch-include::avm_stl.h @@ -0,0 +1,61 @@ +--- include/avm_stl.h.orig Fri Aug 6 12:35:41 2004 ++++ include/avm_stl.h Fri Aug 6 12:41:47 2004 +@@ -74,6 +74,10 @@ + m_Type = new Type[m_uiCapacity]; + } + ~qring() { delete[] m_Type; } ++ qring(const qring& t) : m_Type(0) ++ { ++ operator=(t); ++ } + qring& operator=(const qring& t) + { + if (this != &t) +@@ -149,7 +153,6 @@ + + // disabled for now + qring() {} +- qring(const qring& t) {} + + uint_t bpos() const { return (m_uiPos > 0) ? m_uiPos - 1 : m_uiCapacity - 1; } + uint_t fpos() const { return (m_uiSize > m_uiPos) ? m_uiPos + m_uiCapacity - m_uiSize: m_uiPos - m_uiSize; } +@@ -167,9 +170,21 @@ + static const uint_t invalid=(uint_t)(~0); + typedef Type* iterator; + typedef const Type* const_iterator; +- vector(int prealloc = 0); ++ vector() ++ :m_Type(0), m_uiCapacity(0), m_uiSize(0) ++ { ++ } ++ ++ vector(int prealloc) ++ :m_Type(0), m_uiCapacity(prealloc), m_uiSize(prealloc) ++ { ++ if (m_uiCapacity > 0 ) ++ m_Type = new Type[m_uiCapacity]; ++ //printf("vector %p (%d)\n", this, m_uiSize); ++ } ++ + // we will not count references - we have to program with this in mind! +- vector(const vector& t) :m_Type(0), m_uiCapacity(0), m_uiSize(0) ++ vector(const vector& t) :m_Type(0) + { + operator=(t); + } +@@ -270,15 +285,6 @@ + uint_t m_uiSize; + void copy(const Type* in, uint_t size, uint_t alloc); + }; +- +-template +-vector::vector(int prealloc) +- :m_Type(0), m_uiCapacity(prealloc), m_uiSize(prealloc) +-{ +- if (m_uiCapacity > 0 ) +- m_Type = new Type[m_uiCapacity]; +- //printf("vector %p (%d)\n", this, m_uiSize); +-} + + template + void vector::remove(const Type& t) diff --git a/multimedia/avifile/files/extra-patch-lib::aviread::AsfNetworkInputStream.cpp b/multimedia/avifile/files/extra-patch-lib::aviread::AsfNetworkInputStream.cpp new file mode 100644 index 000000000000..cabd09eac7f5 --- /dev/null +++ b/multimedia/avifile/files/extra-patch-lib::aviread::AsfNetworkInputStream.cpp @@ -0,0 +1,39 @@ +--- lib/aviread/AsfNetworkInputStream.cpp.orig Fri Aug 6 12:35:40 2004 ++++ lib/aviread/AsfNetworkInputStream.cpp Fri Aug 6 12:46:32 2004 +@@ -793,22 +793,24 @@ + return -1; + } + +-int AsfNetworkInputStream::write(const void* buffer, uint_t size) ++int AsfNetworkInputStream::write(const void* b, uint_t size) + { ++ const char* buffer = (const char*) b; + int wsize = size; + while (wsize > 0) + { + int i = ::write(m_iSocket, buffer, wsize); + if (i <= 0) + return i; +- (const char*)buffer += i; ++ buffer += i; + wsize -= i; + } + return size; + } + +-int AsfNetworkInputStream::dwrite(const void* buffer, uint_t size) ++int AsfNetworkInputStream::dwrite(const void* b, uint_t size) + { ++ const char* buffer = (const char*) b; + if (m_lfd < 0) + { + if (m_lfd == -12345) +@@ -843,7 +845,7 @@ + int i = ::write(m_lfd, buffer, size); + if (i < 0) + return i; +- (const char*)buffer += i; ++ buffer += i; + size -= i; + } + fsync(m_lfd); diff --git a/multimedia/avifile/files/extra-patch-lib::common::image.cpp b/multimedia/avifile/files/extra-patch-lib::common::image.cpp new file mode 100644 index 000000000000..78fc2071406f --- /dev/null +++ b/multimedia/avifile/files/extra-patch-lib::common::image.cpp @@ -0,0 +1,11 @@ +--- lib/common/image.cpp.orig Fri Aug 6 12:35:40 2004 ++++ lib/common/image.cpp Fri Aug 6 12:47:59 2004 +@@ -954,7 +954,7 @@ + fillMembers(); + if (!copy) + { +- (const uint8_t*) m_pPlane[0] = data; ++ m_pPlane[0] = (uint8_t*) data; + } + else + { diff --git a/multimedia/avifile/files/extra-patch-plugins::libmp3lame_audioenc::lame3.70::quantize-pvt.c b/multimedia/avifile/files/extra-patch-plugins::libmp3lame_audioenc::lame3.70::quantize-pvt.c new file mode 100644 index 000000000000..cab500a52c3b --- /dev/null +++ b/multimedia/avifile/files/extra-patch-plugins::libmp3lame_audioenc::lame3.70::quantize-pvt.c @@ -0,0 +1,45 @@ +--- plugins/libmp3lame_audioenc/lame3.70/quantize-pvt.c.orig Fri Aug 6 13:59:16 2004 ++++ plugins/libmp3lame_audioenc/lame3.70/quantize-pvt.c Fri Aug 6 14:11:28 2004 +@@ -976,6 +976,7 @@ + { + int rx[4]; + __asm__ __volatile__( ++ "\n\npush %%edx\n\t" + "\n\nloop1:\n\t" + + "fld" F8type " 0(%1)\n\t" +@@ -1007,18 +1008,18 @@ + "dec %4\n\t" + + "movl %5, %%eax\n\t" +- "movl 4+%5, %%ebx\n\t" ++ "movl 4+%5, %%edx\n\t" + "fxch %%st(1)\n\t" + "fadd" F8type " (%2,%%eax," F8size ")\n\t" + "fxch %%st(3)\n\t" +- "fadd" F8type " (%2,%%ebx," F8size ")\n\t" ++ "fadd" F8type " (%2,%%edx," F8size ")\n\t" + + "movl 8+%5, %%eax\n\t" +- "movl 12+%5, %%ebx\n\t" ++ "movl 12+%5, %%edx\n\t" + "fxch %%st(2)\n\t" + "fadd" F8type " (%2,%%eax," F8size ")\n\t" + "fxch %%st(1)\n\t" +- "fadd" F8type " (%2,%%ebx," F8size ")\n\t" ++ "fadd" F8type " (%2,%%edx," F8size ")\n\t" + + "fxch %%st(3)\n\t" + "fistpl -16(%3)\n\t" +@@ -1028,9 +1029,10 @@ + "fistpl -4(%3)\n\t" + + "jnz loop1\n\n" ++ "pop %%edx\n\n" + : /* no outputs */ + : "t" (istep), "r" (xr), "r" (adj43asm), "r" (ix), "r" (576 / 4), "m" (rx) +- : "%eax", "%ebx", "memory", "cc" ++ : "%eax", "memory", "cc" + ); + } + #elif defined (USE_MSC_ASM) diff --git a/multimedia/avifile/files/extra-patch-plugins::libvorbis::libvorbis.cpp b/multimedia/avifile/files/extra-patch-plugins::libvorbis::libvorbis.cpp new file mode 100644 index 000000000000..ab93f1242631 --- /dev/null +++ b/multimedia/avifile/files/extra-patch-plugins::libvorbis::libvorbis.cpp @@ -0,0 +1,29 @@ +--- plugins/libvorbis/libvorbis.cpp.orig Fri Aug 6 12:35:41 2004 ++++ plugins/libvorbis/libvorbis.cpp Fri Aug 6 12:49:27 2004 +@@ -96,7 +96,7 @@ + op.packet = NULL; + op.b_o_s = 1; /* beginning of stream for first packet */ + op.bytes = hdrsizes[0]; +- (const void*) op.packet = vorbishdr; ++ op.packet = (unsigned char*) vorbishdr; + vorbishdr += op.bytes; + if (vorbis_synthesis_headerin(&vi, &vc, &op) < 0) + { +@@ -106,7 +106,7 @@ + + op.b_o_s = 0; + op.bytes = hdrsizes[1]; +- (const void*) op.packet = vorbishdr; ++ op.packet = (unsigned char*) vorbishdr; + vorbishdr += op.bytes; + if (vorbis_synthesis_headerin(&vi, &vc, &op) < 0) + { +@@ -115,7 +115,7 @@ + } + + op.bytes = hdrsizes[2]; +- (const void*) op.packet = vorbishdr; ++ op.packet = (unsigned char*) vorbishdr; + vorbishdr += op.bytes; + if (vorbis_synthesis_headerin(&vi, &vc, &op) < 0) + { -- cgit v1.2.3