replace the compile time ordinals.h.in->ordinals.h conversion with a static ordinals.h
authorJosh Coalson <jcoalson@users.sourceforce.net>
Mon, 15 Sep 2003 21:14:26 +0000 (21:14 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Mon, 15 Sep 2003 21:14:26 +0000 (21:14 +0000)
build/config.mk
build/exe.mk
build/lib.mk
build/project_builder_prebuild_phase.sh
configure.in
flac.pbproj/project.pbxproj
include/FLAC/ordinals.h [moved from include/FLAC/ordinals.h.in with 80% similarity]
src/libFLAC/libFLAC_dynamic.dsp
src/libFLAC/libFLAC_static.dsp

index 1a1c1f8..5d4ed62 100644 (file)
@@ -37,14 +37,4 @@ all default: $(DEFAULT_BUILD)
 
 VERSION=\"1.1.0\"
 
-ORDINALS_H = $(topdir)/include/FLAC/ordinals.h
-
-$(ORDINALS_H): $(ORDINALS_H).in
-       sed \
-               -e "s/@FLaC__SIZE16@/short/g" \
-               -e "s/@FLaC__SIZE32@/int/g" \
-               -e "s/@FLaC__SIZE64@/long long/g" \
-               -e "s/@FLaC__USIZE16@/unsigned short/g" \
-               -e "s/@FLaC__USIZE32@/unsigned int/g" \
-               -e "s/@FLaC__USIZE64@/unsigned long long/g" \
-               $< > $@
+CONFIG_CFLAGS=-DHAVE_INTTYPES_H
index 49dfd1b..1509381 100644 (file)
@@ -45,9 +45,9 @@ PROGRAM         = $(BINPATH)/$(PROGRAM_NAME)
 DEBUG_PROGRAM   = $(DEBUG_BINPATH)/$(PROGRAM_NAME)
 RELEASE_PROGRAM = $(RELEASE_BINPATH)/$(PROGRAM_NAME)
 
-debug   : CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
-valgrind: CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -DFLAC__VALGRIND_TESTING -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
-release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(RELEASE_CFLAGS) -Wall -W -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
+debug   : CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
+valgrind: CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -DFLAC__VALGRIND_TESTING -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
+release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(CONFIG_CFLAGS) $(RELEASE_CFLAGS) -Wall -W -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
 
 LFLAGS  = -L$(LIBPATH)
 
index 81af664..9da9af1 100644 (file)
@@ -55,9 +55,9 @@ else
 LINKD       = $(CC) -shared
 endif
 
-debug   : CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
-valgrind: CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -DFLAC__VALGRIND_TESTING -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
-release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(RELEASE_CFLAGS) -Wall -W -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
+debug   : CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
+valgrind: CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) -DFLAC__VALGRIND_TESTING -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
+release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(CONFIG_CFLAGS) $(RELEASE_CFLAGS) -Wall -W -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
 
 LFLAGS  = -L$(LIBPATH)
 
index 5474702..27ba77d 100755 (executable)
@@ -1,2 +1 @@
-cd include/FLAC
-sed -e 's/@FLaC__SIZE16@/short/g' -e 's/@FLaC__SIZE32@/int/g' -e 's/@FLaC__SIZE64@/long long/g' -e 's/@FLaC__USIZE16@/unsigned short/g' -e 's/@FLaC__USIZE32@/unsigned int/g' -e 's/@FLaC__USIZE64@/unsigned long long/g' ordinals.h.in > ordinals.h
+true
index 3a480cd..b0070b8 100644 (file)
@@ -304,56 +304,6 @@ if test -n "$NASM" ; then
 AC_DEFINE(FLAC__HAS_NASM)
 fi
 
