autoconf changes to handle looking for bit-width types on yet more
authorMonty <xiphmont@xiph.org>
Wed, 30 Aug 2000 06:09:22 +0000 (06:09 +0000)
committerMonty <xiphmont@xiph.org>
Wed, 30 Aug 2000 06:09:22 +0000 (06:09 +0000)
platforms without barfing.  Cleaner than before, hopefully works
better too.

Monty

svn path=/trunk/vorbis/; revision=605

configure
configure.in
examples/decoder_example.c
include/vorbis/codec.h
include/vorbis/os_types.h.in [moved from include/vorbis/os_types.h with 68% similarity]
include/vorbis/vorbisfile.h
lib/Makefile.in
lib/framing.c
lib/vorbisfile.c

index 5d0e715..bacf6d0 100755 (executable)
--- a/configure
+++ b/configure
@@ -1176,16 +1176,13 @@ rm -f conftest*
         esac
 fi
 
-subdirs="vorbis-tools/libao"
-
-
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1184: checking for ANSI C header files" >&5
+echo "configure:1181: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1189 "configure"
+#line 1186 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1193,7 +1190,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1210,7 +1207,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1214 "configure"
+#line 1211 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1228,7 +1225,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1232 "configure"
+#line 1229 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1249,7 +1246,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1253 "configure"
+#line 1250 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1260,7 +1257,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1291,7 +1288,7 @@ CFLAGS=""
 #      pthread_lib="-lpthread"; AC_DEFINE(HAVE_LIBPTHREAD), :)
 # We no longer use config.h
 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:1295: checking for pthread_create in -lpthread" >&5
+echo "configure:1292: checking for pthread_create in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1299,7 +1296,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1303 "configure"
+#line 1300 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1310,7 +1307,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:1314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1375,8 +1372,201 @@ dummy="__noconf"
 #      X_LIBS="-L${srcdir}/libgtk/gtk/.libs -L${srcdir}/libgtk/gdk/.libs -L${srcdir}/libgtk/glib/.libs $X_LIBS"
 #fi
 
+# check macro modified from Jon Shiring's to compensate for autoconf's lagging
+# behind the times on type madness
+
+echo $ac_n "checking for int16_t""... $ac_c" 1>&6
+echo "configure:1380: checking for int16_t" >&5
+if eval "test \"`echo '$''{'has_int16_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  has_int16_t=no
+
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1389 "configure"
+#include "confdefs.h"
+
+#ifdef __BEOS__
+#include <inttypes.h>
+#else
+#include <sys/types.h>
+#endif
+int16_t foo;
+int main() {return 0;}
+
+EOF
+if { (eval echo configure:1401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  has_int16_t=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  has_int16_t=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$has_int16_t" 1>&6
+
+echo $ac_n "checking for int32_t""... $ac_c" 1>&6
+echo "configure:1418: checking for int32_t" >&5
+if eval "test \"`echo '$''{'has_int32_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  has_int32_t=no
+
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1427 "configure"
+#include "confdefs.h"
+
+#ifdef __BEOS__
+#include <inttypes.h>
+#else
+#include <sys/types.h>
+#endif
+int32_t foo;
+int main() {return 0;}
+
+EOF
+if { (eval echo configure:1439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  has_int32_t=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  has_int32_t=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$has_int32_t" 1>&6
+
+echo $ac_n "checking for uint32_t""... $ac_c" 1>&6
+echo "configure:1456: checking for uint32_t" >&5
+if eval "test \"`echo '$''{'has_uint32_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  has_uint32_t=no
+
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1465 "configure"
+#include "confdefs.h"
+
+#ifdef __BEOS__
+#include <inttypes.h>
+#else
+#include <sys/types.h>
+#endif
+uint32_t foo;
+int main() {return 0;}
+
+EOF
+if { (eval echo configure:1477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  has_uint32_t=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  has_uint32_t=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$has_uint32_t" 1>&6
+
+echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6
+echo "configure:1494: checking for u_int32_t" >&5
+if eval "test \"`echo '$''{'has_u_int32_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  has_u_int32_t=no
+
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1503 "configure"
+#include "confdefs.h"
+
+#ifdef __BEOS__
+#include <inttypes.h>
+#else
+#include <sys/types.h>
+#endif
+u_int32_t foo;
+int main() {return 0;}
+
+EOF
+if { (eval echo configure:1515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  has_u_int32_t=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  has_u_int32_t=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$has_u_int32_t" 1>&6
+
+echo $ac_n "checking for int64_t""... $ac_c" 1>&6
+echo "configure:1532: checking for int64_t" >&5
+if eval "test \"`echo '$''{'has_int64_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  has_int64_t=no
+
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1541 "configure"
+#include "confdefs.h"
+
+#ifdef __BEOS__
+#include <inttypes.h>
+#else
+#include <sys/types.h>
+#endif
+int64_t foo;
+int main() {return 0;}
+
+EOF
+if { (eval echo configure:1553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  has_int64_t=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  has_int64_t=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$has_int64_t" 1>&6
+
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1380: checking size of short" >&5
+echo "configure:1570: checking size of short" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1384,7 +1574,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1388 "configure"
+#line 1578 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1395,7 +1585,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:1399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -1415,7 +1605,7 @@ EOF
 
 
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1419: checking size of int" >&5
+echo "configure:1609: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1423,7 +1613,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1427 "configure"
+#line 1617 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1434,7 +1624,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:1438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -1454,7 +1644,7 @@ EOF
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1458: checking size of long" >&5
+echo "configure:1648: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1462,7 +1652,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1466 "configure"
+#line 1656 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1473,7 +1663,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:1477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -1493,7 +1683,7 @@ EOF
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:1497: checking size of long long" >&5
+echo "configure:1687: checking size of long long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1501,7 +1691,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1505 "configure"
+#line 1695 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1512,7 +1702,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:1516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long_long=`cat conftestval`
 else
@@ -1532,22 +1722,49 @@ EOF
 
 
 
-case 2 in
-       $ac_cv_sizeof_short) SIZE16="short";;
-       $ac_cv_sizeof_int) SIZE16="int";;
-esac
 
-case 4 in
-       $ac_cv_sizeof_short) SIZE32="short";;
-       $ac_cv_sizeof_int) SIZE32="int";;
-       $ac_cv_sizeof_long) SIZE32="long";;
-esac
+if test x$has_int16_t = "xyes" ; then
+       SIZE16="int16_t"
+else
+       case 2 in
+               $ac_cv_sizeof_short) SIZE16="short";;
+               $ac_cv_sizeof_int) SIZE16="int";;
+       esac
+fi
+
+if test x$has_int32_t = "xyes" ; then
+       SIZE32="int32_t"
+else
+       case 4 in
+               $ac_cv_sizeof_short) SIZE32="short";;
+               $ac_cv_sizeof_int) SIZE32="int";;
+               $ac_cv_sizeof_long) SIZE32="long";;
+       esac
+fi
+
+if test x$has_uint32_t = "xyes" ; then
+       USIZE32="uint32_t"
+else
+       if test x$has_u_int32_t = "xyes" ; then
+               USIZE32="u_int32_t"
+       else
+               case 4 in
+                       $ac_cv_sizeof_short) USIZE32="unsigned short";;
+                       $ac_cv_sizeof_int) USIZE32="unsigned int";;
+                       $ac_cv_sizeof_long) USIZE32="unsigned long";;
+               esac
+       fi
+fi
 
