ImfUtilExport.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // SPDX-License-Identifier: BSD-3-Clause
  3. // Copyright (c) Contributors to the OpenEXR Project.
  4. //
  5. #ifndef INCLUDED_IMFUTILEXPORT_H
  6. #define INCLUDED_IMFUTILEXPORT_H
  7. #include "OpenEXRConfig.h"
  8. /// \addtogroup ExportMacros
  9. /// @{
  10. // are we making a DLL under windows (might be msvc or mingw or others)
  11. #if defined(OPENEXR_DLL)
  12. # if defined(OPENEXRUTIL_EXPORTS)
  13. # define IMFUTIL_EXPORT __declspec(dllexport)
  14. // mingw needs the export when the extern is defined
  15. # if defined(__MINGW32__)
  16. # define IMFUTIL_EXPORT_EXTERN_TEMPLATE IMFUTIL_EXPORT
  17. # define IMFUTIL_EXPORT_TEMPLATE_INSTANCE
  18. // for mingw windows, we need to cause this to export the
  19. // typeinfo tables (but you don't need to have the
  20. // complementary import, because might be a local template too!)
  21. # define IMFUTIL_EXPORT_TEMPLATE_TYPE IMFUTIL_EXPORT
  22. # else
  23. // for normal msvc, need to export the actual instantiation in
  24. // the cpp code, and none of the others
  25. # define IMFUTIL_EXPORT_EXTERN_TEMPLATE
  26. # define IMFUTIL_EXPORT_TEMPLATE_INSTANCE IMFUTIL_EXPORT
  27. # define IMFUTIL_EXPORT_TEMPLATE_TYPE
  28. # endif
  29. # else // OPENEXRUTIL_EXPORTS
  30. # define IMFUTIL_EXPORT __declspec(dllimport)
  31. # define IMFUTIL_EXPORT_EXTERN_TEMPLATE IMFUTIL_EXPORT
  32. # define IMFUTIL_EXPORT_TEMPLATE_INSTANCE
  33. # define IMFUTIL_EXPORT_TEMPLATE_TYPE
  34. # endif
  35. // DLLs don't support these types of visibility controls, just leave them as empty
  36. # define IMFUTIL_EXPORT_TYPE
  37. # define IMFUTIL_EXPORT_ENUM
  38. # define IMFUTIL_HIDDEN
  39. #else // not an OPENEXR_DLL
  40. // just pass these through from the top level config
  41. # define IMFUTIL_EXPORT OPENEXR_EXPORT
  42. # define IMFUTIL_HIDDEN OPENEXR_HIDDEN
  43. # define IMFUTIL_EXPORT_ENUM OPENEXR_EXPORT_ENUM
  44. # define IMFUTIL_EXPORT_TYPE OPENEXR_EXPORT_TYPE
  45. # define IMFUTIL_EXPORT_TEMPLATE_TYPE OPENEXR_EXPORT_TEMPLATE_TYPE
  46. # define IMFUTIL_EXPORT_EXTERN_TEMPLATE OPENEXR_EXPORT_EXTERN_TEMPLATE
  47. # define IMFUTIL_EXPORT_TEMPLATE_INSTANCE OPENEXR_EXPORT_TEMPLATE_INSTANCE
  48. #endif // OPENEXR_DLL
  49. /// @}
  50. #endif // INCLUDED_IMFUTILEXPORT_H