From 6d4fbec1b8245cca808c2bc53bca58d08b85cba2 Mon Sep 17 00:00:00 2001 From: David Turner Date: Fri, 20 Apr 2001 08:50:36 +0000 Subject: [PATCH] * ftconfig.h, ftoption.h: updated "ftconfig.h" to detect 64-bit int types on platforms where Autoconf is not available). Also removed FTCALC_USE_LONG_LONG and replaced it with FT_CONFIG_OPTION_FORCE_INT64 * builds/win32/freetype.dsp: updated the Visual C++ project file. Doesn't create a DLL yet.. * cffgload.c: removed a compilation warning --- ChangeLog | 11 ++++ builds/win32/visualc/freetype.dsp | 89 ++++++++++++++++++------------ include/freetype/config/ftconfig.h | 72 +++++++++++++++++++----- include/freetype/config/ftoption.h | 24 +++++--- src/cff/cffgload.c | 2 +- 5 files changed, 141 insertions(+), 57 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3529b0775..8102a5fee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2001-04-20 David Turner + + * ftconfig.h, ftoption.h: updated "ftconfig.h" to detect 64-bit int + types on platforms where Autoconf is not available). Also removed + FTCALC_USE_LONG_LONG and replaced it with FT_CONFIG_OPTION_FORCE_INT64 + + * builds/win32/freetype.dsp: updated the Visual C++ project file. Doesn't + create a DLL yet.. + + * cffgload.c: removed a compilation warning + 2001-04-10 Tom Kacvinsky * t1load.c (parse_charstrings): Changed code for placing .notdef diff --git a/builds/win32/visualc/freetype.dsp b/builds/win32/visualc/freetype.dsp index 5379da65f..831bc18cb 100644 --- a/builds/win32/visualc/freetype.dsp +++ b/builds/win32/visualc/freetype.dsp @@ -39,11 +39,12 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "obj/release" -# PROP Intermediate_Dir "obj/release" +# PROP Output_Dir "..\..\..\objs\release" +# PROP Intermediate_Dir "..\..\..\objs\release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /Za /W3 /GX /O2 /I "..\freetype\include\\" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /c +# ADD CPP /nologo /Za /W3 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -51,7 +52,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"lib\freetype200b8.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype202.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Debug" @@ -62,12 +63,12 @@ LIB32=link.exe -lib # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "obj/debug" -# PROP Intermediate_Dir "obj/debug" +# PROP Output_Dir "..\..\..\objs\debug" +# PROP Intermediate_Dir "..\..\..\objs\debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /Za /W3 /Gm /GX /ZI /Od /I "..\freetype\include\\" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /GZ /c -# SUBTRACT CPP /X +# ADD CPP /nologo /Za /W3 /Gm /GX /ZI /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c +# SUBTRACT CPP /X /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -75,7 +76,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"lib\freetype200b8_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype202_D.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Debug Multithreaded" @@ -86,13 +87,13 @@ LIB32=link.exe -lib # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "obj/debug_mt" -# PROP Intermediate_Dir "obj/debug_mt" +# PROP Output_Dir "..\..\..\objs\debug_mt" +# PROP Intermediate_Dir "..\..\..\objs\debug_mt" # PROP Target_Dir "" # ADD BASE CPP /nologo /Za /W3 /Gm /GX /ZI /Od /I "..\freetype\include\\" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /GZ /c # SUBTRACT BASE CPP /X -# ADD CPP /nologo /MTd /Za /W3 /Gm /GX /ZI /Od /I "..\freetype\include\\" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /GZ /c -# SUBTRACT CPP /X +# ADD CPP /nologo /MTd /Za /W3 /Gm /GX /ZI /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c +# SUBTRACT CPP /X /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -100,7 +101,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo /out:"lib\freetype200b8_D.lib" -# ADD LIB32 /nologo /out:"lib\freetype200b8MT_D.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype202MT_D.lib" !ELSEIF "$(CFG)" == "freetype - Win32 Release Multithreaded" @@ -111,11 +112,12 @@ LIB32=link.exe -lib # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "obj/release_mt" -# PROP Intermediate_Dir "obj/release_mt" +# PROP Output_Dir "..\..\..\objs\release_mt" +# PROP Intermediate_Dir "..\..\..\objs\release_mt" # PROP Target_Dir "" # ADD BASE CPP /nologo /Za /W3 /GX /O2 /I "..\freetype\include\\" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /c -# ADD CPP /nologo /MT /Za /W3 /GX /O2 /I "..\freetype\include\\" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /c +# ADD CPP /nologo /MT /Za /W3 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -123,7 +125,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo /out:"lib\freetype200b8.lib" -# ADD LIB32 /nologo /out:"lib\freetype200b8MT.lib" +# ADD LIB32 /nologo /out:"..\..\..\objs\freetype202MT.lib" !ENDIF @@ -138,67 +140,86 @@ LIB32=link.exe -lib # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File -SOURCE=.\src\autohint\autohint.c +SOURCE=..\..\..\src\autohint\autohint.c + +!IF "$(CFG)" == "freetype - Win32 Release" + +!ELSEIF "$(CFG)" == "freetype - Win32 Debug" + +!ELSEIF "$(CFG)" == "freetype - Win32 Debug Multithreaded" + +!ELSEIF "$(CFG)" == "freetype - Win32 Release Multithreaded" + +!ENDIF + # End Source File # Begin Source File -SOURCE=.\src\cff\cff.c +SOURCE=..\..\..\src\cff\cff.c # End Source File # Begin Source File -SOURCE=.\src\base\ftbase.c +SOURCE=..\..\..\src\base\ftbase.c # End Source File # Begin Source File -SOURCE=.\src\base\ftdebug.c +SOURCE=..\..\..\src\base\ftdebug.c # End Source File # Begin Source File -SOURCE=.\src\base\ftglyph.c +SOURCE=..\..\..\src\base\ftglyph.c # End Source File # Begin Source File -SOURCE=.\src\base\ftinit.c +SOURCE=..\..\..\src\base\ftinit.c # End Source File # Begin Source File -SOURCE=.\src\base\ftmm.c +SOURCE=..\..\..\src\base\ftmm.c # End Source File # Begin Source File -SOURCE=.\src\base\ftsystem.c +SOURCE=..\..\..\src\base\ftsystem.c # End Source File # Begin Source File -SOURCE=.\src\psnames\psmodule.c +SOURCE=..\..\..\src\pcf\pcf.c # End Source File # Begin Source File -SOURCE=.\src\raster\raster.c +SOURCE=..\..\..\src\psaux\psaux.c # End Source File # Begin Source File -SOURCE=.\src\sfnt\sfnt.c +SOURCE=..\..\..\src\psnames\psmodule.c # End Source File # Begin Source File -SOURCE=.\src\smooth\smooth.c +SOURCE=..\..\..\src\raster\raster.c # End Source File # Begin Source File -SOURCE=.\src\truetype\truetype.c +SOURCE=..\..\..\src\sfnt\sfnt.c # End Source File # Begin Source File -SOURCE=.\src\cid\type1cid.c +SOURCE=..\..\..\src\smooth\smooth.c # End Source File # Begin Source File -SOURCE=.\src\type1\type1.c +SOURCE=..\..\..\src\truetype\truetype.c # End Source File # Begin Source File -SOURCE=.\src\winfonts\winfnt.c +SOURCE=..\..\..\src\type1\type1.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\cid\type1cid.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\src\winfonts\winfnt.c # End Source File # End Group # Begin Group "Header Files" diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h index 2c2d38138..b41916478 100644 --- a/include/freetype/config/ftconfig.h +++ b/include/freetype/config/ftconfig.h @@ -127,31 +127,73 @@ FT_BEGIN_HEADER #error "no 32bit type found -- please check your configuration files" #endif + + /* determine wether we have a 64-bit int type for platforms without */ + /* Autoconf.. */ + /* */ #if FT_SIZEOF_LONG == 8 /* FT_LONG64 must be defined if a 64-bit type is available */ -#define FT_LONG64 -#define FT_INT64 long +# define FT_LONG64 +# define FT_INT64 long + +#elif defined(_MSC_VER) /* Visual C++ (and Intel C++) */ + + /* this compiler provides the __int64 type */ +# define FT_LONG64 +# define FT_INT64 __int64 + +# elif defined(__BORLANDC__) /* Borland C++ */ + + /* XXXX: we should probably check the value of __BORLANDC__ in order */ + /* to test the compiler version.. */ + + /* this compiler provides the __int64 type */ +# define FT_LONG64 +# define FT_INT64 __int64 + +# elif defined(__WATCOMC__) /* Watcom C++ */ + + /* Watcom doesn't provide 64-bit data types */ + +# elif defined(__MWKS__) /* Metrowerks CodeWarrior */ + + /* I don't know if it provides 64-bit data types, any suggestion */ + /* is welcomed there.. */ + +# elif defined(__GNUC__) + + /* GCC provides the "long long" type */ +# define FT_LONG64 +# define FT_INT64 long long int + +#endif /* !FT_LONG64 */ -#else /*************************************************************************/ /* */ - /* Many compilers provide the non-ANSI `long long' 64-bit type. You can */ - /* activate it by defining the FTCALC_USE_LONG_LONG macro in */ - /* `ftoption.h'. */ + /* A 64-bit data type will create compilation problems if you compile */ + /* in strict ANSI mode. To avoid them, we disable their use if */ + /* __STDC__ is defined. You can however ignore this rule by */ + /* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro.. */ /* */ - /* Note that this will produce many -ansi warnings during library */ - /* compilation, and that in many cases, the generated code will be */ - /* neither smaller nor faster! */ - /* */ -#ifdef FTCALC_USE_LONG_LONG +#if defined(FT_LONG64) && !defined(FT_CONFIG_OPTION_FORCE_INT64) + +# ifdef __STDC__ + + /* undefine the 64-bit macros in strict ANSI compilation mode */ +# undef FT_LONG64 +# undef FT_INT64 + +# endif /* __STDC__ */ + +#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */ + + + + -#define FT_LONG64 -#define FT_INT64 long long -#endif /* FTCALC_USE_LONG_LONG */ -#endif /* FT_SIZEOF_LONG == 8 */ #ifdef FT_MAKE_OPTION_SINGLE_OBJECT diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h index 5c3973c34..58f121786 100644 --- a/include/freetype/config/ftoption.h +++ b/include/freetype/config/ftoption.h @@ -139,12 +139,22 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ - /* Many compilers provide the non-ANSI `long long' 64-bit type. You can */ - /* activate it by defining the FTCALC_USE_LONG_LONG macro. Note that */ - /* this will produce many -ansi warnings during library compilation, and */ - /* that in many cases the generated code will not be smaller or faster! */ + /* Many compilers provide a non-ANSI 64-bit data type that can be used */ + /* by FreeType to speed up some computations. However, this will create */ + /* some problems when compiling the library in strict ANSI mode. */ /* */ -#undef FTCALC_USE_LONG_LONG + /* For this reason, the use of 64-bit ints is normally disabled when */ + /* the __STDC__ macro is defined. You can however disable this by */ + /* defining here the macro FT_CONFIG_OPTION_FORCE_INT64 */ + /* */ + /* For most compilers, this will only create compilation warnings */ + /* when building the library.. */ + /* */ + /* ObNote: the compiler-specific 64-bit integers are detected in the */ + /* file "ftconfig.h" either statically, or through Autoconf */ + /* on platforms that support it.. */ + /* */ +#define FT_CONFIG_OPTION_FORCE_INT64 /*************************************************************************/ @@ -200,9 +210,9 @@ FT_BEGIN_HEADER /* */ /* Don't define any of these macros to compile in `release' mode! */ /* */ -#undef FT_DEBUG_LEVEL_ERROR -#undef FT_DEBUG_LEVEL_TRACE +/* #define FT_DEBUG_LEVEL_ERROR */ +/* #define FT_DEBUG_LEVEL_TRACE */ /*************************************************************************/ /* */ diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c index 4850e3dd0..4764e7106 100644 --- a/src/cff/cffgload.c +++ b/src/cff/cffgload.c @@ -1078,7 +1078,7 @@ FT_TRACE4(( " " )); for ( maskbyte = 0; - maskbyte < ( decoder->num_hints + 7 ) >> 3; + maskbyte < (FT_UInt)(( decoder->num_hints + 7 ) >> 3); maskbyte++, ip++ ) { FT_TRACE4(( "%02X", *ip ));