Coin Logo http://www.coin3d.org/
http://www.kongsberg.com/kogt/

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

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

Generated for Coin by Doxygen