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
54 #if defined(SITK_HAS_TEMPLATE_DISAMBIGUATOR_DEPENDENT_NAME)
55 # define CLANG_TEMPLATE template
57 # define CLANG_TEMPLATE
61 #if !defined(SITK_RETURN_SELF_TYPE_HEADER)
62 # define SITK_RETURN_SELF_TYPE_HEADER Self &
68 class GenericException;
70 #define sitkExceptionMacro(x) \
72 std::ostringstream message; \
73 message << "sitk::ERROR: " x; \
74 throw ::itk::simple::GenericException(__FILE__, __LINE__, message.str().c_str()); \
77 #define sitkWarningMacro(x) \
79 std::ostringstream msg; \
80 msg << this->GetName() << " (" << this << "): " x; \
81 itk::OutputWindowDisplayWarningText(msg.str().c_str()); \
85 #define sitkDebugMacro(x) \
87 if (this->GetDebug()) \
89 std::ostringstream msg; \
90 msg << "Debug: " << this->GetName() << " (" << this << "): " x << "\n\n"; \
91 ::itk::OutputWindowDisplayDebugText(msg.str().c_str()); \
95 #define sitkMacroJoin(X, Y) sitkDoMacroJoin(X, Y)
96 #define sitkDoMacroJoin(X, Y) sitkDoMacroJoin2(X, Y)
97 #define sitkDoMacroJoin2(X, Y) X##Y
101 #define sitkPragma(x) _Pragma(#x)
103 #if defined(__clang__) && defined(__has_warning)
104 # define sitkClangDiagnosticPush() sitkPragma(clang diagnostic push)
105 # define sitkClangDiagnosticPop() sitkPragma(clang diagnostic pop)
106 # define sitkClangWarningIgnore_0(x)
107 # define sitkClangWarningIgnore_1(x) sitkPragma(clang diagnostic ignored x)
108 # define sitkClangWarningIgnore(x) sitkMacroJoin(sitkClangWarningIgnore_, __has_warning(x))(x)
110 # define sitkClangDiagnosticPush()
111 # define sitkClangDiagnosticPop()
112 # define sitkClangWarningIgnore(x)