MagickCore 7.1.1
Convert, Edit, Or Compose Bitmap Images
Loading...
Searching...
No Matches
method-attribute.h
1/*
2 Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
4
5 You may not use this file except in compliance with the License. You may
6 obtain a copy of the License at
7
8 https://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 MagickCore method attributes.
17*/
18#ifndef MAGICKCORE_METHOD_ATTRIBUTE_H
19#define MAGICKCORE_METHOD_ATTRIBUTE_H
20
21#if defined(__cplusplus) || defined(c_plusplus)
22extern "C" {
23#endif
24
25#if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__CYGWIN__)
26# define MagickPrivate
27# if defined(_MT) && defined(_DLL) && !defined(_MAGICKDLL_) && !defined(_LIB)
28# define _MAGICKDLL_
29# endif
30# if defined(_MAGICKDLL_)
31# if defined(_VISUALC_)
32# pragma warning( disable: 4273 ) /* Disable the dll linkage warnings */
33# endif
34# if !defined(_MAGICKLIB_)
35# if defined(__clang__) || defined(__GNUC__)
36# define MagickExport __attribute__ ((dllimport))
37# else
38# define MagickExport __declspec(dllimport)
39# endif
40# else
41# if defined(__clang__) || defined(__GNUC__)
42# define MagickExport __attribute__ ((dllexport))
43# else
44# define MagickExport __declspec(dllexport)
45# endif
46# endif
47# else
48# define MagickExport
49# endif
50# if defined(_DLL) && !defined(_LIB)
51# if defined(__clang__) || defined(__GNUC__)
52# define ModuleExport __attribute__ ((dllexport))
53# else
54# define ModuleExport __declspec(dllexport)
55# endif
56# else
57# define ModuleExport
58# endif
59# if defined(_VISUALC_)
60# pragma warning(disable : 4018)
61# pragma warning(disable : 4068)
62# pragma warning(disable : 4244)
63# pragma warning(disable : 4142)
64# pragma warning(disable : 4800)
65# pragma warning(disable : 4786)
66# pragma warning(disable : 4996)
67# endif
68#else
69# if defined(__clang__) || (__GNUC__ >= 4)
70# define MagickExport __attribute__ ((visibility ("default")))
71# define MagickPrivate __attribute__ ((visibility ("hidden")))
72# else
73# define MagickExport
74# define MagickPrivate
75# endif
76# define ModuleExport MagickExport
77#endif
78
79#define MagickCoreSignature 0xabacadabUL
80#if !defined(MagickPathExtent)
81# define MagickPathExtent 4096 /* always >= max(PATH_MAX,4096) */
82#endif
83#define MaxTextExtent MagickPathExtent
84#define MagickTimeExtent 26
85
86#if defined(MAGICKCORE_HAVE___ATTRIBUTE__)
87# define magick_aligned(x,y) x __attribute__((aligned(y)))
88# define magick_attribute __attribute__
89# define magick_unused(x) magick_unused_ ## x __attribute__((unused))
90# define magick_unreferenced(x) /* nothing */
91#elif defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__CYGWIN__)
92# define magick_aligned(x,y) __declspec(align(y)) x
93# define magick_attribute(x) /* nothing */
94# define magick_unused(x) x
95# define magick_unreferenced(x) (x)
96#else
97# define magick_aligned(x,y) /* nothing */
98# define magick_attribute(x) /* nothing */
99# define magick_unused(x) x
100# define magick_unreferenced(x) /* nothing */
101#endif
102
103#if !defined(__clang__) && (defined(__GNUC__) && (__GNUC__) > 4)
104# define magick_alloc_size(x) __attribute__((__alloc_size__(x)))
105# define magick_alloc_sizes(x,y) __attribute__((__alloc_size__(x,y)))
106# define magick_fallthrough __attribute__((fallthrough))
107#else
108# define magick_alloc_size(x) /* nothing */
109# define magick_alloc_sizes(x,y) /* nothing */
110# if defined(_MSC_VER)
111# define magick_fallthrough [[fallthrough]]
112# else
113# define magick_fallthrough /* nothing */
114# endif
115#endif
116
117#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__) > 4)
118# define magick_cold_spot __attribute__((__cold__))
119# define magick_hot_spot __attribute__((__hot__))
120#else
121# define magick_cold_spot
122# define magick_hot_spot
123#endif
124
125#if defined(__cplusplus) || defined(c_plusplus)
126}
127#endif
128
129#endif