build changes to eliminate need for u_int32_t
authorMonty <xiphmont@xiph.org>
Mon, 19 Jun 2000 14:59:06 +0000 (14:59 +0000)
committerMonty <xiphmont@xiph.org>
Mon, 19 Jun 2000 14:59:06 +0000 (14:59 +0000)
Monty

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

configure
configure.in
examples/Makefile.in
include/vorbis/os_types.h
lib/Makefile.in
lib/framing.c

index 106fe63..10d74cb 100755 (executable)
--- a/configure
+++ b/configure
@@ -1427,205 +1427,6 @@ case 8 in
        $ac_cv_sizeof_long_long) SIZE64="long long";;
 esac
 
-echo $ac_n "checking for int16_t""... $ac_c" 1>&6
-echo "configure:1432: checking for int16_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1437 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])int16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_int16_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_int16_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_int16_t" 1>&6
-if test $ac_cv_type_int16_t = no; then
-  cat >> confdefs.h <<\EOF
-#define int16_t $SIZE16
-EOF
-
-fi
-
-echo $ac_n "checking for int32_t""... $ac_c" 1>&6
-echo "configure:1465: checking for int32_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1470 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_int32_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_int32_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_int32_t" 1>&6
-if test $ac_cv_type_int32_t = no; then
-  cat >> confdefs.h <<\EOF
-#define int32_t $SIZE32
-EOF
-
-fi
-
-echo $ac_n "checking for int64_t""... $ac_c" 1>&6
-echo "configure:1498: checking for int64_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1503 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])int64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_int64_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_int64_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_int64_t" 1>&6
-if test $ac_cv_type_int64_t = no; then
-  cat >> confdefs.h <<\EOF
-#define int64_t $SIZE64
-EOF
-
-fi
-
-echo $ac_n "checking for u_int16_t""... $ac_c" 1>&6
-echo "configure:1531: checking for u_int16_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_u_int16_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1536 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])u_int16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_u_int16_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_u_int16_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_u_int16_t" 1>&6
-if test $ac_cv_type_u_int16_t = no; then
-  cat >> confdefs.h <<\EOF
-#define u_int16_t unsigned $SIZE16
-EOF
-
-fi
-
-echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6
-echo "configure:1564: checking for u_int32_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1569 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])u_int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_u_int32_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_u_int32_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_u_int32_t" 1>&6
-if test $ac_cv_type_u_int32_t = no; then
-  cat >> confdefs.h <<\EOF
-#define u_int32_t unsigned $SIZE32
-EOF
-
-fi
-
-echo $ac_n "checking for u_int64_t""... $ac_c" 1>&6
-echo "configure:1597: checking for u_int64_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_u_int64_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 1602 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "(^|[^a-zA-Z_0-9])u_int64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
-  rm -rf conftest*
-  ac_cv_type_u_int64_t=yes
-else
-  rm -rf conftest*
-  ac_cv_type_u_int64_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_u_int64_t" 1>&6
-if test $ac_cv_type_u_int64_t = no; then
-  cat >> confdefs.h <<\EOF
-#define u_int64_t unsigned $SIZE64
-EOF
-
-fi
-
-
 if test -z "$SIZE16"; then
        { echo "configure: error: No 16 bit type found on this platform!" 1>&2; exit 1; }
 fi
@@ -1637,12 +1438,12 @@ if test -z "$SIZE64"; then
 fi
        
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1641: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1442: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1646 "configure"
+#line 1447 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -1658,7 +1459,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:1662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -1682,17 +1483,17 @@ for ac_hdr in fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1686: checking for $ac_hdr" >&5
+echo "configure:1487: checking for $ac_hdr" >&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 1691 "configure"
+#line 1492 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1497: \"$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*
@@ -1720,12 +1521,12 @@ done
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1724: checking for working const" >&5
+echo "configure:1525: 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 1729 "configure"
+#line 1530 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1774,7 +1575,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1795,12 +1596,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1799: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1600: 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 1804 "configure"
+#line 1605 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -1809,7 +1610,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:1813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -1830,12 +1631,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1834: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:1635: 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 1839 "configure"
+#line 1640 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -1843,7 +1644,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:1847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1648: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -1865,7 +1666,7 @@ fi
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1869: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1670: 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
@@ -1892,7 +1693,7 @@ else
 fi
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:1896: checking for 8-bit clean memcmp" >&5
+echo "configure:1697: 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
@@ -1900,7 +1701,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 1904 "configure"
+#line 1705 "configure"
 #include "confdefs.h"
 
 main()
@@ -1910,7 +1711,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:1914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1715: \"$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
@@ -1928,12 +1729,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:1932: checking return type of signal handlers" >&5
+echo "configure:1733: 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 1937 "configure"
+#line 1738 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -1950,7 +1751,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:1954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -1971,12 +1772,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:1975: checking for $ac_func" >&5
+echo "configure:1776: 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 1980 "configure"
+#line 1781 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1999,7 +1800,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1804: \"$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
@@ -2030,6 +1831,8 @@ done
 
 
 
+
+
 #AC_SUBST(XOGG)
 #AC_SUBST(LIBGTKDIR)
 
@@ -2191,7 +1994,9 @@ s%@INSTALL@%$INSTALL%g
 s%@CPP@%$CPP%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@LIBOBJS@%$LIBOBJS%g
