![]() |
http://www.sim.no http://www.coin3d.org |
00001 /* include/Inventor/C/basic.h. Generated by configure. */ 00002 /**************************************************************************\ 00003 * 00004 * This file is part of the Coin 3D visualization library. 00005 * Copyright (C) 1998-2005 by Systems in Motion. All rights reserved. 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * ("GPL") version 2 as published by the Free Software Foundation. 00010 * See the file LICENSE.GPL at the root directory of this source 00011 * distribution for additional information about the GNU GPL. 00012 * 00013 * For using Coin with software that can not be combined with the GNU 00014 * GPL, and for taking advantage of the additional benefits of our 00015 * support services, please contact Systems in Motion about acquiring 00016 * a Coin Professional Edition License. 00017 * 00018 * See <URL:http://www.coin3d.org/> for more information. 00019 * 00020 * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY. 00021 * <URL:http://www.sim.no/>. 00022 * 00023 \**************************************************************************/ 00024 00025 #ifndef COIN_BASIC_H 00026 #define COIN_BASIC_H 00027 00028 /* 00029 NOTE: basic.h is automatically generated from basic.h.in, so don't 00030 edit basic.h directly. 00031 */ 00032 00033 /* *********************************************************************** */ 00034 00035 /* Documented for Doxygen in SoDB.cpp. */ 00036 typedef int SbBool; 00037 00038 #ifndef FALSE 00039 #define FALSE 0 00040 #endif /* !FALSE */ 00041 #ifndef TRUE 00042 #define TRUE 1 00043 #endif /* !TRUE */ 00044 00045 /* *********************************************************************** */ 00046 00047 /* Ye good olde min/max macros. No library would be complete without them. */ 00048 00049 #define cc_min(x, y) (((x) < (y)) ? (x) : (y)) 00050 #define cc_max(x, y) (((x) > (y)) ? (x) : (y)) 00051 00052 /* *********************************************************************** */ 00053 00054 /* Include this to 1) be compatible with Open Inventor's SbBasic.h, 2) 00055 * provide a way for application programmers to get hold of the type 00056 * definitions without explicitly including inttypes.h. 00057 * 00058 * The latter point is important because the inttypes.h file in SGI 00059 * and TGS Open Inventor is placed _below_ the Inventor/ directory in 00060 * the header files hierarchy. This is a stupid thing to do because it 00061 * could easily conflict with the inttypes.h file installed as part of 00062 * the C library on many systems (like GNU/Linux's glibc, for 00063 * instance). 00064 */ 00065 #include <Inventor/system/inttypes.h> 00066 00067 /* Internal note for Coin developers: in other sourcefiles in Coin, we 00068 * depend on math.h being included through SbBasic.h. It is done this 00069 * way to always make sure we have the M_* symbols available under 00070 * MSWin (see below). So don't remove the following line unless you 00071 * know very well what you are doing. 00072 */ 00073 #include <math.h> 00074 00075 /* Define misc values if they are not available from math.h. UNIX 00076 * systems typically have these defines, and MSWindows systems don't. 00077 */ 00078 #ifndef M_E 00079 #define M_E 2.7182818284590452354 00080 #endif /* !M_E */ 00081 #ifndef M_LOG2E 00082 #define M_LOG2E 1.4426950408889634074 00083 #endif /* !M_LOG2E */ 00084 #ifndef M_LOG10E 00085 #define M_LOG10E 0.43429448190325182765 00086 #endif /* !M_LOG10E */ 00087 #ifndef M_LN2 00088 #define M_LN2 0.69314718055994530942 00089 #endif /* !M_LN2 */ 00090 #ifndef M_LN10 00091 #define M_LN10 2.30258509299404568402 00092 #endif /* !M_LN10 */ 00093 #ifndef M_PI 00094 #define M_PI 3.14159265358979323846 00095 #endif /* !M_PI */ 00096 #ifndef M_TWOPI 00097 #define M_TWOPI (M_PI * 2.0) 00098 #endif /* !M_TWOPI */ 00099 #ifndef M_PI_2 00100 #define M_PI_2 1.57079632679489661923 00101 #endif /* !M_PI_2 */ 00102 #ifndef M_PI_4 00103 #define M_PI_4 0.78539816339744830962 00104 #endif /* !M_PI_4 */ 00105 #ifndef M_3PI_4 00106 #define M_3PI_4 2.3561944901923448370E0 00107 #endif /* !M_3PI_4 */ 00108 #ifndef M_SQRTPI 00109 #define M_SQRTPI 1.77245385090551602792981 00110 #endif /* !M_SQRTPI */ 00111 #ifndef M_1_PI 00112 #define M_1_PI 0.31830988618379067154 00113 #endif /* !M_1_PI */ 00114 #ifndef M_2_PI 00115 #define M_2_PI 0.63661977236758134308 00116 #endif /* !M_2_PI */ 00117 #ifndef M_2_SQRTPI 00118 #define M_2_SQRTPI 1.12837916709551257390 00119 #endif /* !M_2_SQRTPI */ 00120 #ifndef M_SQRT2 00121 #define M_SQRT2 1.41421356237309504880 00122 #endif /* !M_SQRT2 */ 00123 #ifndef M_SQRT1_2 00124 #define M_SQRT1_2 0.70710678118654752440 00125 #endif /* !M_SQRT1_2 */ 00126 #ifndef M_LN2LO 00127 #define M_LN2LO 1.9082149292705877000E-10 00128 #endif /* !M_LN2LO */ 00129 #ifndef M_LN2HI 00130 #define M_LN2HI 6.9314718036912381649E-1 00131 #endif /* !M_LN2HI */ 00132 #ifndef M_SQRT3 00133 #define M_SQRT3 1.73205080756887719000 00134 #endif /* !M_SQRT3 */ 00135 #ifndef M_IVLN10 00136 #define M_IVLN10 0.43429448190325182765 /* 1 / log(10) */ 00137 #endif /* !M_IVLN10 */ 00138 #ifndef M_LOG2_E 00139 #define M_LOG2_E 0.693147180559945309417 00140 #endif /* !M_LOG2_E */ 00141 #ifndef M_INVLN2 00142 #define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */ 00143 #endif /* !M_INVLN2 */ 00144 00145 /* *********************************************************************** */ 00146 00147 /* A unique identifier to recognize whether or not we're running under 00148 * Systems in Motion's Coin library. 00149 */ 00150 #define __COIN__ 00151 00152 /* The following #undef'ed defines are automatically defined and 00153 * synchronized with the settings in configure.in when ``configure'' 00154 * is executed. 00155 * 00156 * The #ifndef wrapper is necessary because during development, these 00157 * are also defined in the config.h file generated by ``configure''. 00158 */ 00159 #ifndef COIN_VERSION 00160 00161 /* These are available for adding or omitting features based on Coin 00162 * version numbers in client application sources. */ 00163 #define COIN_MAJOR_VERSION 2 00164 #define COIN_MINOR_VERSION 4 00165 #define COIN_MICRO_VERSION 4 00166 /* #undef COIN_BETA_VERSION */ 00167 #define COIN_VERSION "2.4.4" 00168 00169 /* This define is set by the configure script if singleprecision math 00170 functions are available from the C library API headers. */ 00171 #define HAVE_SINGLEPRECISION_MATH 1 00172 00173 /* Most compilers should have "hash quoting", as it is part of the 00174 ANSI standard. */ 00175 #define HAVE_HASH_QUOTING 1 00176 /* #undef HAVE_APOSTROPHES_QUOTING */ 00177 00178 /* IN_PATH define in HPUX's sys/unistd.h conflicts with SoAction::IN_PATH */ 00179 /* #undef COIN_UNDEF_IN_PATH_HACK */ 00180 00181 /* This define is wrapped around new features in development that will 00182 be introduced with the next minor release. Don't switch this define 00183 without rebuilding the library - just switching it for an installed 00184 library will just bring the header files out of sync with the library, 00185 causing a bunch of problems. */ 00186 /* #undef COIN_NEXT_MINOR */ 00187 00188 #endif /* !COIN_VERSION */ /* Ends configure-generated defines. */ 00189 00190 /* *********************************************************************** */ 00191 00192 #ifndef HAVE_SINGLEPRECISION_MATH 00193 /* If singleprecision math functions are missing, define them to their 00194 doubleprecision counterparts. This is done to be consistent with 00195 SbBasic.h in Open Inventor (application programmers might rely on 00196 the float-versions being set up from the Inventor SbBasic.h). 00197 When Coin is used together with other libraries, those libraries may 00198 also define some of these, so we try to avoid #define conflicts by 00199 wrapping each define. */ 00200 #ifndef cosf 00201 #define cosf(x) ((float)cos(x)) 00202 #endif /* !cosf */ 00203 #ifndef sinf 00204 #define sinf(x) ((float)sin(x)) 00205 #endif /* !sinf */ 00206 #ifndef tanf 00207 #define tanf(x) ((float)tan(x)) 00208 #endif /* !tanf */ 00209 #ifndef powf 00210 #define powf(x, y) ((float)pow(x, y)) 00211 #endif /* !powf */ 00212 #ifndef sqrtf 00213 #define sqrtf(x) ((float)sqrt(x)) 00214 #endif /* !sqrtf */ 00215 #ifndef acosf 00216 #define acosf(x) ((float)acos(x)) 00217 #endif /* !acosf */ 00218 #ifndef asinf 00219 #define asinf(x) ((float)asin(x)) 00220 #endif /* !asinf */ 00221 #ifndef atanf 00222 #define atanf(x) ((float)atan(x)) 00223 #endif /* !atanf */ 00224 #ifndef atan2f 00225 #define atan2f(x, y) ((float)atan2(x, y)) 00226 #endif /* !atan2f */ 00227 #endif /* HAVE_SINGLEPRECISION_MATH */ 00228 00229 /* *********************************************************************** */ 00230 00231 /* SO__QUOTE(str) - use the preprocessor to quote a string. 00232 * SO__CONCAT(str1,str2) - use the preprocessor to concatenate two strings. 00233 */ 00234 00235 #ifdef HAVE_HASH_QUOTING 00236 #define SO__QUOTE(str) #str 00237 #define SO__CONCAT(str1, str2) str1##str2 00238 #elif defined(HAVE_APOSTROPHES_QUOTING) 00239 #define SO__QUOTE(str) "str" 00240 #define SO__CONCAT(str1, str2) str1str2 00241 #else 00242 #error No valid way to do macro quoting! 00243 #endif 00244 00245 /* *********************************************************************** */ 00246 00247 /* Precaution to avoid an some errors easily made by the application 00248 programmer. */ 00249 #ifdef COIN_DLL_API 00250 # error Leave the internal COIN_DLL_API define alone. 00251 #endif /* COIN_DLL_API */ 00252 #ifdef COIN_INTERNAL 00253 # ifdef COIN_NOT_DLL 00254 # error The COIN_NOT_DLL define is not supposed to be used when building the library, only when building Win32 applications. 00255 # endif /* COIN_INTERNAL && COIN_NOT_DLL */ 00256 # ifdef COIN_DLL 00257 # error The COIN_DLL define is not supposed to be used when building the library, only when building Win32 applications. 00258 # endif /* COIN_INTERNAL && COIN_DLL */ 00259 #endif /* COIN_INTERNAL */ 00260 00261 /* 00262 On MSWindows platforms, one of these defines must always be set when 00263 building application programs: 00264 00265 - "COIN_DLL", when the application programmer is using the library 00266 in the form of a dynamic link library (DLL) 00267 00268 - "COIN_NOT_DLL", when the application programmer is using the 00269 library in the form of a static object library (LIB) 00270 00271 Note that either COIN_DLL or COIN_NOT_DLL _must_ be defined by the 00272 application programmer on MSWindows platforms, or else the #error 00273 statement will hit. Set up one or the other of these two defines in 00274 your compiler environment according to how the library was built -- 00275 as a DLL (use "COIN_DLL") or as a LIB (use "COIN_NOT_DLL"). 00276 00277 (Setting up defines for the compiler is typically done by either 00278 adding something like "/DCOIN_DLL" to the compiler's argument line 00279 (for command-line build processes), or by adding the define to the 00280 list of preprocessor symbols in your IDE GUI (in the MSVC IDE, this 00281 is done from the "Project"->"Settings" menu, choose the "C/C++" tab, 00282 then "Preprocessor" from the dropdown box and add the appropriate 00283 define)). 00284 00285 It is extremely important that the application programmer uses the 00286 correct define, as using "COIN_NOT_DLL" when "COIN_DLL" is correct 00287 will cause mysterious crashes. 00288 */ 00289 /* FIXME: use a feature check to see if this is a platform which can 00290 recognize the __declspec keyword instead of the crap #if below. 00291 20011201 mortene. */ 00292 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) 00293 # ifdef COIN_INTERNAL 00294 # ifdef COIN_MAKE_DLL 00295 # define COIN_DLL_API __declspec(dllexport) 00296 # endif /* COIN_MAKE_DLL */ 00297 # else /* !COIN_INTERNAL */ 00298 # ifdef COIN_DLL 00299 # ifdef COIN_NOT_DLL 00300 # 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. 00301 # endif /* COIN_NOT_DLL */ 00302 # define COIN_DLL_API __declspec(dllimport) 00303 # else /* !COIN_DLL */ 00304 # ifndef COIN_NOT_DLL 00305 # error Define either COIN_DLL or COIN_NOT_DLL as appropriate for your linkage! See Inventor/C/basic.h for further instructions. 00306 # endif /* !COIN_NOT_DLL */ 00307 # endif /* !COIN_DLL */ 00308 # endif /* !COIN_INTERNAL */ 00309 #endif /* Microsoft Windows */ 00310 00311 /* Empty define to avoid errors when _not_ compiling an MSWindows DLL. */ 00312 #ifndef COIN_DLL_API 00313 # define COIN_DLL_API 00314 #endif /* !COIN_DLL_API */ 00315 00316 #endif /* !COIN_BASIC_H */
Copyright © 1998-2005 by Systems in Motion AS. All rights reserved.
Generated on Wed May 3 11:18:16 2006 for Coin by Doxygen. 1.4.6