Visual Studio: Use __declspec(dllexport) if possible (atkmm-2-28/C++11 branch)
Hi,
This updates the atkmm headers and NMake Makefiles by:
- Defining ATKMM_API as appropriate in atkmmconfig.h.in. Define it as nothing if we are not building via Visual Studio, or are doing a static build, or are falling back to using gendef.exe (please see below).
- Annotate class, method and function prototypes with
ATKMM_API
as appropriate. Also applyATKMM_API
to the .hg files in the_WRAP_xxx
items as appropriate. - In the NMake builds, check that gmmproc that was used (or is to be used) is new enough to support applying the
ATKMM_API
annotations with the various_WRAP_xxx
items, by checking on a header that was pre-generated withgmmproc
(builds from release tarballs) or generate a header from a .hg template from atk/src withgmmproc
(GIT/maintainer builds--this is OK as we are going to do this code generation during the build anyways). This is necessary as the C++-11 branch does not depend on a cutting-edge version of glibmm/gmmproc to build. - In the NMake builds, allow building without gendef.exe if we find that
gmmproc
is new enough (i.e. defineATKMM_API
as__declspec(dllexport)
), otherwise makeATKMM_API
to be nothing and fall back using gendef.exe, as we are currently doing.
With blessings, thank you!
Edited by Chun-wei Fan