~ubuntu-branches/ubuntu/trusty/gnustep-base/trusty-proposed

« back to all changes in this revision

Viewing changes to Headers/Additions/GNUstepBase/GSVersionMacros.h

  • Committer: Package Import Robot
  • Author(s): Yavor Doganov
  • Date: 2011-09-15 12:31:15 UTC
  • mfrom: (1.2.11 upstream) (8.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20110915123115-rmvsia9z0211izvq
Tags: 1.22.1-1
* New upstream release:
  + Fixes implicit declaration of function (Closes: #629216).
* debian/rules (v_make): Set to 2.6.1.
  (install-common): Do not delete non-existent .swp file.
* debian/control.m4 (Build-Depends): Remove gobjc; gnustep-make now
  depends on it.
  (libgnustep-base-dev) <Depends>: Likewise.
  (Suggests): Remove; completely pointless.
* debian/control: Regenerate.
* debian/patches/avoid-nsl-linkage.patch: Refresh.
* debian/patches/autoreconf.patch: Regenerate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* GSVersionMacros.h - macros for managing API versioning and visibility
2
 
   Copyright (C) 2006 Free Software Foundation, Inc.
3
 
 
4
 
   Written by: Richard Frith-Macdonald <rfm@gnu.org>
5
 
   Date: Oct, October 2006
6
 
   
7
 
   This file is part of GNUstep.
8
 
 
9
 
   This library is free software; you can redistribute it and/or
10
 
   modify it under the terms of the GNU Lesser General Public
11
 
   License as published by the Free Software Foundation; either
12
 
   version 2 of the License, or (at your option) any later version.
13
 
   
14
 
   This library is distributed in the hope that it will be useful,
15
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
 
   Library General Public License for more details.
18
 
   
19
 
   You should have received a copy of the GNU Lesser General Public
20
 
   License along with this library; if not, write to the Free
21
 
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22
 
   Boston, MA 02110-1301, USA.
23
 
*/ 
24
 
 
25
 
#ifndef __GNUSTEP_GSVERSIONMACROS_H_INCLUDED_
26
 
#define __GNUSTEP_GSVERSIONMACROS_H_INCLUDED_
27
 
 
28
 
/* By default we defined NO_GNUSTEP to 0 so that we will include extensions.
29
 
 */
30
 
#if     !defined(NO_GNUSTEP)
31
 
#  define       NO_GNUSTEP      0
32
 
#endif
33
 
 
34
 
/* Check consistency of definitions for system compatibility.
35
 
 */
36
 
#if     defined(STRICT_OPENSTEP)
37
 
#  define       GS_OPENSTEP_V    10000
38
 
#  undef        NO_GNUSTEP
39
 
#  define       NO_GNUSTEP      1
40
 
#elif   defined(STRICT_MACOS_X)
41
 
#  define       GS_OPENSTEP_V   100600
42
 
#  undef        NO_GNUSTEP
43
 
#  define       NO_GNUSTEP      1
44
 
#endif
45
 
 
46
 
/*
47
 
 * For MacOS-X compatibility, we define the MacOS-X version constants and
48
 
 * we allow MAC_OS_X_VERSION_MIN_ALLOWED or MAC_OS_X_VERSION_MAX_ALLOWED
49
 
 * instead of GS_OPENSTEP_V
50
 
 */
51
 
 
52
 
#ifndef MAC_OS_X_VERSION_10_0
53
 
#define MAC_OS_X_VERSION_10_0   100000
54
 
#define MAC_OS_X_VERSION_10_1   100100
55
 
#define MAC_OS_X_VERSION_10_2   100200
56
 
#define MAC_OS_X_VERSION_10_3   100300
57
 
#define MAC_OS_X_VERSION_10_4   100400
58
 
#define MAC_OS_X_VERSION_10_5   100500
59
 
#define MAC_OS_X_VERSION_10_6   100600
60
 
#endif  /* MAC_OS_X_VERSION_10_0 */
61
 
 
62
 
#ifndef GS_OPENSTEP_V
63
 
#ifdef  MAC_OS_X_VERSION_MIN_ALLOWED
64
 
#define GS_OPENSTEP_V   MAC_OS_X_VERSION_MIN_ALLOWED
65
 
#else
66
 
#ifdef  MAC_OS_X_VERSION_MAX_ALLOWED
67
 
#define GS_OPENSTEP_V   MAC_OS_X_VERSION_MAX_ALLOWED
68
 
#endif  /* MAC_OS_X_VERSION_MAX_ALLOWED */
69
 
#endif  /* MAC_OS_X_VERSION_MIN_ALLOWED */
70
 
#endif  /* GS_OPENSTEP_V */
71
 
 
72
 
/*
73
 
 * NB. The version values below must be integers ... by convention these are
74
 
 * made up of two digits each for major, minor and subminor version numbers
75
 
 * (ie each is in the range 00 to 99 though a leading zero in the major
76
 
 * number is not permitted).
77
 
 * So for a MacOS-X 10.3.9 release the version number would be 100309
78
 
 *
79
 
 * You may define GS_GNUSTEP_V or GS_OPENSTEP_V to ensure that your
80
 
 * program only 'sees' the specified varsion of the API.
81
 
 */
82
 
 
83
 
/**
84
 
 * <p>Macro to check a defined GNUstep version number (GS_GNUSTEP_V) against
85
 
 * the supplied arguments.  Returns true if no GNUstep version is specified,
86
 
 * or if ADD &lt;= version &lt; REM, where ADD is the version
87
 
 * number at which a feature guarded by the macro was introduced and
88
 
 * REM is the version number at which it was removed.
89
 
 * </p>
90
 
 * <p>The version number arguments are six digit integers where the first
91
 
 * two digits are the major version number, the second two are the minor
92
 
 * version number and the last two are the subminor number (all left padded
93
 
 * with a zero where necessary).  However, for convenience you can also
94
 
 * use any of several predefined constants ... 
95
 
 * <ref type="macro" id="GS_API_NONE">GS_API_NONE</ref>,
96
 
 * <ref type="macro" id="GS_API_LATEST">GS_API_LATEST</ref>,
97
 
 * <ref type="macro" id="GS_API_OSSPEC">GS_API_OSSPEC</ref>,
98
 
 * <ref type="macro" id="GS_API_OPENSTEP">GS_API_OPENSTEP</ref>,
99
 
 * <ref type="macro" id="GS_API_MACOSX">GS_API_MACOSX</ref>
100
 
 * </p>
101
 
 * <p>Also see <ref type="macro" id="OS_API_VERSION">OS_API_VERSION</ref>
102
 
 * </p>
103
 
 * <p>NB. If you are changing the API (eg adding a new feature) you need
104
 
 * to control the visibility io the new header file code using<br />
105
 
 * <code>#if GS_API_VERSION(ADD,GS_API_LATEST)</code><br />
106
 
 * where <code>ADD</code> is the version number of the next minor
107
 
 * release after the most recent one.<br />
108
 
 * As a general principle you should <em>not</em> change the API with
109
 
 * changing subminor version numbers ... as that tends to confuse
110
 
 * people (though Apple has sometimes done it).
111
 
 * </p>
112
 
 */
113
 
#define GS_API_VERSION(ADD,REM) \
114
 
  (!defined(GS_GNUSTEP_V) || (GS_GNUSTEP_V >= ADD && GS_GNUSTEP_V < REM))
115
 
 
116
 
/**
117
 
 * <p>Macro to check a defined OpenStep/OPENSTEP/MacOS-X version against the
118
 
 * supplied arguments.  Returns true if no version is specified, or if
119
 
 * ADD &lt;= version &lt; REM, where ADD is the version
120
 
 * number at which a feature guarded by the macro was introduced and
121
 
 * REM is the version number at which it was removed.
122
 
 * </p>
123
 
 * <p>The version number arguments are six digit integers where the first
124
 
 * two digits are the major version number, the second two are the minor
125
 
 * version number and the last two are the subminor number (all left padded
126
 
 * with a zero where necessary).  However, for convenience you can also
127
 
 * use any of several predefined constants ... 
128
 
 * <ref type="macro" id="GS_API_NONE">GS_API_NONE</ref>,
129
 
 * <ref type="macro" id="GS_API_LATEST">GS_API_LATEST</ref>,
130
 
 * <ref type="macro" id="GS_API_OSSPEC">GS_API_OSSPEC</ref>,
131
 
 * <ref type="macro" id="GS_API_OPENSTEP">GS_API_OPENSTEP</ref>,
132
 
 * <ref type="macro" id="GS_API_MACOSX">GS_API_MACOSX</ref>
133
 
 * </p>
134
 
 * <p>Also see <ref type="macro" id="GS_API_VERSION">GS_API_VERSION</ref>
135
 
 * </p>
136
 
 */
137
 
#define OS_API_VERSION(ADD,REM) \
138
 
  (!defined(GS_OPENSTEP_V) || (GS_OPENSTEP_V >= ADD && GS_OPENSTEP_V < REM))
139
 
 
140
 
/**
141
 
 * A constant which is the lowest possible version number (0) so that
142
 
 * when used as the removal version (second argument of the GS_API_VERSION
143
 
 * or OS_API_VERSION macro) represents a feature which is not present in
144
 
 * any version.<br />
145
 
 * eg.<br />
146
 
 * #if <ref type="macro" id="OS_API_VERSION">OS_API_VERSION</ref>
147
 
 * (GS_API_NONE, GS_API_NONE)<br />
148
 
 * denotes  code not present in OpenStep/OPENSTEP/MacOS-X
149
 
 */
150
 
#define GS_API_NONE          0
151
 
 
152
 
/**
153
 
 * A constant to represent a feature which is still present in the latest
154
 
 * version.  This is the highest possible version number.<br />
155
 
 * eg.<br />
156
 
 * #if <ref type="macro" id="OS_API_VERSION">OS_API_VERSION</ref>
157
 
 * (GS_API_MACOSX, GS_API_LATEST)<br />
158
 
 * denotes code present from the initial MacOS-X version onwards.
159
 
 */
160
 
#define GS_API_LATEST   999999
161
 
 
162
 
/**
163
 
 * The version number of the initial OpenStep specification.<br />
164
 
 * eg.<br />
165
 
 * #if <ref type="macro" id="OS_API_VERSION">OS_API_VERSION</ref>
166
 
 * (GS_API_OSSPEC, GS_API_LATEST)<br />
167
 
 * denotes code present from the OpenStep specification onwards.
168
 
 */
169
 
#define GS_API_OSSPEC    10000
170
 
 
171
 
/**
172
 
 * The version number of the first OPENSTEP implementation.<br />
173
 
 * eg.<br />
174
 
 * #if <ref type="macro" id="OS_API_VERSION">OS_API_VERSION</ref>
175
 
 * (GS_API_OPENSTEP, GS_API_LATEST)<br />
176
 
 * denotes code present from the initial OPENSTEP version onwards.
177
 
 */
178
 
#define GS_API_OPENSTEP  40000
179
 
 
180
 
/**
181
 
 * The version number of the first MacOS-X implementation.<br />
182
 
 * eg.<br />
183
 
 * #if <ref type="macro" id="OS_API_VERSION">OS_API_VERSION</ref>
184
 
 * (GS_API_MACOSX, GS_API_LATEST)<br />
185
 
 * denotes code present from the initial MacOS-X version onwards.
186
 
 */
187
 
#define GS_API_MACOSX   100000
188
 
 
189
 
 
190
 
#if     defined(GNUSTEP_BASE_INTERNAL)
191
 
#import "GNUstepBase/GSConfig.h"
192
 
#else
193
 
#import <GNUstepBase/GSConfig.h>
194
 
#endif
195
 
 
196
 
#ifndef __has_feature
197
 
#define __has_feature(x) 0
198
 
#endif
199
 
 
200
 
/* The following is for deciding whether private instance variables
201
 
 * should be visible ... if we are building with a compiler which
202
 
 * does not define __has_feature then we know we don't have non-fragile
203
 
 * ivar support.
204
 
 * In the header we bracket instance variable declarations in a
205
 
 * '#if GS_EXPOSE(classname) ... #endif' sequence, so that the variables
206
 
 * will not be visible to code which uses the library.
207
 
 * In the source file we define EXPOSE_classname_IVARS to be 1
208
 
 * before including the header, so that the ivars are always available
209
 
 * in the class source itsself
210
 
 */
211
 
 
212
 
#if     GS_MIXEDABI
213
 
#  undef        GS_NONFRAGILE
214
 
#  define       GS_NONFRAGILE   0       /* Mixed is treated as fragile */
215
 
#else
216
 
#  if (__has_feature(objc_nonfragile_abi))
217
 
#    if !GS_NONFRAGILE
218
 
#      if       defined(GNUSTEP_BASE_INTERNAL)
219
 
#        error "You are building gnustep-base using the objc-nonfragile-abi but your gnustep-base was not configured to use it."
220
 
#      endif
221
 
#    endif
222
 
#  else
223
 
#    if GS_NONFRAGILE
224
 
#      error "Your gnustep-base was configured for the objc-nonfragile-abi but you are not using it now."
225
 
#    endif
226
 
#  endif
227
 
#endif
228
 
 
229
 
#define GS_EXPOSE(X)    (!GS_NONFRAGILE || defined(EXPOSE_##X##_IVARS))
230
 
 
231
 
 
232
 
 
233
 
 
234
 
#if     defined(GNUSTEP_WITH_DLL)
235
 
 
236
 
#if BUILD_libgnustep_base_DLL
237
 
#
238
 
# if defined(__MINGW__)
239
 
  /* On Mingw, the compiler will export all symbols automatically, so
240
 
   * __declspec(dllexport) is not needed.
241
 
   */
242
 
#  define GS_EXPORT  extern
243
 
#  define GS_DECLARE 
244
 
# else
245
 
#  define GS_EXPORT  __declspec(dllexport)
246
 
#  define GS_DECLARE __declspec(dllexport)
247
 
# endif
248
 
#else
249
 
#  define GS_EXPORT  extern __declspec(dllimport)
250
 
#  define GS_DECLARE __declspec(dllimport)
251
 
#endif
252
 
 
253
 
#else /* GNUSTEP_WITH[OUT]_DLL */
254
 
 
255
 
#  define GS_EXPORT extern
256
 
#  define GS_DECLARE 
257
 
 
258
 
#endif
259
 
 
260
 
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
261
 
#define GS_ATTRIB_DEPRECATED __attribute__ ((deprecated))
262
 
#else
263
 
#define GS_ATTRIB_DEPRECATED
264
 
#endif
265
 
 
266
 
 
267
 
#endif /* __GNUSTEP_GSVERSIONMACROS_H_INCLUDED_ */