+if test x$has_int64_t = "xyes" ; then
+       SIZE64="int64_t"
+else
 case 8 in
        $ac_cv_sizeof_int) SIZE64="int";;
        $ac_cv_sizeof_long) SIZE64="long";;
        $ac_cv_sizeof_long_long) SIZE64="long long";;
 esac
+fi
 
 if test -z "$SIZE16"; then
        { echo "configure: error: No 16 bit type found on this platform!" 1>&2; exit 1; }
@@ -1555,6 +1772,9 @@ fi
 if test -z "$SIZE32"; then
        { echo "configure: error: No 32 bit type found on this platform!" 1>&2; exit 1; }
 fi
+if test -z "$USIZE32"; then
+       { echo "configure: error: No unsigned 32 bit type found on this platform!" 1>&2; exit 1; }
+fi
 if test -z "$SIZE64"; then
        echo "configure: warning: No 64 bit type found on this platform!" 1>&2
 fi
@@ -1564,17 +1784,17 @@ fi
 # We no longer use config.h
 ac_safe=`echo "alloca.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for alloca.h""... $ac_c" 1>&6
-echo "configure:1568: checking for alloca.h" >&5
+echo "configure:1788: checking for alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1573 "configure"
+#line 1793 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1598,17 +1818,17 @@ fi
 
 ac_safe=`echo "memory.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for memory.h""... $ac_c" 1>&6
-echo "configure:1602: checking for memory.h" >&5
+echo "configure:1822: checking for memory.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1607 "configure"
+#line 1827 "configure"
 #include "confdefs.h"
 #include <memory.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1632,12 +1852,12 @@ fi
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1636: checking for working const" >&5
+echo "configure:1856: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1641 "configure"
+#line 1861 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1686,7 +1906,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1910: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1707,12 +1927,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1711: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1931: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1716 "configure"
+#line 1936 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -1721,7 +1941,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:1725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -1742,12 +1962,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1746: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:1966: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1751 "configure"
+#line 1971 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -1755,7 +1975,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:1759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1979: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -1777,7 +1997,7 @@ fi
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1781: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:2001: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1804,7 +2024,7 @@ else
 fi
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:1808: checking for 8-bit clean memcmp" >&5
+echo "configure:2028: checking for 8-bit clean memcmp" >&5
 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1812,7 +2032,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 1816 "configure"
+#line 2036 "configure"
 #include "confdefs.h"
 
 main()
@@ -1822,7 +2042,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_memcmp_clean=yes
 else
@@ -1840,12 +2060,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1844: checking return type of signal handlers" >&5
+echo "configure:2064: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1849 "configure"
+#line 2069 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -1862,7 +2082,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:1866: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -1883,12 +2103,12 @@ EOF
 for ac_func in gettimeofday select strcspn strerror strspn sigaction
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1887: checking for $ac_func" >&5
+echo "configure:2107: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1892 "configure"
+#line 2112 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1911,7 +2131,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1945,10 +2165,14 @@ done
 
 
 
