From 74f442394f4cafccf31ea47f8708a77772cf179a Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Tue, 19 Sep 2017 23:41:27 -0400 Subject: [PATCH] [build] Fix DLL builds in Visual C++ project. * build/windows/vc2010/freetype.vcxproj: Use DynamicLibrary in Debug and Release configurations. * include/freetype/config/ftconfig.h (FT_EXPORT, FT_EXPORT_DEF) [_DLL]: Use Visual C++ extensions. --- ChangeLog | 9 ++++++ builds/windows/vc2010/freetype.vcxproj | 8 ++--- devel/ftoption.h | 42 -------------------------- include/freetype/config/ftconfig.h | 8 +++-- include/freetype/config/ftoption.h | 42 -------------------------- 5 files changed, 19 insertions(+), 90 deletions(-) diff --git a/ChangeLog b/ChangeLog index 64c39ddde..0aff98ff5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2017-09-19 Alexei Podtelezhnikov + + [build] Fix DLL builds in Visual C++ project. + + * build/windows/vc2010/freetype.vcxproj: Use DynamicLibrary in Debug + and Release configurations. + * include/freetype/config/ftconfig.h (FT_EXPORT, FT_EXPORT_DEF) + [_DLL]: Use Visual C++ extensions. + 2017-09-19 John Tytgat [cff] Fix family name logic of pure CFF fontdata (#52056). diff --git a/builds/windows/vc2010/freetype.vcxproj b/builds/windows/vc2010/freetype.vcxproj index 4f212e16e..f357c754b 100644 --- a/builds/windows/vc2010/freetype.vcxproj +++ b/builds/windows/vc2010/freetype.vcxproj @@ -81,12 +81,12 @@ - StaticLibrary + DynamicLibrary false MultiByte - StaticLibrary + DynamicLibrary false MultiByte @@ -111,12 +111,12 @@ MultiByte - StaticLibrary + DynamicLibrary false MultiByte - StaticLibrary + DynamicLibrary false MultiByte diff --git a/devel/ftoption.h b/devel/ftoption.h index 9f9cac129..11a2d1f49 100644 --- a/devel/ftoption.h +++ b/devel/ftoption.h @@ -268,48 +268,6 @@ FT_BEGIN_HEADER #define FT_CONFIG_OPTION_USE_HARFBUZZ - /*************************************************************************/ - /* */ - /* DLL export compilation */ - /* */ - /* When compiling FreeType as a DLL, some systems/compilers need a */ - /* special keyword 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. If you leave them undefined, they */ - /* will be later automatically defined as `extern return_type' to */ - /* allow normal compilation. */ - /* */ - /* Do not #undef these macros here since the build system might define */ - /* them for certain configurations only. */ - /* */ -/* #define FT_EXPORT(x) extern x */ -/* #define FT_EXPORT_DEF(x) x */ - - /*************************************************************************/ /* */ /* Glyph Postscript Names handling */ diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h index 889aebf5a..fa4ac159e 100644 --- a/include/freetype/config/ftconfig.h +++ b/include/freetype/config/ftconfig.h @@ -410,7 +410,9 @@ FT_BEGIN_HEADER #ifndef FT_EXPORT -#ifdef __cplusplus +#if defined( _DLL ) +#define FT_EXPORT( x ) __declspec(dllexport) x +#elif defined( __cplusplus ) #define FT_EXPORT( x ) extern "C" x #else #define FT_EXPORT( x ) extern x @@ -421,7 +423,9 @@ FT_BEGIN_HEADER #ifndef FT_EXPORT_DEF -#ifdef __cplusplus +#if defined( _DLL ) +#define FT_EXPORT_DEF( x ) __declspec(dllexport) x +#elif defined( __cplusplus ) #define FT_EXPORT_DEF( x ) extern "C" x #else #define FT_EXPORT_DEF( x ) extern x diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h index 2fbe80b9b..cb10b1dc6 100644 --- a/include/freetype/config/ftoption.h +++ b/include/freetype/config/ftoption.h @@ -268,48 +268,6 @@ FT_BEGIN_HEADER /* #define FT_CONFIG_OPTION_USE_HARFBUZZ */ - /*************************************************************************/ - /* */ - /* DLL export compilation */ - /* */ - /* When compiling FreeType as a DLL, some systems/compilers need a */ - /* special keyword 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. If you leave them undefined, they */ - /* will be later automatically defined as `extern return_type' to */ - /* allow normal compilation. */ - /* */ - /* Do not #undef these macros here since the build system might define */ - /* them for certain configurations only. */ - /* */ -/* #define FT_EXPORT(x) extern x */ -/* #define FT_EXPORT_DEF(x) x */ - - /*************************************************************************/ /* */ /* Glyph Postscript Names handling */