Go to the documentation of this file.
32 #if defined _WIN32 || defined __CYGWIN__
34 #define SITK_ABI_EXPORT __attribute__ ((dllexport))
35 #define SITK_ABI_IMPORT __attribute__ ((dllimport))
36 #define SITK_ABI_HIDDEN
38 #define SITK_ABI_EXPORT __declspec(dllexport) // Note: actually gcc seems to also supports this syntax.
39 #define SITK_ABI_IMPORT __declspec(dllimport) // Note: actually gcc seems to also supports this syntax.
40 #define SITK_ABI_HIDDEN
44 #define SITK_ABI_EXPORT __attribute__ ((visibility ("default")))
45 #define SITK_ABI_IMPORT __attribute__ ((visibility ("default")))
46 #define SITK_ABI_HIDDEN __attribute__ ((visibility ("hidden")))
48 #define SITK_ABI_EXPORT
49 #define SITK_ABI_IMPORT
50 #define SITK_ABI_HIDDEN
55 #if __cplusplus >= 201103L
59 #define SITK_OVERRIDE override
65 #define SITK_NOEXCEPT noexcept
68 #define SITK_NOEXCEPT throw()
71 #if defined(SITK_HAS_TEMPLATE_DISAMBIGUATOR_DEPENDENT_NAME)
72 #define CLANG_TEMPLATE template
74 #define CLANG_TEMPLATE
78 #if !defined(SITK_RETURN_SELF_TYPE_HEADER)
79 #define SITK_RETURN_SELF_TYPE_HEADER Self &
86 class GenericException;
88 #define sitkExceptionMacro(x) \
90 std::ostringstream message; \
91 message << "sitk::ERROR: " x; \
92 throw ::itk::simple::GenericException(__FILE__, __LINE__, message.str().c_str()); \
96 #define sitkDebugMacro(x) \
98 if (this->GetDebug()) \
100 std::ostringstream msg; \
101 msg << "Debug: " << this->GetName() << " (" << this << "): " x \
103 ::itk::OutputWindowDisplayDebugText( msg.str().c_str() ); \
107 #if defined(SITK_HAS_CXX11_NULLPTR)
108 #define SITK_NULLPTR nullptr
110 #define SITK_NULLPTR NULL
114 #define sitkMacroJoin( X, Y ) sitkDoMacroJoin( X, Y )
115 #define sitkDoMacroJoin( X, Y ) sitkDoMacroJoin2(X,Y)
116 #define sitkDoMacroJoin2( X, Y ) X##Y
118 #ifdef SITK_HAS_CXX11_STATIC_ASSERT
120 #define sitkStaticAssert( expr, str) static_assert( expr, str )
126 #define sitkStaticAssert( expr, str ) enum { sitkMacroJoin( static_assert_typedef, __LINE__) = sizeof( itk::simple::StaticAssertFailure<((expr) == 0 ? false : true )> ) };
133 #define sitkPragma(x) _Pragma (#x)
135 #if defined(__clang__) && defined(__has_warning)
136 #define sitkClangDiagnosticPush() sitkPragma( clang diagnostic push )
137 #define sitkClangDiagnosticPop() sitkPragma( clang diagnostic pop )
138 #define sitkClangWarningIgnore_0(x)
139 #define sitkClangWarningIgnore_1(x) sitkPragma( clang diagnostic ignored x)
140 #define sitkClangWarningIgnore(x) sitkMacroJoin( sitkClangWarningIgnore_, __has_warning(x) )(x)
142 #define sitkClangDiagnosticPush()
143 #define sitkClangDiagnosticPop()
144 #define sitkClangWarningIgnore(x)