+
 #AC_SUBST(XOGG)
 #AC_SUBST(LIBGTKDIR)
 
 
+subdirs="vorbis-tools/libao"
+
+
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
@@ -2061,9 +2285,9 @@ done
 
 ac_given_srcdir=$srcdir
 
-trap 'rm -fr `echo "Makefile lib/Makefile examples/Makefile vorbis-tools/Makefile\
-       vorbis-tools/libao/Makefile vq/Makefile huff/Makefile cmdline/Makefile\
-       xmms/Makefile kmpg/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile lib/Makefile examples/Makefile include/vorbis/os_types.h\
+       vorbis-tools/Makefile\
+       vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -2105,16 +2329,17 @@ s%@CPP@%$CPP%g
 s%@RANLIB@%$RANLIB%g
 s%@AR@%$AR%g
 s%@INSTALL@%$INSTALL%g
-s%@subdirs@%$subdirs%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@LIBOBJS@%$LIBOBJS%g
 s%@SIZE16@%$SIZE16%g
 s%@SIZE32@%$SIZE32%g
+s%@USIZE32@%$USIZE32%g
 s%@SIZE64@%$SIZE64%g
 s%@OPT@%$OPT%g
 s%@DEBUG@%$DEBUG%g
 s%@PROFILE@%$PROFILE%g
 s%@pthread_lib@%$pthread_lib%g
+s%@subdirs@%$subdirs%g
 
 CEOF
 EOF
@@ -2156,9 +2381,9 @@ EOF
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"Makefile lib/Makefile examples/Makefile vorbis-tools/Makefile\
-       vorbis-tools/libao/Makefile vq/Makefile huff/Makefile cmdline/Makefile\
-       xmms/Makefile kmpg/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile lib/Makefile examples/Makefile include/vorbis/os_types.h\
+       vorbis-tools/Makefile\
+       vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
index 7927d1d..cd7d155 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.20 2000/08/15 09:09:31 xiphmont Exp $
+# $Id: configure.in,v 1.21 2000/08/30 06:09:21 xiphmont Exp $
 
 AC_INIT(lib/mdct.c)
 #AC_CONFIG_HEADER(config.h)
@@ -176,27 +176,142 @@ dummy="__noconf"
 #      X_LIBS="-L${srcdir}/libgtk/gtk/.libs -L${srcdir}/libgtk/gdk/.libs -L${srcdir}/libgtk/glib/.libs $X_LIBS"
 #fi
 
+# check macro modified from Jon Shiring's to compensate for autoconf's lagging
+# behind the times on type madness
+
+AC_MSG_CHECKING(for int16_t)
+AC_CACHE_VAL(has_int16_t,
+[AC_TRY_RUN([
+#ifdef __BEOS__
+#include <inttypes.h>
+#else
+#include <sys/types.h>
+#endif
+int16_t foo;
+int main() {return 0;}
+],
+has_int16_t=yes,
+has_int16_t=no,
+has_int16_t=no
+)])
+AC_MSG_RESULT($has_int16_t)
+
+AC_MSG_CHECKING(for int32_t)
+AC_CACHE_VAL(has_int32_t,
+[AC_TRY_RUN([
+#ifdef __BEOS__
+#include <inttypes.h>
+#else
+#include <sys/types.h>
+#endif
+int32_t foo;
+int main() {return 0;}
+],
+has_int32_t=yes,
+has_int32_t=no,
+has_int32_t=no
+)])
+AC_MSG_RESULT($has_int32_t)
+
+AC_MSG_CHECKING(for uint32_t)
+AC_CACHE_VAL(has_uint32_t,
+[AC_TRY_RUN([
+#ifdef __BEOS__
+#include <inttypes.h>
+#else
+#include <sys/types.h>
+#endif
+uint32_t foo;
+int main() {return 0;}
+],
+has_uint32_t=yes,
+has_uint32_t=no,
+has_uint32_t=no
+)])
+AC_MSG_RESULT($has_uint32_t)
+
+AC_MSG_CHECKING(for u_int32_t)
+AC_CACHE_VAL(has_u_int32_t,
+[AC_TRY_RUN([
+#ifdef __BEOS__
+#include <inttypes.h>
+#else
+#include <sys/types.h>
+#endif
+u_int32_t foo;
+int main() {return 0;}
+],
+has_u_int32_t=yes,
+has_u_int32_t=no,
+has_u_int32_t=no
+)])
+AC_MSG_RESULT($has_u_int32_t)
+
+AC_MSG_CHECKING(for int64_t)
+AC_CACHE_VAL(has_int64_t,
+[AC_TRY_RUN([
+#ifdef __BEOS__
+#include <inttypes.h>
+#else
+#include <sys/types.h>
+#endif
+int64_t foo;
+int main() {return 0;}
+],
+has_int64_t=yes,
+has_int64_t=no,
+has_int64_t=no
+)])
+AC_MSG_RESULT($has_int64_t)
+
 AC_CHECK_SIZEOF(short)
 AC_CHECK_SIZEOF(int)
 AC_CHECK_SIZEOF(long)
 AC_CHECK_SIZEOF(long long)
 
