MagickCore 7.0.10
method-attribute.h
Go to the documentation of this file.
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.
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 Wizard's Toolkit method attributes.
17*/
18#ifndef _WIZARDSTOOLKIT_METHOD_ATTRIBUTE_H
19#define _WIZARDSTOOLKIT_METHOD_ATTRIBUTE_H
20
21#if defined(__cplusplus) || defined(c_plusplus)
22extern "C" {
23#endif
24
25#if defined(__BORLANDC__) && defined(_DLL)
26# pragma message("BCBWizard lib DLL export interface")
27# define _WIZARDDLL_
28# define _WIZARDLIB_
29# define WIZARDSTOOLKIT_MODULES_SUPPORT
30# undef WIZARDSTOOLKIT_BUILD_MODULES
31#endif
32
33#if defined(WIZARDSTOOLKIT_WINDOWS_SUPPORT) && !defined(__CYGWIN__)
34# define WizardPrivate
35# if defined(_MT) && defined(_DLL) && !defined(_WIZARDDLL_) && !defined(_LIB)
36# define _WIZARDDLL_
37# endif
38# if defined(_WIZARDDLL_)
39# if defined(_VISUALC_)
40# pragma warning( disable: 4273 ) /* Disable the dll linkage warnings */
41# endif
42# if !defined(_WIZARDLIB_)
43# if defined(__clang__) || defined(__GNUC__)
44# define WizardExport __attribute__ ((dllimport))
45# else
46# define WizardExport __declspec(dllimport)
47# endif
48# if defined(_VISUALC_)
49# pragma message( "WizardCore lib DLL import interface" )
50# endif
51# else
52# if defined(__clang__) || defined(__GNUC__)
53# define WizardExport __attribute__ ((dllexport))
54# else
55# define WizardExport __declspec(dllexport)
56# endif
57# if defined(_VISUALC_)
58# pragma message( "WizardCore lib DLL export interface" )
59# endif
60# endif
61# else
62# define WizardExport
63# if defined(_VISUALC_)
64# pragma message( "WizardCore lib static interface" )
65# endif
66# endif
67
68# if defined(_DLL) && !defined(_LIB)
69# if defined(__clang__) || defined(__GNUC__)
70# define ModuleExport __attribute__ ((dllexport))
71# else
72# define ModuleExport __declspec(dllexport)
73# endif
74# if defined(_VISUALC_)
75# pragma message( "WizardCore module DLL export interface" )
76# endif
77# else
78# define ModuleExport
79# if defined(_VISUALC_)
80# pragma message( "WizardCore module static interface" )
81# endif
82
83# endif
84# if defined(_VISUALC_)
85# pragma warning(disable : 4018)
86# pragma warning(disable : 4068)
87# pragma warning(disable : 4244)
88# pragma warning(disable : 4142)
89# pragma warning(disable : 4800)
90# pragma warning(disable : 4786)
91# pragma warning(disable : 4996)
92# endif
93#else
94# if defined(__clang__) || (__GNUC__ >= 4)
95# define WizardExport __attribute__ ((visibility ("default")))
96# define WizardPrivate __attribute__ ((visibility ("hidden")))
97# else
98# define WizardExport
99# define WizardPrivate
100# endif
101# define ModuleExport WizardExport
102#endif
103
104#define WizardSignature 0xabacadabUL
105#if !defined(WizardPathExtent)
106# define WizardPathExtent 4096 /* always >= 4096 */
107#endif
108
109#if defined(WIZARDSTOOLKIT_HAVE___ATTRIBUTE__)
110# define wizard_aligned(x,y) x __attribute__((aligned(y)))
111# define wizard_attribute __attribute__
112# define wizard_unused(x) wizard_unused_ ## x __attribute__((unused))
113# define wizard_unreferenced(x) /* nothing */
114#elif defined(WIZARDSTOOLKIT_WINDOWS_SUPPORT) && !defined(__CYGWIN__)
115# define wizard_aligned(x,y) __declspec(align(y)) x
116# define wizard_attribute(x) /* nothing */
117# define wizard_unused(x) x
118# define wizard_unreferenced(x) (x)
119#else
120# define wizard_aligned(x,y) /* nothing */
121# define wizard_attribute(x) /* nothing */
122# define wizard_unused(x) x
123# define wizard_unreferenced(x) /* nothing */
124#endif
125
126#if !defined(__clang__) && (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
127# define wizard_alloc_size(x) __attribute__((__alloc_size__(x)))
128# define wizard_alloc_sizes(x,y) __attribute__((__alloc_size__(x,y)))
129#else
130# define wizard_alloc_size(x) /* nothing */
131# define wizard_alloc_sizes(x,y) /* nothing */
132#endif
133
134#if defined(__clang__) || (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
135# define wizard_cold_spot __attribute__((__cold__))
136# define wizard_hot_spot __attribute__((__hot__))
137#else
138# define wizard_cold_spot
139# define wizard_hot_spot
140#endif
141
142#if defined(__cplusplus) || defined(c_plusplus)
143}
144#endif
145
146#endif