Commit 57023a55 authored by Adrian Biagioli's avatar Adrian Biagioli
Browse files

Update freetype and drawsvg_ref.dll so on Win64 DrawSVG builds correctly

parent ab7caec5
set(FREETYPE_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "" FORCE) set(FREETYPE_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "" FORCE)
set(FREETYPE_HEADER_DIR ${FREETYPE_ROOT_DIR}/include ${FREETYPE_ROOT_DIR}/include/freetype2) set(FREETYPE_HEADER_DIR ${FREETYPE_ROOT_DIR}/include ${FREETYPE_ROOT_DIR}/include/freetype)
file(GLOB FREETYPE_DLLS ${FREETYPE_ROOT_DIR}/bin/*.dll) file(GLOB FREETYPE_DLLS ${FREETYPE_ROOT_DIR}/bin/*.dll)
include_directories(${FREETYPE_HEADER_DIR}) include_directories(${FREETYPE_HEADER_DIR})
......
#! /bin/sh
#
# Copyright 2000, 2001, 2002, 2003, 2004, 2005 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
prefix=C:/PROGRA~2/GnuWin32
exec_prefix=${prefix}
exec_prefix_set=no
includedir=${prefix}/include
libdir=${exec_prefix}/lib
enable_shared=yes
wl=-Wl,
hardcode_libdir_flag_spec='-L$libdir'
usage()
{
cat <<EOF
Usage: freetype-config [OPTION]...
Get FreeType compilation and linking information.
Options:
--prefix display \`--prefix' value used for building the
FreeType library
--prefix=PREFIX override \`--prefix' value with PREFIX
--exec-prefix display \`--exec-prefix' value used for building
the FreeType library
--exec-prefix=EPREFIX override \`--exec-prefix' value with EPREFIX
--version display libtool version of the FreeType library
--ftversion display FreeType version number
--libs display flags for linking with the FreeType library
--libtool display library name for linking with libtool
--cflags display flags for compiling with the FreeType
library
EOF
exit $1
}
if test $# -eq 0 ; then
usage 1 1>&2
fi
while test $# -gt 0 ; do
case "$1" in
-*=*)
optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
;;
*)
optarg=
;;
esac
case $1 in
--prefix=*)
prefix=$optarg
local_prefix=yes
;;
--prefix)
echo_prefix=yes
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
local_prefix=yes
;;
--exec-prefix)
echo_exec_prefix=yes
;;
--version)
echo 9.16.3
exit 0
;;
--ftversion)
major=`grep define C:/PROGRA~2/GnuWin32/include/freetype2/freetype/freetype.h \
| grep FREETYPE_MAJOR \
| sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
minor=`grep define C:/PROGRA~2/GnuWin32/include/freetype2/freetype/freetype.h \
| grep FREETYPE_MINOR \
| sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
patch=`grep define C:/PROGRA~2/GnuWin32/include/freetype2/freetype/freetype.h \
| grep FREETYPE_PATCH \
| sed 's/.*[ ]\([0-9][0-9]*\).*/\1/'`
echo $major.$minor.$patch
exit 0
;;
--cflags)
echo_cflags=yes
;;
--libs)
echo_libs=yes
;;
--libtool)
echo_libtool=yes
;;
*)
usage 1 1>&2
;;
esac
shift
done
if test "$local_prefix" = "yes" ; then
if test "$exec_prefix_set" != "yes" ; then
exec_prefix=$prefix
fi
fi
if test "$echo_prefix" = "yes" ; then
echo $prefix
fi
if test "$echo_exec_prefix" = "yes" ; then
echo $exec_prefix
fi
if test "$exec_prefix_set" = "yes" ; then
libdir=$exec_prefix/lib
else
if test "$local_prefix" = "yes" ; then
includedir=$prefix/include
libdir=$prefix/lib
fi
fi
if test "$echo_cflags" = "yes" ; then
cflags="-I$includedir/freetype2"
if test "$includedir" != "/usr/include" ; then
echo $cflags -I$includedir
else
echo $cflags
fi
fi
if test "$echo_libs" = "yes" ; then
rpath=
if test "$enable_shared" = "yes" ; then
eval "rpath=\"$hardcode_libdir_flag_spec\""
fi
libs="-lfreetype -lz -Wl,-s -LD:/Progra~1/GnuWin32/lib -lintl -lwsock32 -lole32 -luuid -lmsvcp60 "
if test "$libdir" != "/usr/lib" && test "$libdir" != "/usr/lib64"; then
echo -L$libdir $rpath $libs
else
echo $libs
fi
fi
if test "$echo_libtool" = "yes" ; then
convlib="libfreetype.la"
echo $libdir/$convlib
fi
# EOF
/* ftconfig.h. Generated from ftconfig.in by configure. */ /****************************************************************************
/***************************************************************************/ *
/* */ * ftconfig.h
/* ftconfig.in */ *
/* */ * ANSI-specific configuration file (specification only).
/* UNIX-specific configuration file (specification only). */ *
/* */ * Copyright (C) 1996-2019 by
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by */ * David Turner, Robert Wilhelm, and Werner Lemberg.
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ *
/* */ * This file is part of the FreeType project, and may only be used,
/* This file is part of the FreeType project, and may only be used, */ * modified, and distributed under the terms of the FreeType project
/* modified, and distributed under the terms of the FreeType project */ * license, LICENSE.TXT. By continuing to use, modify, or distribute
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ * this file you indicate that you have read the license and
/* this file you indicate that you have read the license and */ * understand and accept it fully.
/* understand and accept it fully. */ *
/* */ */
/***************************************************************************/
/**************************************************************************
/*************************************************************************/ *
/* */ * This header file contains a number of macro definitions that are used by
/* This header file contains a number of macro definitions that are used */ * the rest of the engine. Most of the macros here are automatically
/* by the rest of the engine. Most of the macros here are automatically */ * determined at compile time, and you should not need to change it to port
/* determined at compile time, and you should not need to change it to */ * FreeType, except to compile the library with a non-ANSI compiler.
/* port FreeType, except to compile the library with a non-ANSI */ *
/* compiler. */ * Note however that if some specific modifications are needed, we advise
/* */ * you to place a modified copy in your build directory.
/* Note however that if some specific modifications are needed, we */ *
/* advise you to place a modified copy in your build directory. */ * The build directory is usually `builds/<system>`, and contains
/* */ * system-specific files that are always included first when building the
/* The build directory is usually `freetype/builds/<system>', and */ * library.
/* contains system-specific files that are always included first when */ *
/* building the library. */ * This ANSI version should stay in `include/config/`.
/* */ *
/*************************************************************************/ */
#ifndef FTCONFIG_H_
#ifndef __FTCONFIG_H__ #define FTCONFIG_H_
#define __FTCONFIG_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_CONFIG_OPTIONS_H #include FT_CONFIG_OPTIONS_H
...@@ -46,73 +45,104 @@ ...@@ -46,73 +45,104 @@
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /**************************************************************************
/* */ *
/* PLATFORM-SPECIFIC CONFIGURATION MACROS */ * PLATFORM-SPECIFIC CONFIGURATION MACROS
/* */ *
/* These macros can be toggled to suit a specific system. The current */ * These macros can be toggled to suit a specific system. The current ones
/* ones are defaults used to compile FreeType in an ANSI C environment */ * are defaults used to compile FreeType in an ANSI C environment (16bit
/* (16bit compilers are also supported). Copy this file to your own */ * compilers are also supported). Copy this file to your own
/* `freetype/builds/<system>' directory, and edit it to port the engine. */ * `builds/<system>` directory, and edit it to port the engine.
/* */ *
/*************************************************************************/ */
#define HAVE_UNISTD_H 1 /* There are systems (like the Texas Instruments 'C54x) where a `char` */
#define HAVE_FCNTL_H 1 /* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
/* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
#define SIZEOF_INT 4 /* is probably unexpected. */
#define SIZEOF_LONG 4 /* */
/* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
/* `char` type. */
#ifndef FT_CHAR_BIT
#define FT_CHAR_BIT CHAR_BIT
#endif
#define FT_SIZEOF_INT SIZEOF_INT
#define FT_SIZEOF_LONG SIZEOF_LONG
#define FT_CHAR_BIT CHAR_BIT /* The size of an `int` type. */
#if FT_UINT_MAX == 0xFFFFUL
#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
#elif FT_UINT_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_INT ( 32 / FT_CHAR_BIT )
#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
#define FT_SIZEOF_INT ( 64 / FT_CHAR_BIT )
#else
#error "Unsupported size of `int' type!"
#endif
/* Preferred alignment of data */ /* The size of a `long` type. A five-byte `long` (as used e.g. on the */
#define FT_ALIGNMENT 8 /* DM642) is recognized but avoided. */
#if FT_ULONG_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
#define FT_SIZEOF_LONG ( 64 / FT_CHAR_BIT )
#else
#error "Unsupported size of `long' type!"
#endif
/* FT_UNUSED is a macro used to indicate that a given parameter is not */ /* `FT_UNUSED` indicates that a given parameter is not used -- */
/* used -- this is only used to get rid of unpleasant compiler warnings */ /* this is only used to get rid of unpleasant compiler warnings. */
#ifndef FT_UNUSED #ifndef FT_UNUSED
#define FT_UNUSED( arg ) ( (arg) = (arg) ) #define FT_UNUSED( arg ) ( (arg) = (arg) )
#endif #endif
/*************************************************************************/ /**************************************************************************
/* */ *
/* AUTOMATIC CONFIGURATION MACROS */ * AUTOMATIC CONFIGURATION MACROS
/* */ *
/* These macros are computed from the ones defined above. Don't touch */ * These macros are computed from the ones defined above. Don't touch
/* their definition, unless you know precisely what you are doing. No */ * their definition, unless you know precisely what you are doing. No
/* porter should need to mess with them. */ * porter should need to mess with them.
/* */ *
/*************************************************************************/ */
/*************************************************************************/ /**************************************************************************
/* */ *
/* Mac support */ * Mac support
/* */ *
/* This is the only necessary change, so it is defined here instead */ * This is the only necessary change, so it is defined here instead
/* providing a new configuration file. */ * providing a new configuration file.
/* */ */
#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \ #if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
( defined( __MWERKS__ ) && defined( macintosh ) ) /* No Carbon frameworks for 64bit 10.4.x. */
/* no Carbon frameworks for 64bit 10.4.x */ /* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
/* so guess the system version by maximum errno before inclusion. */
#include <errno.h>
#ifdef ECANCELED /* defined since 10.2 */
#include "AvailabilityMacros.h" #include "AvailabilityMacros.h"
#endif
#if defined( __LP64__ ) && \ #if defined( __LP64__ ) && \
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 ) ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
#define DARWIN_NO_CARBON 1 #undef FT_MACINTOSH
#else #endif
#elif defined( __SC__ ) || defined( __MRC__ )
/* Classic MacOS compilers */
#include "ConditionalMacros.h"
#if TARGET_OS_MAC
#define FT_MACINTOSH 1 #define FT_MACINTOSH 1
#endif #endif
#endif #endif
/* Fix compiler warning with sgi compiler */ /* Fix compiler warning with sgi compiler. */
#if defined( __sgi ) && !defined( __GNUC__ ) #if defined( __sgi ) && !defined( __GNUC__ )
#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 ) #if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
#pragma set woff 3505 #pragma set woff 3505
...@@ -120,21 +150,97 @@ FT_BEGIN_HEADER ...@@ -120,21 +150,97 @@ FT_BEGIN_HEADER
#endif #endif
/*************************************************************************/ /**************************************************************************
/* */ *
/* IntN types */ * @section:
/* */ * basic_types
/* Used to guarantee the size of some specific integers. */ *
/* */ */
typedef signed short FT_Int16;
/**************************************************************************
*
* @type:
* FT_Int16
*
* @description:
* A typedef for a 16bit signed integer type.
*/
typedef signed short FT_Int16;
/**************************************************************************
*
* @type:
* FT_UInt16
*
* @description:
* A typedef for a 16bit unsigned integer type.
*/
typedef unsigned short FT_UInt16; typedef unsigned short FT_UInt16;
#if FT_SIZEOF_INT == 4 /* */
/* this #if 0 ... #endif clause is for documentation purposes */
#if 0
/**************************************************************************
*
* @type:
* FT_Int32
*
* @description:
* A typedef for a 32bit signed integer type. The size depends on the
* configuration.
*/
typedef signed XXX FT_Int32;
/**************************************************************************
*
* @type:
* FT_UInt32
*
* A typedef for a 32bit unsigned integer type. The size depends on the
* configuration.
*/
typedef unsigned XXX FT_UInt32;
/**************************************************************************
*
* @type:
* FT_Int64
*
* A typedef for a 64bit signed integer type. The size depends on the
* configuration. Only defined if there is real 64bit support;
* otherwise, it gets emulated with a structure (if necessary).
*/
typedef signed XXX FT_Int64;
/**************************************************************************
*
* @type:
* FT_UInt64
*
* A typedef for a 64bit unsigned integer type. The size depends on the
* configuration. Only defined if there is real 64bit support;
* otherwise, it gets emulated with a structure (if necessary).
*/
typedef unsigned XXX FT_UInt64;
/* */
#endif
#if FT_SIZEOF_INT == ( 32 / FT_CHAR_BIT )
typedef signed int FT_Int32; typedef signed int FT_Int32;
typedef unsigned int FT_UInt32; typedef unsigned int FT_UInt32;
#elif FT_SIZEOF_LONG == 4 #elif FT_SIZEOF_LONG == ( 32 / FT_CHAR_BIT )
typedef signed long FT_Int32; typedef signed long FT_Int32;
typedef unsigned long FT_UInt32; typedef unsigned long FT_UInt32;
...@@ -144,13 +250,13 @@ FT_BEGIN_HEADER ...@@ -144,13 +250,13 @@ FT_BEGIN_HEADER
#endif #endif
/* look up an integer type that is at least 32 bits */ /* look up an integer type that is at least 32~bits */
#if FT_SIZEOF_INT >= 4 #if FT_SIZEOF_INT >= ( 32 / FT_CHAR_BIT )
typedef int FT_Fast; typedef int FT_Fast;
typedef unsigned int FT_UFast; typedef unsigned int FT_UFast;
#elif FT_SIZEOF_LONG >= 4 #elif FT_SIZEOF_LONG >= ( 32 / FT_CHAR_BIT )
typedef long FT_Fast; typedef long FT_Fast;
typedef unsigned long FT_UFast; typedef unsigned long FT_UFast;
...@@ -158,28 +264,46 @@ FT_BEGIN_HEADER ...@@ -158,28 +264,46 @@ FT_BEGIN_HEADER
#endif #endif
/* determine whether we have a 64-bit int type for platforms without */ /* determine whether we have a 64-bit `int` type for platforms without */
/* Autoconf */ /* Autoconf */
#if FT_SIZEOF_LONG == 8 #if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
/* `FT_LONG64` must be defined if a 64-bit type is available */
#define FT_LONG64
#define FT_INT64 long
#define FT_UINT64 unsigned long
/**************************************************************************
*
* A 64-bit data type may create compilation problems if you compile in
* strict ANSI mode. To avoid them, we disable other 64-bit data types if
* `__STDC__` is defined. You can however ignore this rule by defining the
* `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
*/
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
/* FT_LONG64 must be defined if a 64-bit type is available */
#define FT_LONG64 #define FT_LONG64
#define FT_INT64 long #define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ #elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
/* this compiler provides the __int64 type */ /* this compiler provides the `__int64` type */
#define FT_LONG64 #define FT_LONG64
#define FT_INT64 __int64 #define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
#elif defined( __BORLANDC__ ) /* Borland C++ */ #elif defined( __BORLANDC__ ) /* Borland C++ */
/* XXXX: We should probably check the value of __BORLANDC__ in order */ /* XXXX: We should probably check the value of `__BORLANDC__` in order */
/* to test the compiler version. */ /* to test the compiler version. */
/* this compiler provides the __int64 type */ /* this compiler provides the `__int64` type */
#define FT_LONG64 #define FT_LONG64
#define FT_INT64 __int64 #define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
#elif defined( __WATCOMC__ ) /* Watcom C++ */ #elif defined( __WATCOMC__ ) /* Watcom C++ */
...@@ -188,45 +312,66 @@ FT_BEGIN_HEADER ...@@ -188,45 +312,66 @@ FT_BEGIN_HEADER
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */ #elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
#define FT_LONG64 #define FT_LONG64
#define FT_INT64 long long int #define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#elif defined( __GNUC__ ) #elif defined( __GNUC__ )
/* GCC provides the `long long' type */ /* GCC provides the `long long` type */
#define FT_LONG64 #define FT_LONG64
#define FT_INT64 long long int #define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#endif /* FT_SIZEOF_LONG == 8 */ #endif /* __STDC_VERSION__ >= 199901L */
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
#define FT_BEGIN_STMNT do { #ifdef FT_LONG64
#define FT_END_STMNT } while ( 0 ) typedef FT_INT64 FT_Int64;
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT typedef FT_UINT64 FT_UInt64;
#endif
/*************************************************************************/ #ifdef _WIN64
/* */ /* only 64bit Windows uses the LLP64 data model, i.e., */
/* A 64-bit data type will create compilation problems if you compile */ /* 32bit integers, 64bit pointers */
/* in strict ANSI mode. To avoid them, we disable their use if */ #define FT_UINT_TO_POINTER( x ) (void*)(unsigned __int64)(x)
/* __STDC__ is defined. You can however ignore this rule by */ #else
/* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */ #define FT_UINT_TO_POINTER( x ) (void*)(unsigned long)(x)
/* */ #endif
#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
#ifdef __STDC__
/* Undefine the 64-bit macros in strict ANSI compilation mode. */ /**************************************************************************
/* Since `#undef' doesn't survive in configuration header files */ *
/* we use the postprocessing facility of AC_CONFIG_HEADERS to */ * miscellaneous
/* replace the leading `/' with `#'. */ *
#undef FT_LONG64 */
#undef FT_INT64
#endif /* __STDC__ */
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */ #define FT_BEGIN_STMNT do {
#define FT_END_STMNT } while ( 0 )
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
/* `typeof` condition taken from gnulib's `intprops.h` header file */
#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
defined( __IBM__TYPEOF__ ) ) || \
( defined( __SUNPRO_C ) && __SUNPRO_C >= 0x5110 && !__STDC__ ) )
#define FT_TYPEOF( type ) ( __typeof__ ( type ) )
#else
#define FT_TYPEOF( type ) /* empty */
#endif
/* Use `FT_LOCAL` and `FT_LOCAL_DEF` to declare and define, */
/* respectively, a function that gets used only within the scope of a */
/* module. Normally, both the header and source code files for such a */
/* function are within a single module directory. */
/* */
/* Intra-module arrays should be tagged with `FT_LOCAL_ARRAY` and */
/* `FT_LOCAL_ARRAY_DEF`. */
/* */
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT #ifdef FT_MAKE_OPTION_SINGLE_OBJECT
#define FT_LOCAL( x ) static x #define FT_LOCAL( x ) static x
...@@ -244,7 +389,16 @@ FT_BEGIN_HEADER ...@@ -244,7 +389,16 @@ FT_BEGIN_HEADER
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */ #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
#define FT_LOCAL_ARRAY( x ) extern const x
#define FT_LOCAL_ARRAY_DEF( x ) const x
/* Use `FT_BASE` and `FT_BASE_DEF` to declare and define, respectively, */
/* functions that are used in more than a single module. In the */
/* current setup this implies that the declaration is in a header file */
/* in the `include/freetype/internal` directory, and the function body */
/* is in a file in `src/base`. */
/* */
#ifndef FT_BASE #ifndef FT_BASE
#ifdef __cplusplus #ifdef __cplusplus
...@@ -267,14 +421,68 @@ FT_BEGIN_HEADER ...@@ -267,14 +421,68 @@ FT_BEGIN_HEADER
#endif /* !FT_BASE_DEF */ #endif /* !FT_BASE_DEF */
/* When compiling FreeType as a DLL or DSO with hidden visibility */
/* some systems/compilers need a special attribute in front OR after */
/* the return type of function declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`. */
/* */
/* - `FT_EXPORT( return_type )` */
/* */
/* is used in a function declaration, as in */
/* */
/* ``` */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* ``` */
/* */
/* - `FT_EXPORT_DEF( return_type )` */
/* */
/* is used in a function definition, as in */
/* */
/* ``` */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* ``` */
/* */
/* You can provide your own implementation of `FT_EXPORT` and */
/* `FT_EXPORT_DEF` here if you want. */
/* */
/* To export a variable, use `FT_EXPORT_VAR`. */
/* */
#ifndef FT_EXPORT #ifndef FT_EXPORT
#ifdef __cplusplus #ifdef FT2_BUILD_LIBRARY
#if defined( WIN32 ) && defined( DLL_EXPORT )
#define FT_EXPORT( x ) __declspec( dllexport ) x
#elif defined( __GNUC__ ) && __GNUC__ >= 4
#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
#define FT_EXPORT( x ) __global x
#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x #define FT_EXPORT( x ) extern "C" x
#else #else
#define FT_EXPORT( x ) extern x #define FT_EXPORT( x ) extern x
#endif #endif
#else
#if defined( WIN32 ) && defined( DLL_IMPORT )
#define FT_EXPORT( x ) __declspec( dllimport ) x
#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x
#else
#define FT_EXPORT( x ) extern x
#endif
#endif
#endif /* !FT_EXPORT */ #endif /* !FT_EXPORT */
...@@ -299,18 +507,25 @@ FT_BEGIN_HEADER ...@@ -299,18 +507,25 @@ FT_BEGIN_HEADER
#endif /* !FT_EXPORT_VAR */ #endif /* !FT_EXPORT_VAR */
/* The following macros are needed to compile the library with a */ /* The following macros are needed to compile the library with a */
/* C++ compiler and with 16bit compilers. */ /* C++ compiler and with 16bit compilers. */
/* */ /* */
/* This is special. Within C++, you must specify `extern "C"' for */ /* This is special. Within C++, you must specify `extern "C"` for */
/* functions which are used via function pointers, and you also */ /* functions which are used via function pointers, and you also */
/* must do that for structures which contain function pointers to */ /* must do that for structures which contain function pointers to */
/* assure C linkage -- it's not possible to have (local) anonymous */ /* assure C linkage -- it's not possible to have (local) anonymous */
/* functions which are accessed by (global) function pointers. */ /* functions which are accessed by (global) function pointers. */
/* */ /* */
/* */ /* */
/* FT_CALLBACK_DEF is used to _define_ a callback function. */ /* FT_CALLBACK_DEF is used to _define_ a callback function, */
/* located in the same source code file as the structure that uses */
/* it. */
/* */
/* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
/* and define a callback function, respectively, in a similar way */
/* as FT_BASE and FT_BASE_DEF work. */
/* */ /* */
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */ /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
/* contains pointers to callback functions. */ /* contains pointers to callback functions. */
...@@ -320,7 +535,7 @@ FT_BEGIN_HEADER ...@@ -320,7 +535,7 @@ FT_BEGIN_HEADER
/* */ /* */
/* */ /* */
/* Some 16bit compilers have to redefine these macros to insert */ /* Some 16bit compilers have to redefine these macros to insert */
/* the infamous `_cdecl' or `__fastcall' declarations. */ /* the infamous `_cdecl` or `__fastcall` declarations. */
/* */ /* */
#ifndef FT_CALLBACK_DEF #ifndef FT_CALLBACK_DEF
#ifdef __cplusplus #ifdef __cplusplus
...@@ -330,6 +545,16 @@ FT_BEGIN_HEADER ...@@ -330,6 +545,16 @@ FT_BEGIN_HEADER
#endif #endif
#endif /* FT_CALLBACK_DEF */ #endif /* FT_CALLBACK_DEF */
#ifndef FT_BASE_CALLBACK
#ifdef __cplusplus
#define FT_BASE_CALLBACK( x ) extern "C" x
#define FT_BASE_CALLBACK_DEF( x ) extern "C" x
#else
#define FT_BASE_CALLBACK( x ) extern x
#define FT_BASE_CALLBACK_DEF( x ) x
#endif
#endif /* FT_BASE_CALLBACK */
#ifndef FT_CALLBACK_TABLE #ifndef FT_CALLBACK_TABLE
#ifdef __cplusplus #ifdef __cplusplus
#define FT_CALLBACK_TABLE extern "C" #define FT_CALLBACK_TABLE extern "C"
...@@ -344,7 +569,7 @@ FT_BEGIN_HEADER ...@@ -344,7 +569,7 @@ FT_BEGIN_HEADER
FT_END_HEADER FT_END_HEADER
#endif /* __FTCONFIG_H__ */ #endif /* FTCONFIG_H_ */
/* END */ /* END */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment