Viskores  1.0
viskores_cont_export.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef VISKORES_CONT_EXPORT_H
19 #define VISKORES_CONT_EXPORT_H
20 
21 #if defined(VISKORES_DOXYGEN_ONLY)
22 # define VISKORES_CONT_EXPORT_DEFINE
23 # define VISKORES_CONT_IMPORT_DEFINE
24 # define VISKORES_CONT_NO_EXPORT_DEFINE
25 #elif defined(_MSC_VER)
26 # if 0
27  /* This is a static component and has no need for exports
28  elf based static libraries are able to have hidden/default visibility
29  controls on symbols so we should propagate this information in that
30  use case
31  */
32 # define VISKORES_CONT_EXPORT_DEFINE
33 # define VISKORES_CONT_IMPORT_DEFINE
34 # define VISKORES_CONT_NO_EXPORT_DEFINE
35 # else
36 # define VISKORES_CONT_EXPORT_DEFINE __declspec(dllexport)
37 # define VISKORES_CONT_IMPORT_DEFINE __declspec(dllimport)
38 # define VISKORES_CONT_NO_EXPORT_DEFINE
39 # endif
40 #else
41 # define VISKORES_CONT_EXPORT_DEFINE __attribute__((visibility("default")))
42 # define VISKORES_CONT_IMPORT_DEFINE __attribute__((visibility("default")))
43 # define VISKORES_CONT_NO_EXPORT_DEFINE __attribute__((visibility("hidden")))
44 #endif
45 
46 #ifndef VISKORES_CONT_EXPORT
47 # if defined(viskores_cont_EXPORTS)
48  /* We are building this library */
49 # define VISKORES_CONT_EXPORT VISKORES_CONT_EXPORT_DEFINE
50 # else
51  /* We are using this library */
52 # define VISKORES_CONT_EXPORT VISKORES_CONT_IMPORT_DEFINE
53 # endif
54 #endif
55 
56 #ifndef VISKORES_CONT_TEMPLATE_EXPORT
57 # if defined(viskores_cont_EXPORTS) && defined(_MSC_VER)
58  /* Warning C4910 on windows state that extern explicit template can't be
59  labeled with __declspec(dllexport). So that is why we use a new custom
60  define. But when other modules ( e.g. rendering ) include this header
61  we need them to see that the extern template is actually being imported.
62  */
63  /* We are building this library with MSVC */
64 # define VISKORES_CONT_TEMPLATE_EXPORT
65 # elif defined(viskores_cont_EXPORTS)
66  /* We are building this library */
67 # define VISKORES_CONT_TEMPLATE_EXPORT VISKORES_CONT_EXPORT_DEFINE
68 # else
69  /* We are using this library */
70 # define VISKORES_CONT_TEMPLATE_EXPORT VISKORES_CONT_IMPORT_DEFINE
71 # endif
72 #endif
73 
74 #ifndef VISKORES_CONT_NO_EXPORT
75  #define VISKORES_CONT_NO_EXPORT VISKORES_CONT_NO_EXPORT_DEFINE
76 #endif
77 
78 #endif