[Ffmpeg-cvslog] r7025 - in trunk: configure libavutil/mem.c

mru subversion
Tue Nov 14 01:35:22 CET 2006


Author: mru
Date: Tue Nov 14 01:35:21 2006
New Revision: 7025

Modified:
   trunk/configure
   trunk/libavutil/mem.c

Log:
rename MEMALIGN_HACK to CONFIG_MEMALIGN_HACK, use common code in configure


Modified: trunk/configure
==============================================================================
--- trunk/configure	(original)
+++ trunk/configure	Tue Nov 14 01:35:21 2006
@@ -353,7 +353,7 @@
     check_lib $header $func "$@" || die "ERROR: $name not found"
 }
 
-CONFIG_LIST='encoders decoders parsers muxers demuxers a52 a52bin amr amr_nb amr_nb_fixed amr_wb audio_beos audio_oss avisynth beos_netserver bktr dc1394 dts dv1394 faac faad faadbin ffmpeg ffplay ffserver gpl ipv6 libgsm libnut libogg libvorbis mp3lame mpegaudio_hp network pp protocols swscaler vhook video4linux video4linux2 x264 xvid zlib'
+CONFIG_LIST='encoders decoders parsers muxers demuxers a52 a52bin amr amr_nb amr_nb_fixed amr_wb audio_beos audio_oss avisynth beos_netserver bktr dc1394 dts dv1394 faac faad faadbin ffmpeg ffplay ffserver gpl ipv6 libgsm libnut libogg libvorbis memalign_hack mp3lame mpegaudio_hp network pp protocols swscaler vhook video4linux video4linux2 x264 xvid zlib'
 
 HAVE_LIST='altivec_h byteswap_h dcbzl dlfcn dlopen freetype2 gprof imlib2 localtime_r lrintf malloc_h memalign mlib sdl sdl_video_size'
 
@@ -528,7 +528,7 @@
 pthreads="no"
 swscaler="no"
 gpl="no"
-memalignhack="no"
+memalign_hack="no"
 asmalign_pot="unknown"
 LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
 
@@ -888,7 +888,7 @@
   ;;
   --enable-gpl) gpl="yes"
   ;;
-  --enable-memalign-hack) memalignhack="yes"
+  --enable-memalign-hack) memalign_hack="yes"
   ;;
   --disable-strip) dostrip="no"
   ;;
@@ -1341,7 +1341,7 @@
 fi
 
 if test "$memalign" = "no" -a "$mmx" = "yes" -a \
-        "$memalignhack" != "yes" -a "$targetos" != "Darwin" -a \
+        "$memalign_hack" != "yes" -a "$targetos" != "Darwin" -a \
         "$targetos" != "FreeBSD" ; then
     die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
 fi
@@ -1936,10 +1936,6 @@
   echo "CONFIG_DARWIN=yes" >> config.mak
 fi
 
-if test "$memalignhack" = "yes" ; then
-  echo "#define MEMALIGN_HACK 1" >> $TMPH
-fi
-
 if test "$need_inet_aton" = "yes" ; then
   echo "NEED_INET_ATON=yes" >> config.mak
 fi

Modified: trunk/libavutil/mem.c
==============================================================================
--- trunk/libavutil/mem.c	(original)
+++ trunk/libavutil/mem.c	Tue Nov 14 01:35:21 2006
@@ -47,7 +47,7 @@
 void *av_malloc(unsigned int size)
 {
     void *ptr;
-#ifdef MEMALIGN_HACK
+#ifdef CONFIG_MEMALIGN_HACK
     long diff;
 #endif
 
@@ -55,7 +55,7 @@
     if(size > (INT_MAX-16) )
         return NULL;
 
-#ifdef MEMALIGN_HACK
+#ifdef CONFIG_MEMALIGN_HACK
     ptr = malloc(size+16);
     if(!ptr)
         return ptr;
@@ -103,7 +103,7 @@
  */
 void *av_realloc(void *ptr, unsigned int size)
 {
-#ifdef MEMALIGN_HACK
+#ifdef CONFIG_MEMALIGN_HACK
     int diff;
 #endif
 
@@ -111,7 +111,7 @@
     if(size > (INT_MAX-16) )
         return NULL;
 
-#ifdef MEMALIGN_HACK
+#ifdef CONFIG_MEMALIGN_HACK
     //FIXME this isn't aligned correctly, though it probably isn't needed
     if(!ptr) return av_malloc(size);
     diff= ((char*)ptr)[-1];
@@ -130,7 +130,7 @@
 {
     /* XXX: this test should not be needed on most libcs */
     if (ptr)
-#ifdef MEMALIGN_HACK
+#ifdef CONFIG_MEMALIGN_HACK
         free(ptr - ((char*)ptr)[-1]);
 #else
         free(ptr);




More information about the ffmpeg-cvslog mailing list