cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | /* |
cristy | 45ef08f | 2012-12-07 13:13:34 +0000 | [diff] [blame] | 2 | Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3 | dedicated to making software imaging solutions freely available. |
| 4 | |
| 5 | You may not use this file except in compliance with the License. |
| 6 | obtain a copy of the License at |
| 7 | |
| 8 | http://www.imagemagick.org/script/license.php |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | MagickWand private application programming interface declarations. |
| 17 | */ |
| 18 | #ifndef _MAGICKWAND_STUDIO_H |
| 19 | #define _MAGICKWAND_STUDIO_H |
| 20 | |
| 21 | #if defined(__cplusplus) || defined(c_plusplus) |
| 22 | extern "C" { |
| 23 | #endif |
| 24 | |
cristy | 0157aea | 2010-04-24 21:12:18 +0000 | [diff] [blame] | 25 | #if defined(WIN32) || defined(WIN64) |
cristy | 8711081 | 2013-04-03 00:40:44 +0000 | [diff] [blame] | 26 | # define MAGICKWAND_WINDOWS_SUPPORT |
cristy | 0157aea | 2010-04-24 21:12:18 +0000 | [diff] [blame] | 27 | #else |
cristy | 8711081 | 2013-04-03 00:40:44 +0000 | [diff] [blame] | 28 | # define MAGICKWAND_POSIX_SUPPORT |
cristy | 0157aea | 2010-04-24 21:12:18 +0000 | [diff] [blame] | 29 | #endif |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 30 | |
| 31 | #define MAGICKWAND_IMPLEMENTATION 1 |
| 32 | |
| 33 | #if !defined(_MAGICKWAND_CONFIG_H) |
| 34 | # define _MAGICKWAND_CONFIG_H |
| 35 | # if !defined(vms) && !defined(macintosh) |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 36 | # include "MagickCore/magick-config.h" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 37 | # else |
| 38 | # include "magick-config.h" |
| 39 | # endif |
| 40 | #if defined(MAGICKCORE__FILE_OFFSET_BITS) && !defined(_FILE_OFFSET_BITS) |
| 41 | # define _FILE_OFFSET_BITS MAGICKCORE__FILE_OFFSET_BITS |
| 42 | #endif |
| 43 | #if defined(_magickcore_const) && !defined(const) |
| 44 | # define const _magickcore_const |
| 45 | #endif |
| 46 | #if defined(_magickcore_inline) && !defined(inline) |
| 47 | # define inline _magickcore_inline |
| 48 | #endif |
cristy | 12ccba5 | 2009-12-29 00:40:18 +0000 | [diff] [blame] | 49 | #if defined(_magickcore_restrict) && !defined(restrict) |
| 50 | # define restrict _magickcore_restrict |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 51 | #endif |
cristy | ba56db5 | 2011-05-20 02:08:11 +0000 | [diff] [blame] | 52 | # if defined(__cplusplus) || defined(c_plusplus) |
| 53 | # undef inline |
| 54 | # endif |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 55 | #endif |
| 56 | |
| 57 | #if !defined(const) |
| 58 | # define STDC |
| 59 | #endif |
| 60 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 61 | #if defined(__cplusplus) || defined(c_plusplus) |
| 62 | # define storage_class c_class |
| 63 | #else |
| 64 | # define storage_class class |
| 65 | #endif |
| 66 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 67 | #include <stdarg.h> |
| 68 | #include <stdio.h> |
cristy | a0b81c3 | 2010-01-22 02:54:33 +0000 | [diff] [blame] | 69 | #if defined(MAGICKCORE_HAVE_SYS_STAT_H) |
| 70 | # include <sys/stat.h> |
| 71 | #endif |
| 72 | #if defined(MAGICKCORE_STDC_HEADERS) |
| 73 | # include <stdlib.h> |
| 74 | # include <stddef.h> |
| 75 | #else |
| 76 | # if defined(MAGICKCORE_HAVE_STDLIB_H) |
| 77 | # include <stdlib.h> |
| 78 | # endif |
| 79 | #endif |
| 80 | #if defined(MAGICKCORE_HAVE_STRING_H) |
| 81 | # if !defined(STDC_HEADERS) && defined(MAGICKCORE_HAVE_MEMORY_H) |
| 82 | # include <memory.h> |
| 83 | # endif |
| 84 | # include <string.h> |
| 85 | #endif |
| 86 | #if defined(MAGICKCORE_HAVE_STRINGS_H) |
| 87 | # include <strings.h> |
| 88 | #endif |
| 89 | #if defined(MAGICKCORE_HAVE_INTTYPES_H) |
| 90 | # include <inttypes.h> |
| 91 | #endif |
| 92 | #if defined(MAGICKCORE_HAVE_STDINT_H) |
| 93 | # include <stdint.h> |
| 94 | #endif |
| 95 | #if defined(MAGICKCORE_HAVE_UNISTD_H) |
| 96 | # include <unistd.h> |
| 97 | #endif |
cristy | 8711081 | 2013-04-03 00:40:44 +0000 | [diff] [blame] | 98 | #if defined(MAGICKWAND_WINDOWS_SUPPORT) && defined(_DEBUG) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 99 | #define _CRTDBG_MAP_ALLOC |
| 100 | #endif |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 101 | |
cristy | 8711081 | 2013-04-03 00:40:44 +0000 | [diff] [blame] | 102 | #if defined(MAGICKWAND_WINDOWS_SUPPORT) && defined(_DEBUG) |
cristy | a0b81c3 | 2010-01-22 02:54:33 +0000 | [diff] [blame] | 103 | #define _CRTDBG_MAP_ALLOC |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 104 | #endif |
cristy | 8711081 | 2013-04-03 00:40:44 +0000 | [diff] [blame] | 105 | #if defined(MAGICKWAND_WINDOWS_SUPPORT) |
cristy | d912343 | 2012-10-17 12:30:20 +0000 | [diff] [blame] | 106 | # include <io.h> |
cristy | a0b81c3 | 2010-01-22 02:54:33 +0000 | [diff] [blame] | 107 | # include <direct.h> |
| 108 | # if !defined(MAGICKCORE_HAVE_STRERROR) |
| 109 | # define HAVE_STRERROR |
| 110 | # endif |
| 111 | #endif |
| 112 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 113 | #include <ctype.h> |
| 114 | #include <locale.h> |
| 115 | #include <errno.h> |
| 116 | #include <fcntl.h> |
| 117 | #include <math.h> |
| 118 | #include <time.h> |
| 119 | #include <limits.h> |
| 120 | #include <signal.h> |
| 121 | #include <assert.h> |
| 122 | |
cristy | 38d73d6 | 2011-05-19 01:55:37 +0000 | [diff] [blame] | 123 | #if defined(MAGICKCORE_HAVE_XLOCALE_H) |
| 124 | # include <xlocale.h> |
| 125 | #endif |
cristy | 55bf91c | 2010-09-24 00:29:41 +0000 | [diff] [blame] | 126 | #if defined(MAGICKCORE_THREAD_SUPPORT) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 127 | # include <pthread.h> |
cristy | 8711081 | 2013-04-03 00:40:44 +0000 | [diff] [blame] | 128 | #elif defined(MAGICKWAND_WINDOWS_SUPPORT) |
cristy | fe092d8 | 2009-10-11 04:00:45 +0000 | [diff] [blame] | 129 | # define MAGICKCORE_HAVE_WINTHREADS 1 |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 130 | #include <windows.h> |
| 131 | #endif |
| 132 | #if defined(MAGICKCORE_HAVE_SYS_SYSLIMITS_H) |
| 133 | # include <sys/syslimits.h> |
| 134 | #endif |
| 135 | #if defined(MAGICKCORE_HAVE_ARM_LIMITS_H) |
| 136 | # include <arm/limits.h> |
| 137 | #endif |
| 138 | |
cristy | 1579d81 | 2010-01-22 15:45:14 +0000 | [diff] [blame] | 139 | #if defined(MAGICKCORE__OPENCL) |
cristy | fe2e68f | 2010-01-09 19:16:03 +0000 | [diff] [blame] | 140 | #if defined(MAGICKCORE_HAVE_CL_CL_H) |
cristy | 07425aa | 2009-09-20 22:59:24 +0000 | [diff] [blame] | 141 | # include <CL/cl.h> |
cristy | 07425aa | 2009-09-20 22:59:24 +0000 | [diff] [blame] | 142 | #endif |
cristy | fe2e68f | 2010-01-09 19:16:03 +0000 | [diff] [blame] | 143 | #if defined(MAGICKCORE_HAVE_OPENCL_CL_H) |
cristy | 07425aa | 2009-09-20 22:59:24 +0000 | [diff] [blame] | 144 | # include <OpenCL/cl.h> |
cristy | 99cc300 | 2010-01-21 14:50:11 +0000 | [diff] [blame] | 145 | #endif |
cristy | 07425aa | 2009-09-20 22:59:24 +0000 | [diff] [blame] | 146 | # define MAGICKCORE_OPENCL_SUPPORT 1 |
| 147 | #endif |
| 148 | |
cristy | bffe7d3 | 2012-01-20 01:46:17 +0000 | [diff] [blame] | 149 | #if defined(_OPENMP) && ((_OPENMP >= 200203) || defined(__OPENCC__)) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 150 | # include <omp.h> |
cristy | b28d647 | 2009-10-17 20:13:35 +0000 | [diff] [blame] | 151 | # define MAGICKCORE_OPENMP_SUPPORT 1 |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 152 | #endif |
| 153 | |
| 154 | #if defined(MAGICKCORE_HAVE_PREAD) && defined(MAGICKCORE_HAVE_DECL_PREAD) && !MAGICKCORE_HAVE_DECL_PREAD |
| 155 | ssize_t pread(int,void *,size_t,off_t); |
| 156 | #endif |
| 157 | |
| 158 | #if defined(MAGICKCORE_HAVE_PWRITE) && defined(MAGICKCORE_HAVE_DECL_PWRITE) && !MAGICKCORE_HAVE_DECL_PWRITE |
| 159 | ssize_t pwrite(int,const void *,size_t,off_t); |
| 160 | #endif |
| 161 | |
| 162 | #if defined(MAGICKCORE_HAVE_STRLCPY) && defined(MAGICKCORE_HAVE_DECL_STRLCPY) && !MAGICKCORE_HAVE_DECL_STRLCPY |
| 163 | extern size_t strlcpy(char *,const char *,size_t); |
| 164 | #endif |
| 165 | |
| 166 | #if defined(MAGICKCORE_HAVE_VSNPRINTF) && defined(MAGICKCORE_HAVE_DECL_VSNPRINTF) && !MAGICKCORE_HAVE_DECL_VSNPRINTF |
| 167 | extern int vsnprintf(char *,size_t,const char *,va_list); |
| 168 | #endif |
| 169 | |
cristy | e7139e0 | 2012-02-29 12:42:18 +0000 | [diff] [blame] | 170 | #include "MagickWand/method-attribute.h" |
| 171 | |
cristy | 8711081 | 2013-04-03 00:40:44 +0000 | [diff] [blame] | 172 | #if defined(MAGICKWAND_WINDOWS_SUPPORT) || defined(MAGICKWAND_POSIX_SUPPORT) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 173 | # include <sys/types.h> |
| 174 | # include <sys/stat.h> |
| 175 | # if defined(MAGICKCORE_HAVE_FTIME) |
| 176 | # include <sys/timeb.h> |
| 177 | # endif |
cristy | 8711081 | 2013-04-03 00:40:44 +0000 | [diff] [blame] | 178 | # if defined(MAGICKWAND_POSIX_SUPPORT) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 179 | # if defined(MAGICKCORE_HAVE_SYS_NDIR_H) || defined(MAGICKCORE_HAVE_SYS_DIR_H) || defined(MAGICKCORE_HAVE_NDIR_H) |
| 180 | # define dirent direct |
| 181 | # define NAMLEN(dirent) (dirent)->d_namlen |
| 182 | # if defined(MAGICKCORE_HAVE_SYS_NDIR_H) |
| 183 | # include <sys/ndir.h> |
| 184 | # endif |
| 185 | # if defined(MAGICKCORE_HAVE_SYS_DIR_H) |
| 186 | # include <sys/dir.h> |
| 187 | # endif |
| 188 | # if defined(MAGICKCORE_HAVE_NDIR_H) |
| 189 | # include <ndir.h> |
| 190 | # endif |
| 191 | # else |
| 192 | # include <dirent.h> |
| 193 | # define NAMLEN(dirent) strlen((dirent)->d_name) |
| 194 | # endif |
| 195 | # include <sys/wait.h> |
| 196 | # include <pwd.h> |
| 197 | # endif |
| 198 | # if !defined(S_ISDIR) |
| 199 | # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) |
| 200 | # endif |
| 201 | # if !defined(S_ISREG) |
| 202 | # define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) |
| 203 | # endif |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 204 | # include "MagickWand/MagickWand.h" |
cristy | 8711081 | 2013-04-03 00:40:44 +0000 | [diff] [blame] | 205 | # if !defined(MAGICKWAND_WINDOWS_SUPPORT) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 206 | # include <sys/time.h> |
| 207 | # if defined(MAGICKCORE_HAVE_SYS_TIMES_H) |
| 208 | # include <sys/times.h> |
| 209 | # endif |
| 210 | # if defined(MAGICKCORE_HAVE_SYS_RESOURCE_H) |
| 211 | # include <sys/resource.h> |
| 212 | # endif |
cristy | 58945e4 | 2012-09-04 14:33:54 +0000 | [diff] [blame] | 213 | # if defined(MAGICKCORE_HAVE_SYS_MMAN_H) |
| 214 | # include <sys/mman.h> |
| 215 | # endif |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 216 | #endif |
| 217 | #else |
| 218 | # include <types.h> |
| 219 | # include <stat.h> |
| 220 | # if defined(macintosh) |
| 221 | # if !defined(DISABLE_SIOUX) |
| 222 | # include <SIOUX.h> |
| 223 | # include <console.h> |
| 224 | # endif |
| 225 | # include <unix.h> |
| 226 | # endif |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 227 | #endif |
| 228 | |
| 229 | #if defined(S_IRUSR) && defined(S_IWUSR) |
| 230 | # define S_MODE (S_IRUSR | S_IWUSR) |
cristy | 8711081 | 2013-04-03 00:40:44 +0000 | [diff] [blame] | 231 | #elif defined (MAGICKWAND_WINDOWS_SUPPORT) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 232 | # define S_MODE (_S_IREAD | _S_IWRITE) |
| 233 | #else |
| 234 | # define S_MODE 0600 |
| 235 | #endif |
| 236 | |
cristy | 8711081 | 2013-04-03 00:40:44 +0000 | [diff] [blame] | 237 | #if defined(MAGICKWAND_WINDOWS_SUPPORT) |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 238 | # include "MagickCore/nt-base.h" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 239 | #endif |
| 240 | #if defined(macintosh) |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 241 | # include "MagickCore/mac.h" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 242 | #endif |
| 243 | #if defined(vms) |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 244 | # include "MagickCore/vms.h" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 245 | #endif |
| 246 | |
| 247 | #undef HAVE_CONFIG_H |
| 248 | #undef gamma |
| 249 | #undef index |
| 250 | #undef pipe |
| 251 | #undef y1 |
| 252 | |
| 253 | /* |
| 254 | Review these platform specific definitions. |
| 255 | */ |
cristy | 8711081 | 2013-04-03 00:40:44 +0000 | [diff] [blame] | 256 | #if defined(MAGICKWAND_POSIX_SUPPORT) && !defined(__OS2__) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 257 | # define DirectorySeparator "/" |
| 258 | # define DirectoryListSeparator ':' |
| 259 | # define EditorOptions " -title \"Edit Image Comment\" -e vi" |
| 260 | # define Exit exit |
| 261 | # define IsBasenameSeparator(c) ((c) == '/' ? MagickTrue : MagickFalse) |
| 262 | # define X11_PREFERENCES_PATH "~/." |
| 263 | # define ProcessPendingEvents(text) |
| 264 | # define ReadCommandlLine(argc,argv) |
| 265 | # define SetNotifyHandlers |
| 266 | #else |
| 267 | # if defined(vms) |
| 268 | # define X11_APPLICATION_PATH "decw$system_defaults:" |
| 269 | # define DirectorySeparator "" |
| 270 | # define DirectoryListSeparator ';' |
| 271 | # define EditorOptions "" |
| 272 | # define Exit exit |
| 273 | # define IsBasenameSeparator(c) \ |
| 274 | (((c) == ']') || ((c) == ':') || ((c) == '/') ? MagickTrue : MagickFalse) |
| 275 | # define MAGICKCORE_LIBRARY_PATH "sys$login:" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 276 | # define MAGICKCORE_SHARE_PATH "sys$login:" |
| 277 | # define X11_PREFERENCES_PATH "decw$user_defaults:" |
| 278 | # define ProcessPendingEvents(text) |
| 279 | # define ReadCommandlLine(argc,argv) |
| 280 | # define SetNotifyHandlers |
| 281 | # endif |
| 282 | # if defined(__OS2__) |
| 283 | # define DirectorySeparator "\\" |
| 284 | # define DirectoryListSeparator ';' |
| 285 | # define EditorOptions " -title \"Edit Image Comment\" -e vi" |
| 286 | # define Exit exit |
| 287 | # define IsBasenameSeparator(c) \ |
| 288 | (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse) |
| 289 | # define PreferencesDefaults "~\." |
| 290 | # define ProcessPendingEvents(text) |
| 291 | # define ReadCommandlLine(argc,argv) |
| 292 | # define SetNotifyHandlers |
| 293 | #endif |
| 294 | # if defined(macintosh) |
| 295 | # define X11_APPLICATION_PATH "/usr/lib/X11/app-defaults/" |
| 296 | # define DirectorySeparator ":" |
| 297 | # define DirectoryListSeparator ';' |
| 298 | # define EditorOptions "" |
| 299 | # define IsBasenameSeparator(c) ((c) == ':' ? MagickTrue : MagickFalse) |
| 300 | # define MAGICKCORE_LIBRARY_PATH "" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 301 | # define MAGICKCORE_SHARE_PATH "" |
| 302 | # define X11_PREFERENCES_PATH "~/." |
| 303 | # if defined(DISABLE_SIOUX) |
| 304 | # define ReadCommandlLine(argc,argv) |
| 305 | # define SetNotifyHandlers \ |
| 306 | SetFatalErrorHandler(MacFatalErrorHandler); \ |
| 307 | SetErrorHandler(MACErrorHandler); \ |
| 308 | SetWarningHandler(MACWarningHandler) |
| 309 | # else |
| 310 | # define ReadCommandlLine(argc,argv) argc=ccommand(argv); puts(MagickVersion); |
| 311 | # define SetNotifyHandlers \ |
| 312 | SetErrorHandler(MACErrorHandler); \ |
| 313 | SetWarningHandler(MACWarningHandler) |
| 314 | # endif |
| 315 | # endif |
cristy | 8711081 | 2013-04-03 00:40:44 +0000 | [diff] [blame] | 316 | # if defined(MAGICKWAND_WINDOWS_SUPPORT) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 317 | # define DirectorySeparator "\\" |
| 318 | # define DirectoryListSeparator ';' |
| 319 | # define EditorOptions "" |
| 320 | # define IsBasenameSeparator(c) \ |
| 321 | (((c) == '/') || ((c) == '\\') ? MagickTrue : MagickFalse) |
| 322 | # define ProcessPendingEvents(text) |
| 323 | # if !defined(X11_PREFERENCES_PATH) |
| 324 | # define X11_PREFERENCES_PATH "~\\." |
| 325 | # endif |
| 326 | # define ReadCommandlLine(argc,argv) |
| 327 | # define SetNotifyHandlers \ |
| 328 | SetErrorHandler(NTErrorHandler); \ |
| 329 | SetWarningHandler(NTWarningHandler) |
| 330 | # undef sleep |
| 331 | # define sleep(seconds) Sleep(seconds*1000) |
| 332 | # if !defined(MAGICKCORE_HAVE_TIFFCONF_H) |
| 333 | # define HAVE_TIFFCONF_H |
| 334 | # endif |
| 335 | # endif |
| 336 | |
| 337 | #endif |
| 338 | |
| 339 | /* |
| 340 | Define system symbols if not already defined. |
| 341 | */ |
| 342 | #if !defined(STDIN_FILENO) |
| 343 | #define STDIN_FILENO 0x00 |
| 344 | #endif |
| 345 | |
| 346 | #if !defined(O_BINARY) |
| 347 | #define O_BINARY 0x00 |
| 348 | #endif |
| 349 | |
cristy | 104cea8 | 2009-10-25 02:26:51 +0000 | [diff] [blame] | 350 | #if !defined(PATH_MAX) |
| 351 | #define PATH_MAX 4096 |
| 352 | #endif |
| 353 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 354 | /* |
cristy | ecfd724 | 2011-02-18 20:23:57 +0000 | [diff] [blame] | 355 | Exception defines. |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 356 | */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 357 | #define ThrowWandFatalException(severity,tag,context) \ |
| 358 | { \ |
| 359 | ExceptionInfo \ |
anthony | 31f1bf7 | 2012-01-30 12:37:22 +0000 | [diff] [blame] | 360 | *fatal_exception; \ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 361 | \ |
anthony | 31f1bf7 | 2012-01-30 12:37:22 +0000 | [diff] [blame] | 362 | fatal_exception=AcquireExceptionInfo(); \ |
| 363 | (void) ThrowMagickException(fatal_exception,GetMagickModule(),severity,tag, \ |
cristy | efe601c | 2013-01-05 17:51:12 +0000 | [diff] [blame] | 364 | "`%s'",(context)); \ |
anthony | 31f1bf7 | 2012-01-30 12:37:22 +0000 | [diff] [blame] | 365 | CatchException(fatal_exception); \ |
| 366 | fatal_exception=DestroyExceptionInfo(fatal_exception); \ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 367 | } |
| 368 | |
dirk | 93b02b7 | 2013-11-16 16:03:36 +0000 | [diff] [blame^] | 369 | /* |
| 370 | Magick defines. |
| 371 | */ |
| 372 | #if defined(_MSC_VER) |
| 373 | # define DisableMSCWarning(nr) __pragma(warning(push)) \ |
| 374 | __pragma(warning(disable:nr)) |
| 375 | # define RestoreMSCWarning __pragma(warning(pop)) |
| 376 | #else |
| 377 | # define DisableMSCWarning(nr) |
| 378 | # define RestoreMSCWarning |
| 379 | #endif |
| 380 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 381 | #if defined(__cplusplus) || defined(c_plusplus) |
| 382 | } |
| 383 | #endif |
| 384 | |
| 385 | #endif |