[xiph-commits] r13629 - in trunk/vorbis: . lib

erikd at svn.xiph.org erikd at svn.xiph.org
Sat Aug 25 17:24:58 PDT 2007


Author: erikd
Date: 2007-08-25 17:24:57 -0700 (Sat, 25 Aug 2007)
New Revision: 13629

Modified:
   trunk/vorbis/configure.in
   trunk/vorbis/lib/scales.h
Log:
Detect availability of C99 inline keyword in configure and use it in lib/scales.h. Also add workaround for MSVS which uses __inline.

Modified: trunk/vorbis/configure.in
===================================================================
--- trunk/vorbis/configure.in	2007-08-25 16:04:33 UTC (rev 13628)
+++ trunk/vorbis/configure.in	2007-08-26 00:24:57 UTC (rev 13629)
@@ -46,6 +46,8 @@
 AC_PROG_CPP
 CFLAGS="$cflags_save"
 
+AC_C_INLINE
+
 AM_PROG_LIBTOOL
 
 dnl docbook xml transform and processing tools
@@ -103,10 +105,10 @@
 	AC_MSG_RESULT([$GCC_VERSION])
 	case $host in 
 	*86-*-linux*)
-		DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
+		DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
 		CFLAGS="-O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
-#              	PROFILE="-Wall -W -pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
-		PROFILE="-Wall -W -pg -g -O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline"
+#              	PROFILE="-Wall -Wextra -pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
+		PROFILE="-Wall -Wextra -pg -g -O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline"
 
 		# glibc < 2.1.3 has a serious FP bug in the math inline header
 		# that will cripple Vorbis.  Look to see if the magic FP stack
@@ -148,24 +150,24 @@
   		PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
   		fi;;
 	powerpc-*-linux*)
-		DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES"
-		CFLAGS="-O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT"
+		DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES"
+		CFLAGS="-O3 -Wall -Wextra -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT"
 		PROFILE="-pg -g -O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT";;
 	*-*-linux*)
-		DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
-		CFLAGS="-O20 -ffast-math -D_REENTRANT -fsigned-char"
+		DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
+		CFLAGS="-O20 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char"
 		PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
 	sparc-sun-*)
-		DEBUG="-g -Wall -W -D__NO_MATH_INLINES -fsigned-char -mv8"
-		CFLAGS="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
+		DEBUG="-g -Wall -Wextra -D__NO_MATH_INLINES -fsigned-char -mv8"
+		CFLAGS="-O20 -Wall -Wextra -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
 		PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
 	*-*-darwin*)
 		DEBUG="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O0 -fsigned-char"
 		CFLAGS="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O4 -ffast-math -fsigned-char"
 		PROFILE="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -pg -O4 -ffast-math -fsigned-char";;
 	*)
-		DEBUG="-g -Wall -W -D__NO_MATH_INLINES -fsigned-char"
-		CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char"
+		DEBUG="-g -Wall -Wextra -D__NO_MATH_INLINES -fsigned-char"
+		CFLAGS="-O20 -Wall -Wextra -D__NO_MATH_INLINES -fsigned-char"
 		PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
         esac
 fi

Modified: trunk/vorbis/lib/scales.h
===================================================================
--- trunk/vorbis/lib/scales.h	2007-08-25 16:04:33 UTC (rev 13628)
+++ trunk/vorbis/lib/scales.h	2007-08-26 00:24:57 UTC (rev 13629)
@@ -21,11 +21,16 @@
 #include <math.h>
 #include "os.h"
 
+#ifdef _MSC_VER
+/* MS Visual Studio doesn't have C99 inline keyword. */
+#define inline __inline
+#endif
+
 /* 20log10(x) */
 #define VORBIS_IEEE_FLOAT32 1
 #ifdef VORBIS_IEEE_FLOAT32
 
-static float unitnorm(float x){
+static inline float unitnorm(float x){
   union {
     ogg_uint32_t i;
     float f;
@@ -36,7 +41,7 @@
 }
 
 /* Segher was off (too high) by ~ .3 decibel.  Center the conversion correctly. */
-static float todB(const float *x){
+static inline float todB(const float *x){
   union {
     ogg_uint32_t i;
     float f;



More information about the commits mailing list