Coin Logo http://www.sim.no
http://www.coin3d.org

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

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Wed Jul 23 2025 for Coin by Doxygen. 1.14.0