basic.h Source File

| http://www.sim.no/ http://www.coin3d.org/

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

basic.h
1 /* include/Inventor/C/basic.h. Generated from basic.h.in by configure. */
2 /**************************************************************************\
3 *
4 * This file is part of the Coin 3D visualization library.
5 * Copyright (C) by Kongsberg Oil & Gas Technologies.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * ("GPL") version 2 as published by the Free Software Foundation.
10 * See the file LICENSE.GPL at the root directory of this source
11 * distribution for additional information about the GNU GPL.
12 *
13 * For using Coin with software that can not be combined with the GNU
14 * GPL, and for taking advantage of the additional benefits of our
15 * support services, please contact Kongsberg Oil & Gas Technologies
16 * about acquiring a Coin Professional Edition License.
17 *
18 * See http://www.coin3d.org/ for more information.
19 *
20 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
21 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
22 *
23 \**************************************************************************/
24
25 #ifndef COIN_BASIC_H
26 #define COIN_BASIC_H
27
28 /*
29 NOTE: basic.h is automatically generated from basic.h.in, so don't
30 edit basic.h directly.
31 */
32
33 /* *********************************************************************** */
34
35 /* Documented for Doxygen in SoDB.cpp. */
36 typedef int SbBool;
37
38 #ifdef DOXYGEN_SKIP_THIS
39 #ifndef USE_STATIC_CONSTS
40 /*
41 Using static consts might have some problems with merging on older
42 compilers, so lie for doxygen for now, this is tested and found
43 working on GCC 4.(1-3)
44 */
45 #define USE_STATIC_CONSTS
46 #endif //USE_STATIC_CONSTS
47 #endif //DOXYGEN_SKIP_THIS
48
49 #ifndef FALSE
50 #ifdef USE_STATIC_CONSTS
51 static const SbBool FALSE = 0;
52 #else
53 #define FALSE 0
54 #endif //USE_STATIC_CONSTS
55 #endif /* !FALSE */
56
57 #ifndef TRUE
58 #ifdef USE_STATIC_CONSTS
59 static const SbBool TRUE = 1;
60 #else
61 #define TRUE 1
62 #endif //USE_STATIC_CONSTS
63 #endif /* !TRUE */
64
65 /* *********************************************************************** */
66
67 /* Ye good olde min/max macros. No library would be complete without them. */
68
69 #define cc_min(x, y) (((x) < (y)) ? (x) : (y))
70 #define cc_max(x, y) (((x) > (y)) ? (x) : (y))
71
72 /* *********************************************************************** */
73
74 /* Include this to 1) be compatible with Open Inventor's SbBasic.h, 2)
75 * provide a way for application programmers to get hold of the type
76 * definitions without explicitly including inttypes.h.
77 *
78 * The latter point is important because the inttypes.h file in SGI
79 * and TGS Open Inventor is placed _below_ the Inventor/ directory in
80 * the header files hierarchy. This is a stupid thing to do because it
81 * could easily conflict with the inttypes.h file installed as part of
82 * the C library on many systems (like GNU/Linux's glibc, for
83 * instance).
84 */
85 #include <Inventor/system/inttypes.h>
86
87 /* Internal note for Coin developers: in other sourcefiles in Coin, we
88 * depend on math.h being included through SbBasic.h. It is done this
89 * way to always make sure we have the M_* symbols available under
90 * MSWin (see below). So don't remove the following line unless you
91 * know very well what you are doing.
92 */
93 #include <math.h>
94
95 /* Define misc values if they are not available from math.h. UNIX
96 * systems typically have these defines, and MSWindows systems don't.
97 */
98 #ifndef M_E
99 #define M_E 2.7182818284590452354
100 #endif /* !M_E */
101 #ifndef M_LOG2E
102 #define M_LOG2E 1.4426950408889634074
103 #endif /* !M_LOG2E */
104 #ifndef M_LOG10E
105 #define M_LOG10E 0.43429448190325182765
106 #endif /* !M_LOG10E */
107 #ifndef M_LN2
108 #define M_LN2 0.69314718055994530942
109 #endif /* !M_LN2 */
110 #ifndef M_LN10
111 #define M_LN10 2.30258509299404568402
112 #endif /* !M_LN10 */
113 #ifndef M_PI
114 #define M_PI 3.14159265358979323846
115 #endif /* !M_PI */
116 #ifndef M_TWOPI
117 #define M_TWOPI (M_PI * 2.0)
118 #endif /* !M_TWOPI */
119 #ifndef M_PI_2
120 #define M_PI_2 1.57079632679489661923
121 #endif /* !M_PI_2 */
122 #ifndef M_PI_4
123 #define M_PI_4 0.78539816339744830962
124 #endif /* !M_PI_4 */
125 #ifndef M_3PI_4
126 #define M_3PI_4 2.3561944901923448370E0
127 #endif /* !M_3PI_4 */
128 #ifndef M_SQRTPI
129 #define M_SQRTPI 1.77245385090551602792981
130 #endif /* !M_SQRTPI */
131 #ifndef M_1_PI
132 #define M_1_PI 0.31830988618379067154
133 #endif /* !M_1_PI */
134 #ifndef M_2_PI
135 #define M_2_PI 0.63661977236758134308
136 #endif /* !M_2_PI */
137 #ifndef M_2_SQRTPI
138 #define M_2_SQRTPI 1.12837916709551257390
139 #endif /* !M_2_SQRTPI */
140 #ifndef M_SQRT2
141 #define M_SQRT2 1.41421356237309504880
142 #endif /* !M_SQRT2 */
143 #ifndef M_SQRT1_2
144 #define M_SQRT1_2 0.70710678118654752440
145 #endif /* !M_SQRT1_2 */
146 #ifndef M_LN2LO
147 #define M_LN2LO 1.9082149292705877000E-10
148 #endif /* !M_LN2LO */
149 #ifndef M_LN2HI
150 #define M_LN2HI 6.9314718036912381649E-1
151 #endif /* !M_LN2HI */
152 #ifndef M_SQRT3
153 #define M_SQRT3 1.73205080756887719000
154 #endif /* !M_SQRT3 */
155 #ifndef M_IVLN10
156 #define M_IVLN10 0.43429448190325182765 /* 1 / log(10) */
157 #endif /* !M_IVLN10 */
158 #ifndef M_LOG2_E
159 #define M_LOG2_E 0.693147180559945309417
160 #endif /* !M_LOG2_E */
161 #ifndef M_INVLN2
162 #define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */
163 #endif /* !M_INVLN2 */
164
165 /* *********************************************************************** */
166
167 /* A unique identifier to recognize whether or not we're running under
168 * Kongsberg Oil & Gas Technologies Coin library.
169 */
170 #define __COIN__
171
172 /* The following #undef'ed defines are automatically defined and
173 * synchronized with the settings in configure.in when ``configure''
174 * is executed.
175 *
176 * The #ifndef wrapper is necessary because during development, these
177 * are also defined in the config.h file generated by ``configure''.
178 */
179 #ifndef COIN_VERSION
180
181 /* These are available for adding or omitting features based on Coin
182 * version numbers in client application sources. */
183 #define COIN_MAJOR_VERSION 3
184 #define COIN_MINOR_VERSION 1
185 #define COIN_MICRO_VERSION 3
186 /* #undef COIN_BETA_VERSION */
187 #define COIN_VERSION "3.1.3"
188
189 /* This define is set by the configure script if singleprecision math
190 functions are available from the C library API headers. */
191 /* #undef HAVE_SINGLEPRECISION_MATH */
192
193 /* Most compilers should have "hash quoting", as it is part of the
194 ANSI standard. */
195 #define HAVE_HASH_QUOTING 1
196 /* #undef HAVE_APOSTROPHES_QUOTING */
197
198 /* IN_PATH define in HPUX's sys/unistd.h conflicts with SoAction::IN_PATH */
199 /* #undef COIN_UNDEF_IN_PATH_HACK */
200
201 #endif /* !COIN_VERSION */ /* Ends configure-generated defines. */
202
203 /* *********************************************************************** */
204
205 /* The float-version of the math functions below did not come about
206 until C99, so we don't want to use them internally, for portability
207 reasons. */
208 #ifdef COIN_INTERNAL
209 #include <Inventor/C/base/math-undefs.h>
210 #endif /* COIN_INTERNAL */
211
212 /* *********************************************************************** */
213
214 /* SO__QUOTE(str) - use the preprocessor to quote a string.
215 * SO__CONCAT(str1,str2) - use the preprocessor to concatenate two strings.
216 */
217
218 #ifdef HAVE_HASH_QUOTING
219 #define SO__QUOTE(str) #str
220 #define SO__CONCAT(str1, str2) str1##str2
221 #elif defined(HAVE_APOSTROPHES_QUOTING)
222 #define SO__QUOTE(str) "str"
223 #define SO__CONCAT(str1, str2) str1str2
224 #else
225 #error No valid way to do macro quoting!
226 #endif
227
228 /* *********************************************************************** */
229
230 /* Precaution to avoid an some errors easily made by the application
231 programmer. */
232 #ifdef COIN_DLL_API
233 # error Leave the internal COIN_DLL_API define alone.
234 #endif /* COIN_DLL_API */
235 #ifdef COIN_INTERNAL
236 # ifdef COIN_NOT_DLL
237 # error The COIN_NOT_DLL define is not supposed to be used when building the library, only when building Win32 applications.
238 # endif /* COIN_INTERNAL && COIN_NOT_DLL */
239 # ifdef COIN_DLL
240 # error The COIN_DLL define is not supposed to be used when building the library, only when building Win32 applications.
241 # endif /* COIN_INTERNAL && COIN_DLL */
242 #endif /* COIN_INTERNAL */
243
244 /*
245 On MSWindows platforms, one of these defines must always be set when
246 building application programs:
247
248 - "COIN_DLL", when the application programmer is using the library
249 in the form of a dynamic link library (DLL)
250
251 - "COIN_NOT_DLL", when the application programmer is using the
252 library in the form of a static object library (LIB)
253
254 Note that either COIN_DLL or COIN_NOT_DLL _must_ be defined by the
255 application programmer on MSWindows platforms, or else the #error
256 statement will hit. Set up one or the other of these two defines in
257 your compiler environment according to how the library was built --
258 as a DLL (use "COIN_DLL") or as a LIB (use "COIN_NOT_DLL").
259
260 (Setting up defines for the compiler is typically done by either
261 adding something like "/DCOIN_DLL" to the compiler's argument line
262 (for command-line build processes), or by adding the define to the
263 list of preprocessor symbols in your IDE GUI (in the MSVC IDE, this
264 is done from the "Project"->"Settings" menu, choose the "C/C++" tab,
265 then "Preprocessor" from the dropdown box and add the appropriate
266 define)).
267
268 It is extremely important that the application programmer uses the
269 correct define, as using "COIN_NOT_DLL" when "COIN_DLL" is correct
270 will cause mysterious crashes.
271 */
272 /* FIXME: use a feature check to see if this is a platform which can
273 recognize the __declspec keyword instead of the crap #if below.
274 20011201 mortene. */
275 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
276 # ifdef COIN_INTERNAL
277 # ifdef COIN_MAKE_DLL
278 # define COIN_DLL_API __declspec(dllexport)
279 # endif /* COIN_MAKE_DLL */
280 # else /* !COIN_INTERNAL */
281 # ifdef COIN_DLL
282 # ifdef COIN_NOT_DLL
283 # error Define _either_ COIN_DLL _or_ COIN_NOT_DLL as appropriate for your linkage -- not both at the same time! See Inventor/C/basic.h for further instructions.
284 # endif /* COIN_NOT_DLL */
285 # define COIN_DLL_API __declspec(dllimport)
286 # else /* !COIN_DLL */
287 # ifndef COIN_NOT_DLL
288 # error Define either COIN_DLL or COIN_NOT_DLL as appropriate for your linkage! See Inventor/C/basic.h for further instructions.
289 # endif /* !COIN_NOT_DLL */
290 # endif /* !COIN_DLL */
291 # endif /* !COIN_INTERNAL */
292 #endif /* Microsoft Windows */
293
294 /* Empty define to avoid errors when _not_ compiling an MSWindows DLL. */
295 #ifndef COIN_DLL_API
296 # define COIN_DLL_API
297 #endif /* !COIN_DLL_API */
298
299 #endif /* !COIN_BASIC_H */

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.