-dnl Check for type sizes
-
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-
-case 2 in
-       $ac_cv_sizeof_short) FLaC__SIZE16="short" ; FLaC__USIZE16="unsigned short";;
-       $ac_cv_sizeof_int) FLaC__SIZE16="int" ; FLaC__USIZE16="unsigned int";;
-esac
-
-case 4 in
-       $ac_cv_sizeof_short) FLaC__SIZE32="short" ; FLaC__USIZE32="unsigned short";;
-       $ac_cv_sizeof_int) FLaC__SIZE32="int" ; FLaC__USIZE32="unsigned int";;
-       $ac_cv_sizeof_long) FLaC__SIZE32="long" ; FLaC__USIZE32="unsigned long";;
-esac
-
-case 8 in
-       $ac_cv_sizeof_int) FLaC__SIZE64="int" ; FLaC__USIZE64="unsigned int";;
-       $ac_cv_sizeof_long) FLaC__SIZE64="long" ; FLaC__USIZE64="unsigned long";;
-       $ac_cv_sizeof_long_long) FLaC__SIZE64="long long" ; FLaC__USIZE64="unsigned long long";;
-esac
-
-if test -z "$FLaC__SIZE16"; then
-       AC_MSG_ERROR(No 16 bit type found on this platform!)
-fi
-if test -z "$FLaC__USIZE16"; then
-       AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
-fi
-if test -z "$FLaC__SIZE32"; then
-       AC_MSG_ERROR(No 32 bit type found on this platform!)
-fi
-if test -z "$FLaC__USIZE32"; then
-       AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
-fi
-if test -z "$FLaC__SIZE64"; then
-       AC_MSG_WARN(No 64 bit type found on this platform!)
-fi
-if test -z "$FLaC__USIZE64"; then
-       AC_MSG_ERROR(No unsigned 64 bit type found on this platform!)
-fi
-
-AC_SUBST(FLaC__SIZE16)
-AC_SUBST(FLaC__USIZE16)
-AC_SUBST(FLaC__SIZE32)
-AC_SUBST(FLaC__USIZE32)
-AC_SUBST(FLaC__SIZE64)
-AC_SUBST(FLaC__USIZE64)
-
 OUR_CFLAGS_HEAD='-I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include'
 if test x$debug = xtrue; then
        OUR_CFLAGS_HEAD="$OUR_CFLAGS_HEAD -g -O0 -DDEBUG"
