Skip to content

Visual Studio: Use __declspec(dllexport) if possible (atkmm-2-28/C++11 branch)

Chun-wei Fan requested to merge use-dllexport-2-28 into atkmm-2-28

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 apply ATKMM_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 with gmmproc (builds from release tarballs) or generate a header from a .hg template from atk/src with gmmproc (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. define ATKMM_API as __declspec(dllexport)), otherwise make ATKMM_API to be nothing and fall back using gendef.exe, as we are currently doing.

With blessings, thank you!

Edited by Chun-wei Fan

Merge request reports