openexr_conf.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. ** SPDX-License-Identifier: BSD-3-Clause
  3. ** Copyright Contributors to the OpenEXR Project.
  4. */
  5. #ifndef OPENEXR_CONF_H
  6. #define OPENEXR_CONF_H
  7. #pragma once
  8. #include "OpenEXRConfig.h"
  9. /// \addtogroup ExportMacros
  10. /// @{
  11. // are we making a DLL under windows (might be msvc or mingw or others)
  12. #if defined(OPENEXR_DLL)
  13. // when building as a DLL for windows, typical dllexport/import case
  14. // where we need to switch depending on whether we are compiling
  15. // internally or not
  16. # if defined(OPENEXRCORE_EXPORTS)
  17. # define EXR_EXPORT __declspec(dllexport)
  18. # else
  19. # define EXR_EXPORT __declspec(dllimport)
  20. # endif
  21. #else
  22. # define EXR_EXPORT OPENEXR_EXPORT
  23. #endif
  24. /*
  25. * MSVC does have printf format checks, but it is not in the form of a
  26. * function attribute, so just skip for non-GCC/clang builds
  27. */
  28. #if defined(__GNUC__) || defined(__clang__)
  29. # define EXR_PRINTF_FUNC_ATTRIBUTE __attribute__ ((format (printf, 3, 4)))
  30. #else
  31. # define EXR_PRINTF_FUNC_ATTRIBUTE
  32. #endif
  33. /// @}
  34. #endif /* OPENEXR_CONF_H */