Added autoconf tests FT_MUNMAP_DECL and FT_MUNMAP_PARAM to fix some devils.
Updating unix/ftsystem.c accordingly. More warning fixes.
This commit is contained in:
parent
e72c9fec17
commit
b1dd3535d5
28
builds/unix/aclocal.m4
vendored
28
builds/unix/aclocal.m4
vendored
@ -1,3 +1,31 @@
|
||||
## FreeType specific autoconf tests
|
||||
|
||||
AC_DEFUN(FT_MUNMAP_DECL,
|
||||
[AC_MSG_CHECKING([whether munmap must be declared])
|
||||
AC_CACHE_VAL(ft_cv_munmap_decl,
|
||||
[AC_TRY_COMPILE([
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/mman.h>],
|
||||
[char *(*pfn) = (char *(*))munmap],
|
||||
ft_cv_munmap_decl=no,
|
||||
ft_cv_munmap_decl=yes)])
|
||||
AC_MSG_RESULT($ft_cv_munmap_decl)
|
||||
if test $ft_cv_munmap_decl = yes; then
|
||||
AC_DEFINE(NEED_MUNMAP_DECL)
|
||||
fi])
|
||||
|
||||
AC_DEFUN(FT_MUNMAP_PARAM,
|
||||
[AC_MSG_CHECKING([for munmap's first parameter type])
|
||||
AC_TRY_COMPILE([
|
||||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
int munmap(void *, size_t);],,
|
||||
AC_MSG_RESULT([void *]);AC_DEFINE(MUNMAP_USES_VOIDP),
|
||||
AC_MSG_RESULT([char *]))
|
||||
])
|
||||
|
||||
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
|
||||
## Copyright (C) 1996-1999 Free Software Foundation, Inc.
|
||||
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
|
94
builds/unix/configure
vendored
94
builds/unix/configure
vendored
@ -1667,18 +1667,82 @@ if test "$ac_cv_func_mmap_fixed_mapped" != yes; then
|
||||
FTSYS_SRC='$(BASE_)ftsystem.c'
|
||||
else
|
||||
FTSYS_SRC='$(BUILD)/ftsystem.c'
|
||||
|
||||
echo $ac_n "checking whether munmap must be declared""... $ac_c" 1>&6
|
||||
echo "configure:1673: checking whether munmap must be declared" >&5
|
||||
if eval "test \"`echo '$''{'ft_cv_munmap_decl'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1678 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/mman.h>
|
||||
int main() {
|
||||
char *(*pfn) = (char *(*))munmap
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ft_cv_munmap_decl=no
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
ft_cv_munmap_decl=yes
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ft_cv_munmap_decl" 1>&6
|
||||
if test $ft_cv_munmap_decl = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define NEED_MUNMAP_DECL 1
|
||||
EOF
|
||||
|
||||
fi
|
||||
echo $ac_n "checking for munmap's first parameter type""... $ac_c" 1>&6
|
||||
echo "configure:1709: checking for munmap's first parameter type" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1711 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
int munmap(void *, size_t);
|
||||
int main() {
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
echo "$ac_t""void *" 1>&6;cat >> confdefs.h <<\EOF
|
||||
#define MUNMAP_USES_VOIDP 1
|
||||
EOF
|
||||
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
rm -rf conftest*
|
||||
echo "$ac_t""char *" 1>&6
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
|
||||
|
||||
for ac_func in memcpy memmove
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
echo "configure:1677: checking for $ac_func" >&5
|
||||
echo "configure:1741: 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 1682 "configure"
|
||||
#line 1746 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
@ -1701,7 +1765,7 @@ $ac_func();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:1769: \"$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
|
||||
@ -1798,7 +1862,7 @@ fi
|
||||
# Extract the first word of "ranlib", so it can be a program name with args.
|
||||
set dummy ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1802: checking for $ac_word" >&5
|
||||
echo "configure:1866: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1837,7 +1901,7 @@ ac_prog=ld
|
||||
if test "$ac_cv_prog_gcc" = yes; then
|
||||
# Check if gcc -print-prog-name=ld gives a path.
|
||||
echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
|
||||
echo "configure:1841: checking for ld used by GCC" >&5
|
||||
echo "configure:1905: checking for ld used by GCC" >&5
|
||||
ac_prog=`($CC -print-prog-name=ld) 2>&5`
|
||||
case "$ac_prog" in
|
||||
# Accept absolute paths.
|
||||
@ -1861,10 +1925,10 @@ echo "configure:1841: checking for ld used by GCC" >&5
|
||||
esac
|
||||
elif test "$with_gnu_ld" = yes; then
|
||||
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
|
||||
echo "configure:1865: checking for GNU ld" >&5
|
||||
echo "configure:1929: checking for GNU ld" >&5
|
||||
else
|
||||
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
|
||||
echo "configure:1868: checking for non-GNU ld" >&5
|
||||
echo "configure:1932: checking for non-GNU ld" >&5
|
||||
fi
|
||||
if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -1899,7 +1963,7 @@ else
|
||||
fi
|
||||
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
|
||||
echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
|
||||
echo "configure:1903: checking if the linker ($LD) is GNU ld" >&5
|
||||
echo "configure:1967: checking if the linker ($LD) is GNU ld" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1915,7 +1979,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
|
||||
|
||||
|
||||
echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
|
||||
echo "configure:1919: checking for BSD-compatible nm" >&5
|
||||
echo "configure:1983: checking for BSD-compatible nm" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1951,7 +2015,7 @@ NM="$ac_cv_path_NM"
|
||||
echo "$ac_t""$NM" 1>&6
|
||||
|
||||
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
|
||||
echo "configure:1955: checking whether ln -s works" >&5
|
||||
echo "configure:2019: checking whether ln -s works" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2000,8 +2064,8 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
|
||||
case "$lt_target" in
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '#line 2004 "configure"' > conftest.$ac_ext
|
||||
if { (eval echo configure:2005: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
echo '#line 2068 "configure"' > conftest.$ac_ext
|
||||
if { (eval echo configure:2069: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
case "`/usr/bin/file conftest.o`" in
|
||||
*32-bit*)
|
||||
LD="${LD-ld} -32"
|
||||
@ -2022,19 +2086,19 @@ case "$lt_target" in
|
||||
SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -belf"
|
||||
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
|
||||
echo "configure:2026: checking whether the C compiler needs -belf" >&5
|
||||
echo "configure:2090: checking whether the C compiler needs -belf" >&5
|
||||
if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2031 "configure"
|
||||
#line 2095 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:2102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
lt_cv_cc_needs_belf=yes
|
||||
else
|
||||
|
@ -68,6 +68,9 @@ if test "$ac_cv_func_mmap_fixed_mapped" != yes; then
|
||||
FTSYS_SRC='$(BASE_)ftsystem.c'
|
||||
else
|
||||
FTSYS_SRC='$(BUILD)/ftsystem.c'
|
||||
|
||||
FT_MUNMAP_DECL
|
||||
FT_MUNMAP_PARAM
|
||||
fi
|
||||
AC_SUBST(FTSYS_SRC)
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/* memory-mapping includes and definitions */
|
||||
/* memory-mapping includes and definitions */
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@ -37,17 +37,27 @@
|
||||
#define MAP_FILE 0x00
|
||||
#endif
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The prototype for munmap() is not provided on SunOS. This needs to */
|
||||
/* have a check added later to see if the GNU C library is being used. */
|
||||
/* If so, then this prototype is not needed. */
|
||||
/* */
|
||||
#if defined( __sun__ ) && !defined( SVR4 ) && !defined( __SVR4 )
|
||||
extern int munmap( caddr_t addr,
|
||||
int len );
|
||||
#ifdef MUNMAP_USES_VOIDP
|
||||
#define MUNMAP_ARG_CAST void *
|
||||
#else
|
||||
#define MUNMAP_ARG_CAST char *
|
||||
#endif
|
||||
|
||||
#ifdef NEED_MUNMAP_DECL
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#else
|
||||
extern
|
||||
#endif
|
||||
int munmap( char* addr,
|
||||
int len );
|
||||
|
||||
#define MUNMAP_ARG_CAST char *
|
||||
|
||||
#endif /* NEED_DECLARATION_MUNMAP */
|
||||
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
@ -182,7 +192,7 @@
|
||||
static
|
||||
void ft_close_stream( FT_Stream stream )
|
||||
{
|
||||
munmap ( stream->descriptor.pointer, stream->size );
|
||||
munmap( (MUNMAP_ARG_CAST)stream->descriptor.pointer, stream->size );
|
||||
|
||||
stream->descriptor.pointer = NULL;
|
||||
stream->size = 0;
|
||||
@ -235,12 +245,12 @@
|
||||
|
||||
stream->size = stat_buf.st_size;
|
||||
stream->pos = 0;
|
||||
stream->base = (unsigned char*)mmap( NULL,
|
||||
stream->size,
|
||||
PROT_READ,
|
||||
MAP_FILE | MAP_PRIVATE,
|
||||
file,
|
||||
0 );
|
||||
stream->base = (unsigned char *)mmap( NULL,
|
||||
stream->size,
|
||||
PROT_READ,
|
||||
MAP_FILE | MAP_PRIVATE,
|
||||
file,
|
||||
0 );
|
||||
|
||||
if ( (long)stream->base == -1 )
|
||||
{
|
||||
|
@ -597,7 +597,6 @@
|
||||
{
|
||||
T2_Operator op;
|
||||
FT_Byte v;
|
||||
FT_Byte count;
|
||||
|
||||
|
||||
/********************************************************************/
|
||||
@ -841,7 +840,7 @@
|
||||
goto Syntax_Error;
|
||||
|
||||
/* check arguments */
|
||||
req_args = count = t2_argument_counts[op];
|
||||
req_args = t2_argument_counts[op];
|
||||
if ( req_args & T2_COUNT_CHECK_WIDTH )
|
||||
{
|
||||
args = stack;
|
||||
@ -1534,8 +1533,8 @@
|
||||
|
||||
case t2_op_roll:
|
||||
{
|
||||
FT_Int count = (FT_Int)( args[0] >> 16 );
|
||||
FT_Int index = (FT_Int)( args[1] >> 16 );
|
||||
FT_Int count = (FT_Int)( args[0] >> 16 );
|
||||
FT_Int index = (FT_Int)( args[1] >> 16 );
|
||||
|
||||
|
||||
FT_TRACE4(( " roll" ));
|
||||
@ -1551,8 +1550,8 @@
|
||||
{
|
||||
while ( index > 0 )
|
||||
{
|
||||
FT_Fixed tmp = args[count - 1];
|
||||
FT_Int i;
|
||||
FT_Fixed tmp = args[count - 1];
|
||||
FT_Int i;
|
||||
|
||||
|
||||
for ( i = count - 2; i >= 0; i-- )
|
||||
|
@ -126,7 +126,8 @@
|
||||
else
|
||||
{
|
||||
/* skip the data */
|
||||
(void)FILE_Skip( data_size );
|
||||
if ( FILE_Skip( data_size ) )
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
|
||||
@ -609,7 +610,8 @@
|
||||
}
|
||||
|
||||
/* skip the rest of the header */
|
||||
(void)FILE_Skip( font->header_size - 4 );
|
||||
if ( FILE_Skip( font->header_size - 4 ) )
|
||||
goto Exit;
|
||||
|
||||
/* read the name, top dict, string and global subrs index */
|
||||
error = t2_new_cff_index( &font->name_index, stream, 0 ) ||
|
||||
|
@ -563,7 +563,6 @@
|
||||
FT_Byte* qcount = (FT_Byte*)parser->object +
|
||||
field->count_offset;
|
||||
|
||||
FT_Long val;
|
||||
FT_Byte** data = parser->stack;
|
||||
|
||||
|
||||
|
@ -434,7 +434,9 @@
|
||||
size = *length;
|
||||
|
||||
stream = face->root.stream;
|
||||
(void)FILE_Read_At( offset, buffer, size );
|
||||
/* the `if' is syntactic sugar for picky compilers */
|
||||
if ( FILE_Read_At( offset, buffer, size ) )
|
||||
;
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
@ -941,7 +943,8 @@
|
||||
FT_ULong upper;
|
||||
|
||||
|
||||
(void)READ_Fields( name_record_fields, cur );
|
||||
if ( READ_Fields( name_record_fields, cur ) )
|
||||
break;
|
||||
|
||||
upper = (FT_ULong)( cur->stringOffset + cur->stringLength );
|
||||
if ( upper > storageSize )
|
||||
|
@ -503,12 +503,11 @@
|
||||
|
||||
while ( count > 0 )
|
||||
{
|
||||
(void)READ_Fields( strike_start_fields, strike );
|
||||
|
||||
(void)READ_Fields( sbit_line_metrics_fields, &strike->hori );
|
||||
(void)READ_Fields( sbit_line_metrics_fields, &strike->vert );
|
||||
|
||||
(void)READ_Fields( strike_end_fields, strike );
|
||||
if ( READ_Fields( strike_start_fields, strike ) ||
|
||||
READ_Fields( sbit_line_metrics_fields, &strike->hori ) ||
|
||||
READ_Fields( sbit_line_metrics_fields, &strike->vert ) ||
|
||||
READ_Fields( strike_end_fields, strike ) )
|
||||
break;
|
||||
|
||||
count--;
|
||||
strike++;
|
||||
@ -884,7 +883,8 @@
|
||||
case 7:
|
||||
case 9:
|
||||
/* variable big metrics */
|
||||
(void)READ_Fields( sbit_metrics_fields, metrics );
|
||||
if ( READ_Fields( sbit_metrics_fields, metrics ) )
|
||||
goto Exit;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
|
@ -576,13 +576,13 @@
|
||||
|
||||
/* count the number of map points */
|
||||
{
|
||||
FT_Byte* p = token->start;
|
||||
FT_Byte* ptr = token->start;
|
||||
FT_Byte* limit = token->limit;
|
||||
|
||||
|
||||
num_points = 0;
|
||||
for ( ; p < limit; p++ )
|
||||
if ( p[0] == '[' )
|
||||
for ( ; ptr < limit; ptr++ )
|
||||
if ( ptr[0] == '[' )
|
||||
num_points++;
|
||||
}
|
||||
if ( num_points <= 0 || num_points > T1_MAX_MM_MAP_POINTS )
|
||||
@ -1692,7 +1692,7 @@
|
||||
for ( ; charcode < loader.encoding_table.num_elems; charcode++ )
|
||||
{
|
||||
type1->encoding.char_index[charcode] = 0;
|
||||
type1->encoding.char_name [charcode] = ".notdef";
|
||||
type1->encoding.char_name [charcode] = (char *)".notdef";
|
||||
|
||||
char_name = loader.encoding_table.elements[charcode];
|
||||
if ( char_name )
|
||||
|
@ -347,7 +347,6 @@
|
||||
if ( error )
|
||||
{
|
||||
/* this didn't work, now try to load a single FNT font */
|
||||
FT_Memory memory = FT_FACE_MEMORY( face );
|
||||
FNT_Font* font;
|
||||
|
||||
if ( ALLOC( face->fonts, sizeof ( *face->fonts ) ) )
|
||||
@ -423,17 +422,17 @@
|
||||
|
||||
root->family_name = (FT_String*)fonts->fnt_frame +
|
||||
fonts->header.face_name_offset;
|
||||
root->style_name = "Regular";
|
||||
root->style_name = (char *)"Regular";
|
||||
|
||||
if ( root->style_flags & FT_STYLE_FLAG_BOLD )
|
||||
{
|
||||
if ( root->style_flags & FT_STYLE_FLAG_ITALIC )
|
||||
root->style_name = "Bold Italic";
|
||||
root->style_name = (char *)"Bold Italic";
|
||||
else
|
||||
root->style_name = "Bold";
|
||||
root->style_name = (char *)"Bold";
|
||||
}
|
||||
else if ( root->style_flags & FT_STYLE_FLAG_ITALIC )
|
||||
root->style_name = "Italic";
|
||||
root->style_name = (char *)"Italic";
|
||||
}
|
||||
|
||||
Fail:
|
||||
|
Loading…
Reference in New Issue
Block a user