@@ -424,7 +374,6 @@ AC_OUTPUT( \
        src/test_streams/Makefile \
        include/Makefile \
        include/FLAC/Makefile \
-       include/FLAC/ordinals.h \
        include/FLAC++/Makefile \
        include/OggFLAC/Makefile \
        include/OggFLAC++/Makefile \
index 0d76879..ab02de4 100644 (file)
                        buildSettings = {
                                HEADER_SEARCH_PATHS = include;
                                OPTIMIZATION_CFLAGS = "-O3";
-                               OTHER_CFLAGS = "-DVERSION=\\\\\\\"1.1.0\\\\\\\"";
+                               OTHER_CFLAGS = "-DVERSION=\\\\\\\"1.1.0\\\\\\\" -DHAVE_INTTYPES_H";
                                OTHER_LDFLAGS = "";
                                OTHER_REZFLAGS = "";
                                PRODUCT_NAME = flac;
                        buildSettings = {
                                HEADER_SEARCH_PATHS = include;
                                OPTIMIZATION_CFLAGS = "-O3";
-                               OTHER_CFLAGS = "-DVERSION=\\\\\\\"1.1.0\\\\\\\"";
+                               OTHER_CFLAGS = "-DVERSION=\\\\\\\"1.1.0\\\\\\\" -DHAVE_INTTYPES_H";
                                OTHER_LDFLAGS = "";
                                OTHER_REZFLAGS = "";
                                PRODUCT_NAME = metaflac;
similarity index 80%
rename from include/FLAC/ordinals.h.in
rename to include/FLAC/ordinals.h
index 697286e..f1fb8cf 100644 (file)
 #ifndef FLAC__ORDINALS_H
 #define FLAC__ORDINALS_H
 
-#ifdef true
-#undef true
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
-#ifdef false
-#undef false
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#elif defined(HAVE_U_INT)
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
 #endif
-#ifndef __cplusplus
-#define true 1
-#define false 0
+#define uint8_t u_int8_t
+#define uint16_t u_int16_t
+#define uint32_t u_int32_t
+#define uint64_t u_int64_t
+#elif !defined(_MSC_VER)
+#error Unable to find fixed-size data types
 #endif
 
-typedef int FLAC__bool;
-
 typedef signed char FLAC__int8;
 typedef unsigned char FLAC__uint8;
 
@@ -56,15 +61,28 @@ typedef unsigned __int16 FLAC__uint16;
 typedef unsigned __int32 FLAC__uint32;
 typedef unsigned __int64 FLAC__uint64;
 #else
-typedef @FLaC__SIZE16@ FLAC__int16;
-typedef @FLaC__SIZE32@ FLAC__int32;
-typedef @FLaC__SIZE64@ FLAC__int64;
-typedef @FLaC__USIZE16@ FLAC__uint16;
-typedef @FLaC__USIZE32@ FLAC__uint32;
-typedef @FLaC__USIZE64@ FLAC__uint64;
+typedef int16_t FLAC__int16;
+typedef int32_t FLAC__int32;
+typedef int64_t FLAC__int64;
+typedef uint16_t FLAC__uint16;
+typedef uint32_t FLAC__uint32;
+typedef uint64_t FLAC__uint64;
 #endif
 
+typedef int FLAC__bool;
+
 typedef FLAC__uint8 FLAC__byte;
 typedef float FLAC__real;
 
+#ifdef true
+#undef true
+#endif
+#ifdef false
+#undef false
+#endif
+#ifndef __cplusplus
+#define true 1
+#define false 0
+#endif
+
 #endif
index f6d1d1e..20f6953 100644 (file)
@@ -375,34 +375,7 @@ SOURCE=..\..\include\FLAC\metadata.h
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=..\..\include\FLAC\ordinals.h.in\r
-\r
-!IF  "$(CFG)" == "libFLAC_dynamic - Win32 Release"\r
-\r
-USERDEP__ORDIN="..\..\include\FLAC\ordinals.h.in"      \r
-# Begin Custom Build\r
-InputDir=..\..\include\FLAC\r
-InputPath=..\..\include\FLAC\ordinals.h.in\r
-\r
-"$(InputDir)\ordinals.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       copy "$(InputDir)\ordinals.h.in" "$(InputDir)\ordinals.h"\r
-\r
-# End Custom Build\r
-\r
-!ELSEIF  "$(CFG)" == "libFLAC_dynamic - Win32 Debug"\r
-\r
-USERDEP__ORDIN="..\..\include\FLAC\ordinals.h.in"      \r
-# Begin Custom Build\r
-InputDir=..\..\include\FLAC\r
-InputPath=..\..\include\FLAC\ordinals.h.in\r
-\r
-"$(InputDir)\ordinals.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       copy "$(InputDir)\ordinals.h.in" "$(InputDir)\ordinals.h"\r
-\r
-# End Custom Build\r
-\r
-!ENDIF \r
-\r
+SOURCE=..\..\include\FLAC\ordinals.h\r
 # End Source File\r
 # Begin Source File\r
 \r
index efa6099..fd0adaf 100644 (file)
@@ -368,34 +368,7 @@ SOURCE=..\..\include\FLAC\metadata.h
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=..\..\include\FLAC\ordinals.h.in\r
-\r
-!IF  "$(CFG)" == "libFLAC_static - Win32 Release"\r
-\r
-USERDEP__ORDIN="..\..\include\FLAC\ordinals.h.in"      \r
-# Begin Custom Build\r
-InputDir=..\..\include\FLAC\r
-InputPath=..\..\include\FLAC\ordinals.h.in\r
-\r
-"$(InputDir)\ordinals.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       copy "$(InputDir)\ordinals.h.in" "$(InputDir)\ordinals.h"\r
-\r
-# End Custom Build\r
-\r
-!ELSEIF  "$(CFG)" == "libFLAC_static - Win32 Debug"\r
-\r
-USERDEP__ORDIN="..\..\include\FLAC\ordinals.h.in"      \r
-# Begin Custom Build\r
-InputDir=..\..\include\FLAC\r
-InputPath=..\..\include\FLAC\ordinals.h.in\r
-\r
-"$(InputDir)\ordinals.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"\r
-       copy "$(InputDir)\ordinals.h.in" "$(InputDir)\ordinals.h"\r
-\r
-# End Custom Build\r
-\r
-!ENDIF \r
-\r
+SOURCE=..\..\include\FLAC\ordinals.h\r
 # End Source File\r
 # Begin Source File\r
 \r