-case 2 in
-       $ac_cv_sizeof_short) SIZE16="short";;
-       $ac_cv_sizeof_int) SIZE16="int";;
-esac
 
-case 4 in
-       $ac_cv_sizeof_short) SIZE32="short";;
-       $ac_cv_sizeof_int) SIZE32="int";;
-       $ac_cv_sizeof_long) SIZE32="long";;
-esac
+if test x$has_int16_t = "xyes" ; then
+       SIZE16="int16_t"
+else
+       case 2 in
+               $ac_cv_sizeof_short) SIZE16="short";;
+               $ac_cv_sizeof_int) SIZE16="int";;
+       esac
+fi
 
+if test x$has_int32_t = "xyes" ; then
+       SIZE32="int32_t"
+else
+       case 4 in
+               $ac_cv_sizeof_short) SIZE32="short";;
+               $ac_cv_sizeof_int) SIZE32="int";;
+               $ac_cv_sizeof_long) SIZE32="long";;
+       esac
+fi
+
+if test x$has_uint32_t = "xyes" ; then
+       USIZE32="uint32_t"
+else
+       if test x$has_u_int32_t = "xyes" ; then
+               USIZE32="u_int32_t"
+       else
+               case 4 in
+                       $ac_cv_sizeof_short) USIZE32="unsigned short";;
+                       $ac_cv_sizeof_int) USIZE32="unsigned int";;
+                       $ac_cv_sizeof_long) USIZE32="unsigned long";;
+               esac
+       fi
+fi
+
+if test x$has_int64_t = "xyes" ; then
+       SIZE64="int64_t"
+else
 case 8 in
        $ac_cv_sizeof_int) SIZE64="int";;
        $ac_cv_sizeof_long) SIZE64="long";;
        $ac_cv_sizeof_long_long) SIZE64="long long";;
 esac
+fi
 
 if test -z "$SIZE16"; then
        AC_MSG_ERROR(No 16 bit type found on this platform!)
@@ -204,6 +319,9 @@ fi
 if test -z "$SIZE32"; then
        AC_MSG_ERROR(No 32 bit type found on this platform!)
 fi
+if test -z "$USIZE32"; then
+       AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
+fi
 if test -z "$SIZE64"; then
        AC_MSG_WARN(No 64 bit type found on this platform!)
 fi
@@ -225,6 +343,7 @@ AC_CHECK_FUNCS(gettimeofday select strcspn strerror strspn sigaction)
 
 AC_SUBST(SIZE16)
 AC_SUBST(SIZE32)
+AC_SUBST(USIZE32)
 AC_SUBST(SIZE64)
 AC_SUBST(OPT)
 AC_SUBST(LIBS)
@@ -238,6 +357,7 @@ AC_SUBST(pthread_lib)
 
 AC_CONFIG_SUBDIRS(vorbis-tools/libao)
 
