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