36 #include <Inventor/C/basic.h>
38 #include <Inventor/C/errors/debugerror.h>
46 #error You are not compiling C++ - maybe your source file is named <file>.c
68 inline Type SbAbs( Type Val ) {
69 return (Val < 0) ? 0 - Val : Val;
73 inline Type SbMax(
const Type A,
const Type B ) {
74 return (A < B) ? B : A;
78 inline Type SbMin(
const Type A,
const Type B ) {
79 return (A < B) ? A : B;
83 inline Type SbClamp(
const Type Val,
const Type Min,
const Type Max ) {
84 return (Val < Min) ? Min : (Val > Max) ? Max : Val;
88 inline void SbSwap( Type & A, Type & B ) {
89 Type T; T = A; A = B; B = T;
93 inline Type SbSqr(
const Type val) {
107 #include <Inventor/C/errors/debugerror.h>
112 template <
typename Type>
113 inline void SbDividerChk(
const char * funcname, Type divider) {
114 if (!(divider != static_cast<Type>(0)))
115 cc_debugerror_post(funcname,
"divide by zero error.", divider);
118 template <
typename Type>
119 inline void SbDividerChk(
const char *, Type) {}
162 #define SUN_CC_4_0_SOTYPE_INIT_BUG 0
164 #if SUN_CC_4_0_SOTYPE_INIT_BUG
165 #define STATIC_SOTYPE_INIT
167 #define STATIC_SOTYPE_INIT = SoType::badType()
178 #ifdef _MSC_VER // Microsoft Visual C++
180 __pragma(warning(push)) \
181 __pragma(warning(disable:4127)) \
183 __pragma(warning(pop))
185 #define WHILE_0 while (0)