-AC_OUTPUT(Makefile lib/Makefile examples/Makefile vorbis-tools/Makefile\
+AC_OUTPUT(Makefile lib/Makefile examples/Makefile include/vorbis/os_types.h\
+       vorbis-tools/Makefile\
        vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile)
 
index 4fb5a64..a8b6a19 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: simple example decoder
- last mod: $Id: decoder_example.c,v 1.11 2000/08/15 01:05:26 xiphmont Exp $
+ last mod: $Id: decoder_example.c,v 1.12 2000/08/30 06:09:21 xiphmont Exp $
 
  ********************************************************************/
 
@@ -36,7 +36,7 @@
 #include <console.h>      /* CodeWarrior's Mac "command-line" support */
 #endif
 
-int16_t convbuffer[4096]; /* take 8k out of the data segment, not the stack */
+ogg_int16_t convbuffer[4096]; /* take 8k out of the data segment, not the stack */
 int convsize=4096;
 
 int main(int argc, char **argv){
@@ -236,7 +236,7 @@ int main(int argc, char **argv){
                /* convert doubles to 16 bit signed ints (host order) and
                   interleave */
                for(i=0;i<vi.channels;i++){
-                 int16_t *ptr=convbuffer+i;
+                 ogg_int16_t *ptr=convbuffer+i;
                  double  *mono=pcm[i];
                  for(j=0;j<bout;j++){
                    int val=mono[j]*32767.;
index 4ab1c38..ff2f31f 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: libvorbis codec headers
- last mod: $Id: codec.h,v 1.27 2000/08/23 10:27:14 xiphmont Exp $
+ last mod: $Id: codec.h,v 1.28 2000/08/30 06:09:21 xiphmont Exp $
 
  ********************************************************************/
 
@@ -171,7 +171,7 @@ typedef struct {
 
 
   int     *lacing_vals;    /* The values that will go to the segment table */
-  int64_t *pcm_vals;      /* pcm_pos values for headers. Not compact
+  ogg_int64_t *pcm_vals;      /* pcm_pos values for headers. Not compact
                             this way, but it is simple coupled to the
                             lacing fifo */
   long    lacing_storage;
@@ -188,12 +188,12 @@ typedef struct {
                             of a logical bitstream */
   long     serialno;
   int      pageno;
-  int64_t  packetno;      /* sequence number for decode; the framing
+  ogg_int64_t  packetno;      /* sequence number for decode; the framing
                              knows where there's a hole in the data,
                              but we need coupling so that the codec
                              (which is in a seperate abstraction
                              layer) also knows about the gap */
-  int64_t   pcmpos;
+  ogg_int64_t   pcmpos;
 
 } ogg_stream_state;
 
@@ -206,8 +206,8 @@ typedef struct {
   long  b_o_s;
   long  e_o_s;
 
-  int64_t  frameno;
-  int64_t  packetno;       /* sequence number for decode; the framing
+  ogg_int64_t  frameno;
+  ogg_int64_t  packetno;       /* sequence number for decode; the framing
                              knows where there's a hole in the data,
                              but we need coupling so that the codec
                              (which is in a seperate abstraction
@@ -248,13 +248,13 @@ typedef struct vorbis_dsp_state{
   long nW;
   long centerW;
 
-  int64_t frameno;
-  int64_t sequence;
+  ogg_int64_t frameno;
+  ogg_int64_t sequence;
 
-  int64_t glue_bits;
-  int64_t time_bits;
-  int64_t floor_bits;
-  int64_t res_bits;
+  ogg_int64_t glue_bits;
+  ogg_int64_t time_bits;
+  ogg_int64_t floor_bits;
+  ogg_int64_t res_bits;
 
   /* local lookup storage */
   void                   *ve; /* envelope lookup */    
@@ -296,8 +296,8 @@ typedef struct vorbis_block{
   int   mode;
 
   int eofflag;
-  int64_t frameno;
-  int64_t sequence;
+  ogg_int64_t frameno;
+  ogg_int64_t sequence;
   vorbis_dsp_state *vd; /* For read-only access of configuration */
 
   /* local storage to avoid remallocing; it's up to the mapping to
@@ -381,7 +381,7 @@ extern int      ogg_page_version(ogg_page *og);
 extern int      ogg_page_continued(ogg_page *og);
 extern int      ogg_page_bos(ogg_page *og);
 extern int      ogg_page_eos(ogg_page *og);
-extern int64_t  ogg_page_frameno(ogg_page *og);
+extern ogg_int64_t  ogg_page_frameno(ogg_page *og);
 extern int      ogg_page_serialno(ogg_page *og);
 extern int      ogg_page_pageno(ogg_page *og);
 
similarity index 68%
rename from include/vorbis/os_types.h
rename to include/vorbis/os_types.h.in
index 754bbda..cc7502e 100644 (file)
  ********************************************************************
 
  function: #ifdef jail to whip a few platforms into the UNIX ideal.
- last mod: $Id: os_types.h,v 1.7 2000/08/30 01:40:12 xiphmont Exp $
+ last mod: $Id: os_types.h.in,v 1.1 2000/08/30 06:09:21 xiphmont Exp $
 
  ********************************************************************/
 
 #if defined (_WIN32) 
 #if !defined(__GNUC__)
 
-typedef __int64 int64_t;
-typedef __int16 int16_t;
-#define vorbis_size32_t int
+/* MSVC/Borland */
+typedef __int64 ogg_int64_t;
+typedef __int32 ogg_int32_t;
+typedef unsigned __int32 ogg_int32_t;
+typedef __int16 ogg_int16_t;
+
 #else
+
+/* Cygwin */
 #include <_G_config.h>
-typedef _G_int64_t int64_t;
-typedef _G_int32_t int32_t;
-typedef _G_int16_t int16_t;
-#endif
+typedef _G_int64_t ogg_int64_t;
+typedef _G_int32_t ogg_int32_t;
+typedef unsigned _G_int32_t ogg_int32_t;
+typedef _G_int16_t ogg_int16_t;
 #endif
+#else
 
 #ifdef __BEOS__
+/* Be */
 #include <inttypes.h>
 #endif
 
+/* filled in by configure */
+typedef @SIZE16@ ogg_int16_t;
+typedef @SIZE32@ ogg_int32_t;
+typedef @USIZE32@ ogg_uint32_t;
+typedef @SIZE64@ ogg_int64_t;
+
+#endif
+
 #endif 
 
index 983c1ba..854972a 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: stdio-based convenience library for opening/seeking/decoding
- last mod: $Id: vorbisfile.h,v 1.6 2000/06/15 12:17:03 xiphmont Exp $
+ last mod: $Id: vorbisfile.h,v 1.7 2000/08/30 06:09:21 xiphmont Exp $
 
  ********************************************************************/
 
@@ -39,7 +39,7 @@ extern "C"
  */
 typedef struct {
   size_t (*read_func)  (void *ptr, size_t size, size_t nmemb, void *datasource);
-  int    (*seek_func)  (void *datasource, int64_t offset, int whence);
+  int    (*seek_func)  (void *datasource, ogg_int64_t offset, int whence);
   int    (*close_func) (void *datasource);
   long   (*tell_func)  (void *datasource);
 } ov_callbacks;
@@ -48,22 +48,22 @@ typedef struct {
 typedef struct {
   void             *datasource; /* Pointer to a FILE *, etc. */
   int              seekable;
-  int64_t          offset;
-  int64_t          end;
+  ogg_int64_t          offset;
+  ogg_int64_t          end;
   ogg_sync_state   oy; 
 
   /* If the FILE handle isn't seekable (eg, a pipe), only the current
      stream appears */
   int              links;
-  int64_t          *offsets;
-  int64_t          *dataoffsets;
+  ogg_int64_t          *offsets;
+  ogg_int64_t          *dataoffsets;
   long             *serialnos;
-  int64_t          *pcmlengths;
+  ogg_int64_t          *pcmlengths;
   vorbis_info      *vi;
   vorbis_comment   *vc;
 
   /* Decoding working state local storage */
-  int64_t          pcm_offset;
+  ogg_int64_t          pcm_offset;
   int              decode_ready;
   long             current_serialno;
   int              current_link;
@@ -91,16 +91,16 @@ extern long ov_streams(OggVorbis_File *vf);
 extern long ov_seekable(OggVorbis_File *vf);
 extern long ov_serialnumber(OggVorbis_File *vf,int i);
 
-extern int64_t ov_raw_total(OggVorbis_File *vf,int i);
-extern int64_t ov_pcm_total(OggVorbis_File *vf,int i);
+extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
+extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
 extern double ov_time_total(OggVorbis_File *vf,int i);
 
 extern int ov_raw_seek(OggVorbis_File *vf,long pos);
-extern int ov_pcm_seek(OggVorbis_File *vf,int64_t pos);
+extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
 extern int ov_time_seek(OggVorbis_File *vf,double pos);
 
-extern int64_t ov_raw_tell(OggVorbis_File *vf);
-extern int64_t ov_pcm_tell(OggVorbis_File *vf);
+extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf);
+extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);
 extern double ov_time_tell(OggVorbis_File *vf);
 
 extern vorbis_info *ov_info(OggVorbis_File *vf,int link);
index 9367bc3..160ae16 100644 (file)
@@ -1,5 +1,5 @@
 # vorbis makefile configured for use with gcc on any platform
-# $Id: Makefile.in,v 1.33 2000/07/12 09:36:17 xiphmont Exp $
+# $Id: Makefile.in,v 1.34 2000/08/30 06:09:21 xiphmont Exp $
 
 ###############################################################################
 #                                                                             #
@@ -15,7 +15,7 @@
 # (unless, of course, you know what you are doing :) ##########################
 
 @SET_MAKE@
-FLAGS=-I. -I../include @CFLAGS@ -Dvorbis_size32_t='@SIZE32@'
+FLAGS=-I. -I../include @CFLAGS@
 OPT=@OPT@ $(FLAGS)
 DEBUG=@DEBUG@ $(FLAGS)
 PROFILE=@PROFILE@ $(FLAGS)
index d53089d..152400b 100644 (file)
@@ -13,7 +13,7 @@
 
  function: code raw [Vorbis] packets into framed OggSquish stream and
            decode Ogg streams back into raw packets
- last mod: $Id: framing.c,v 1.24 2000/08/15 09:09:42 xiphmont Exp $
+ last mod: $Id: framing.c,v 1.25 2000/08/30 06:09:21 xiphmont Exp $
 
  note: The CRC code is directly derived from public domain code by
  Ross Williams (ross@guest.adelaide.edu.au).  See docs/framing.html
@@ -44,9 +44,9 @@ int ogg_page_eos(ogg_page *og){
   return((int)(og->header[5]&0x04));
 }
 
-int64_t ogg_page_frameno(ogg_page *og){
+ogg_int64_t ogg_page_frameno(ogg_page *og){
   unsigned char *page=og->header;
-  int64_t pcmpos=page[13]&(0xff);
+  ogg_int64_t pcmpos=page[13]&(0xff);
   pcmpos= (pcmpos<<8)|(page[12]&0xff);
   pcmpos= (pcmpos<<8)|(page[11]&0xff);
   pcmpos= (pcmpos<<8)|(page[10]&0xff);
@@ -73,10 +73,10 @@ int ogg_page_pageno(ogg_page *og){
 
 /* helper to initialize lookup for direct-table CRC */
 
-static unsigned vorbis_size32_t crc_lookup[256];
+static ogg_uint32_t crc_lookup[256];
 static int crc_ready=0;
 
-static unsigned vorbis_size32_t _ogg_crc_entry(unsigned long index){
+static ogg_uint32_t _ogg_crc_entry(unsigned long index){
   int           i;
   unsigned long r;
 
@@ -115,7 +115,7 @@ int ogg_stream_init(ogg_stream_state *os,int serialno){
 
     os->lacing_storage=1024;
     os->lacing_vals=malloc(os->lacing_storage*sizeof(int));
-    os->pcm_vals=malloc(os->lacing_storage*sizeof(int64_t));
+    os->pcm_vals=malloc(os->lacing_storage*sizeof(ogg_int64_t));
 
     /* initialize the crc_lookup table if not done */
     _ogg_crc_init();
@@ -161,7 +161,7 @@ static void _os_lacing_expand(ogg_stream_state *os,int needed){
   if(os->lacing_storage<=os->lacing_fill+needed){
     os->lacing_storage+=(needed+32);
     os->lacing_vals=realloc(os->lacing_vals,os->lacing_storage*sizeof(int));
-    os->pcm_vals=realloc(os->pcm_vals,os->lacing_storage*sizeof(int64_t));
+    os->pcm_vals=realloc(os->pcm_vals,os->lacing_storage*sizeof(ogg_int64_t));
   }
 }
 
@@ -170,7 +170,7 @@ static void _os_lacing_expand(ogg_stream_state *os,int needed){
    perform the checksum silmultaneously with other copies */
 
 static void _os_checksum(ogg_page *og){
-  unsigned vorbis_size32_t crc_reg=0;
+  ogg_uint32_t crc_reg=0;
   int i;
 
   for(i=0;i<og->header_len;i++)
@@ -253,7 +253,7 @@ int ogg_stream_flush(ogg_stream_state *os,ogg_page *og){
   int maxvals=(os->lacing_fill>255?255:os->lacing_fill);
   int bytes=0;
   long acc=0;
-  int64_t pcm_pos=os->pcm_vals[0];
+  ogg_int64_t pcm_pos=os->pcm_vals[0];
 
   if(maxvals==0)return(0);
   
@@ -344,7 +344,7 @@ int ogg_stream_flush(ogg_stream_state *os,ogg_page *og){
   
   os->lacing_fill-=vals;
   memmove(os->lacing_vals,os->lacing_vals+vals,os->lacing_fill*sizeof(int));
-  memmove(os->pcm_vals,os->pcm_vals+vals,os->lacing_fill*sizeof(int64_t));
+  memmove(os->pcm_vals,os->pcm_vals+vals,os->lacing_fill*sizeof(ogg_int64_t));
   os->body_returned+=bytes;
   
   /* calculate the checksum */
@@ -591,7 +591,7 @@ int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){
   int continued=ogg_page_continued(og);
   int bos=ogg_page_bos(og);
   int eos=ogg_page_eos(og);
-  int64_t pcmpos=ogg_page_frameno(og);
+  ogg_int64_t pcmpos=ogg_page_frameno(og);
   int serialno=ogg_page_serialno(og);
   int pageno=ogg_page_pageno(og);
   int segments=header[26];
@@ -615,7 +615,7 @@ int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){
        memmove(os->lacing_vals,os->lacing_vals+lr,
                (os->lacing_fill-lr)*sizeof(int));
        memmove(os->pcm_vals,os->pcm_vals+lr,
-               (os->lacing_fill-lr)*sizeof(int64_t));
+               (os->lacing_fill-lr)*sizeof(ogg_int64_t));
       }
       os->lacing_fill-=lr;
       os->lacing_packet-=lr;
index 602f431..091ea2a 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: stdio-based convenience library for opening/seeking/decoding
- last mod: $Id: vorbisfile.c,v 1.27 2000/08/15 09:09:43 xiphmont Exp $
+ last mod: $Id: vorbisfile.c,v 1.28 2000/08/30 06:09:21 xiphmont Exp $
 
  ********************************************************************/
 
@@ -189,7 +189,7 @@ static void _bisect_forward_serialno(OggVorbis_File *vf,
   
   if(searched>=end || ret==-1){
     vf->links=m+1;
-    vf->offsets=malloc((m+2)*sizeof(int64_t));
+    vf->offsets=malloc((m+2)*sizeof(ogg_int64_t));
     vf->offsets[m+1]=searched;
   }else{
     _bisect_forward_serialno(vf,next,vf->offset,
@@ -265,8 +265,8 @@ static void _prefetch_all_headers(OggVorbis_File *vf,vorbis_info *first_i,
   
   vf->vi=calloc(vf->links,sizeof(vorbis_info));
   vf->vc=calloc(vf->links,sizeof(vorbis_info));
-  vf->dataoffsets=malloc(vf->links*sizeof(int64_t));
-  vf->pcmlengths=malloc(vf->links*sizeof(int64_t));
+  vf->dataoffsets=malloc(vf->links*sizeof(ogg_int64_t));
+  vf->pcmlengths=malloc(vf->links*sizeof(ogg_int64_t));
   vf->serialnos=malloc(vf->links*sizeof(long));
   
   for(i=0;i<vf->links;i++){
@@ -413,7 +413,7 @@ static int _process_packet(OggVorbis_File *vf,int readp){
     if(vf->decode_ready){
       ogg_packet op;
       int result=ogg_stream_packetout(&vf->os,&op);
-      int64_t frameno;
+      ogg_int64_t frameno;
       
       /* if(result==-1)return(-1); hole in the data. For now, swallow
                                    and go. We'll need to add a real
@@ -559,7 +559,7 @@ int ov_clear(OggVorbis_File *vf){
   return(0);
 }
 
-static int _fseek64_wrap(FILE *f,int64_t off,int whence){
+static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){
   return fseek(f,(int)off,whence);
 }
 
@@ -574,7 +574,7 @@ static int _fseek64_wrap(FILE *f,int64_t off,int whence){
 int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){
   ov_callbacks callbacks = {
     (size_t (*)(void *, size_t, size_t, void *))  fread,
-    (int (*)(void *, int64_t, int))              _fseek64_wrap,
+    (int (*)(void *, ogg_int64_t, int))              _fseek64_wrap,
     (int (*)(void *))                             fclose,
     (long (*)(void *))                            ftell
   };
@@ -642,7 +642,7 @@ long ov_bitrate(OggVorbis_File *vf,int i){
   if(i>=vf->links)return(-1);
   if(!vf->seekable && i!=0)return(ov_bitrate(vf,0));
   if(i<0){
-    int64_t bits=0;
+    ogg_int64_t bits=0;
     int i;
     for(i=0;i<vf->links;i++)
       bits+=(vf->offsets[i+1]-vf->dataoffsets[i])*8;
@@ -696,7 +696,7 @@ long ov_serialnumber(OggVorbis_File *vf,int i){
             raw (compressed) length of that logical bitstream for i==0 to n
            -1 if the stream is not seekable (we can't know the length)
 */
-int64_t ov_raw_total(OggVorbis_File *vf,int i){
+ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i){
   if(!vf->seekable || i>=vf->links)return(-1);
   if(i<0){
     long acc=0;
@@ -713,10 +713,10 @@ int64_t ov_raw_total(OggVorbis_File *vf,int i){
             PCM length (samples) of that logical bitstream for i==0 to n
            -1 if the stream is not seekable (we can't know the length)
 */
-int64_t ov_pcm_total(OggVorbis_File *vf,int i){
+ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i){
   if(!vf->seekable || i>=vf->links)return(-1);
   if(i<0){
-    int64_t acc=0;
+    ogg_int64_t acc=0;
     int i;
     for(i=0;i<vf->links;i++)
       acc+=ov_pcm_total(vf,i);
@@ -810,9 +810,9 @@ int ov_raw_seek(OggVorbis_File *vf,long pos){
 
    returns zero on success, nonzero on failure */
 
-int ov_pcm_seek(OggVorbis_File *vf,int64_t pos){
+int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){
   int link=-1;
-  int64_t total=ov_pcm_total(vf,-1);
+  ogg_int64_t total=ov_pcm_total(vf,-1);
 
   if(!vf->seekable)return(-1); /* don't dump machine if we can't seek */  
   if(pos<0 || pos>total)goto seek_error;
@@ -829,7 +829,7 @@ int ov_pcm_seek(OggVorbis_File *vf,int64_t pos){
      bitstream could make our task impossible.  Account for that (it
      would be an error condition) */
   {
-    int64_t target=pos-total;
+    ogg_int64_t target=pos-total;
     long end=vf->offsets[link+1];
     long begin=vf->offsets[link];
     long best=begin;
@@ -851,7 +851,7 @@ int ov_pcm_seek(OggVorbis_File *vf,int64_t pos){
       if(ret==-1){
        end=bisect;
       }else{
-       int64_t frameno=ogg_page_frameno(&og);
+       ogg_int64_t frameno=ogg_page_frameno(&og);
        if(frameno<target){
          best=ret;  /* raw offset of packet with frameno */ 
          begin=vf->offset; /* raw offset of next packet */
@@ -900,7 +900,7 @@ int ov_time_seek(OggVorbis_File *vf,double seconds){
   /* translate time to PCM position and call ov_pcm_seek */
 
   int link=-1;
-  int64_t pcm_total=ov_pcm_total(vf,-1);
+  ogg_int64_t pcm_total=ov_pcm_total(vf,-1);
   double time_total=ov_time_total(vf,-1);
 
   if(!vf->seekable)return(-1); /* don't dump machine if we can't seek */  
@@ -915,7 +915,7 @@ int ov_time_seek(OggVorbis_File *vf,double seconds){
 
   /* enough information to convert time offset to pcm offset */
   {
-    int64_t target=pcm_total+(seconds-time_total)*vf->vi[link].rate;
+    ogg_int64_t target=pcm_total+(seconds-time_total)*vf->vi[link].rate;
     return(ov_pcm_seek(vf,target));
   }
 
@@ -928,12 +928,12 @@ int ov_time_seek(OggVorbis_File *vf,double seconds){
 
 /* tell the current stream offset cursor.  Note that seek followed by
    tell will likely not give the set offset due to caching */
-int64_t ov_raw_tell(OggVorbis_File *vf){
+ogg_int64_t ov_raw_tell(OggVorbis_File *vf){
   return(vf->offset);
 }
 
 /* return PCM offset (sample) of next PCM sample to be read */
-int64_t ov_pcm_tell(OggVorbis_File *vf){
+ogg_int64_t ov_pcm_tell(OggVorbis_File *vf){
   return(vf->pcm_offset);
 }
 
@@ -942,7 +942,7 @@ double ov_time_tell(OggVorbis_File *vf){
   /* translate time to PCM position and call ov_pcm_seek */
 
   int link=-1;
-  int64_t pcm_total=0;
+  ogg_int64_t pcm_total=0;
   double time_total=0.;
   
   if(vf->seekable){