|
From: | Martin Gieseking |
Subject: | Re: [ft-devel] FreeType DLL support |
Date: | Fri, 12 Jan 2018 09:32:59 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
Am 11.01.2018 um 21:22 schrieb Alexei Podtelezhnikov: [...]
Basically, we need to hide those dllimport/dllexport attributes from anything but DLL context. So I suggested FT2_LINK_DLL compile-time macro because I like it to scream DLL and I did not like other ideas fromhttp://geoffair.net/ms/declspec.htm. Here the proposal: #ifdef _MSC_VER #if defined( FT2_BUILD_LIBARY ) && defined( _DLL ) #define FT_EXPORT( x ) __declspec( dllexport ) x #elif defined( FT2_LINK_DLL ) #define FT_EXPORT( x ) __declspec( dllimport ) x #endif #endifFrom my reading, FT2_LINK_DLL is actually optional but would optimize the library calls.
I would also suggest to replace #ifdef _MSC_VER with #ifdef _WIN32 in order to support other Windows compilers too.Instead of _DLL it might be better to use DLL_EXPORT because it's automatically defined when configuring the build of a shared library on Windows with MinGW or Cygwin.
Martin
[Prev in Thread] | Current Thread | [Next in Thread] |