-s%@TYPESIZES@%$TYPESIZES%g
+s%@SIZE16@%$SIZE16%g
+s%@SIZE32@%$SIZE32%g
+s%@SIZE64@%$SIZE64%g
 s%@OPT@%$OPT%g
 s%@DEBUG@%$DEBUG%g
 s%@PROFILE@%$PROFILE%g
@@ -2304,3 +2109,4 @@ chmod +x $CONFIG_STATUS
 rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
+
index fd8232f..3d9327e 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.13 2000/06/19 10:05:57 xiphmont Exp $
+# $Id: configure.in,v 1.14 2000/06/19 14:59:06 xiphmont Exp $
 
 AC_INIT(lib/mdct.c)
 #AC_CONFIG_HEADER(config.h)
@@ -142,13 +142,6 @@ case 8 in
        $ac_cv_sizeof_long_long) SIZE64="long long";;
 esac
 
-AC_CHECK_TYPE(int16_t,$SIZE16)
-AC_CHECK_TYPE(int32_t,$SIZE32)
-AC_CHECK_TYPE(int64_t,$SIZE64)
-AC_CHECK_TYPE(u_int16_t,unsigned $SIZE16)
-AC_CHECK_TYPE(u_int32_t,unsigned $SIZE32)
-AC_CHECK_TYPE(u_int64_t,unsigned $SIZE64)
-
 if test -z "$SIZE16"; then
        AC_MSG_ERROR(No 16 bit type found on this platform!)
 fi
@@ -171,7 +164,9 @@ AC_FUNC_MEMCMP
 AC_TYPE_SIGNAL
 AC_CHECK_FUNCS(gettimeofday select strcspn strerror strspn sigaction)
 
-AC_SUBST(TYPESIZES)
+AC_SUBST(SIZE16)
+AC_SUBST(SIZE32)
+AC_SUBST(SIZE64)
 AC_SUBST(OPT)
 AC_SUBST(DEBUG)
 AC_SUBST(PROFILE)
@@ -183,3 +178,4 @@ AC_SUBST(pthread_lib)
 
 AC_OUTPUT(Makefile lib/Makefile examples/Makefile vorbis-tools/Makefile\
        vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile)
+
index 1884a20..e949d5a 100644 (file)
@@ -1,6 +1,6 @@
 # vorbis makefile configured for use with gcc on any platform
 
-# $Id: Makefile.in,v 1.8 2000/06/19 10:05:57 xiphmont Exp $
+# $Id: Makefile.in,v 1.9 2000/06/19 14:59:06 xiphmont Exp $
 
 ###############################################################################
 #                                                                             #
@@ -16,7 +16,7 @@
 # (unless, of course, you know what you are doing :) ##########################
 
 @SET_MAKE@
-FLAGS=-I. -I../include @TYPESIZES@ @CFLAGS@ 
+FLAGS=-I. -I../include @CFLAGS@ 
 OPT=@OPT@ $(FLAGS)
 DEBUG=@DEBUG@ $(FLAGS)
 PROFILE=@PROFILE@ $(FLAGS)
index bd719bb..d43960b 100644 (file)
  ********************************************************************
 
  function: #ifdef jail to whip a few platforms into the UNIX ideal.
- last mod: $Id: os_types.h,v 1.3 2000/06/14 08:19:22 xiphmont Exp $
+ last mod: $Id: os_types.h,v 1.4 2000/06/19 14:59:06 xiphmont Exp $
 
  ********************************************************************/
 
 #if defined (_WIN32) && !defined(__GNUC__)
 typedef __int64 int64_t;
-typedef unsigned int u_int32_t;
 #endif
 
 #ifdef __BEOS__
index 9992f56..93e32df 100644 (file)
@@ -1,5 +1,5 @@
 # vorbis makefile configured for use with gcc on any platform
-# $Id: Makefile.in,v 1.29 2000/06/14 01:38:30 xiphmont Exp $
+# $Id: Makefile.in,v 1.30 2000/06/19 14:59:06 xiphmont Exp $
 
 ###############################################################################
 #                                                                             #
@@ -15,7 +15,7 @@
 # (unless, of course, you know what you are doing :) ##########################
 
 @SET_MAKE@
-FLAGS=-I. -I../include @TYPESIZES@ @CFLAGS@ 
+FLAGS=-I. -I../include @CFLAGS@ -Dvorbis_size32_t='@SIZE32@'
 OPT=@OPT@ $(FLAGS)
 DEBUG=@DEBUG@ $(FLAGS)
 PROFILE=@PROFILE@ $(FLAGS)
index b0de497..b0ffeb3 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.17 2000/04/06 15:39:43 xiphmont Exp $
+ last mod: $Id: framing.c,v 1.18 2000/06/19 14:59:06 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
@@ -73,10 +73,10 @@ int ogg_page_pageno(ogg_page *og){
 
 /* helper to initialize lookup for direct-table CRC */
 
-static u_int32_t crc_lookup[256];
+static unsigned vorbis_size32_t crc_lookup[256];
 static int crc_ready=0;
 
-static u_int32_t _ogg_crc_entry(unsigned long index){
+static unsigned vorbis_size32_t _ogg_crc_entry(unsigned long index){
   int           i;
   unsigned long r;
 
@@ -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){
-  u_int32_t crc_reg=0;
+  unsigned vorbis_size32_t crc_reg=0;
   int i;
 
   for(i=0;i<og->header_len;i++)