Open Dynamics Engine
|
00001 #ifndef ODECONFIG_H 00002 #define ODECONFIG_H 00003 00004 /* Pull in the standard headers */ 00005 #include <stddef.h> 00006 #include <limits.h> 00007 #include <stdio.h> 00008 #include <stdlib.h> 00009 #include <stdarg.h> 00010 #include <math.h> 00011 #include <string.h> 00012 #include <float.h> 00013 00014 00015 #if defined(ODE_DLL) || defined(ODE_LIB) 00016 #define __ODE__ 00017 #endif 00018 00019 /* Define a DLL export symbol for those platforms that need it */ 00020 #if defined(_MSC_VER) 00021 #if defined(ODE_DLL) 00022 #define ODE_API __declspec(dllexport) 00023 #elif !defined(ODE_LIB) 00024 #define ODE_DLL_API __declspec(dllimport) 00025 #endif 00026 #endif 00027 00028 #if !defined(ODE_API) 00029 #define ODE_API 00030 #endif 00031 00032 #if defined(_MSC_VER) 00033 # define ODE_API_DEPRECATED __declspec(deprecated) 00034 #elif defined (__GNUC__) && ( (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)) ) 00035 # define ODE_API_DEPRECATED __attribute__((__deprecated__)) 00036 #else 00037 # define ODE_API_DEPRECATED 00038 #endif 00039 00040 /* Well-defined common data types...need to define for 64 bit systems */ 00041 #if defined(_M_IA64) || defined(__ia64__) || defined(_M_AMD64) || defined(__x86_64__) 00042 #define X86_64_SYSTEM 1 00043 typedef int int32; 00044 typedef unsigned int uint32; 00045 typedef short int16; 00046 typedef unsigned short uint16; 00047 typedef signed char int8; 00048 typedef unsigned char uint8; 00049 #else 00050 typedef int int32; 00051 typedef unsigned int uint32; 00052 typedef short int16; 00053 typedef unsigned short uint16; 00054 typedef signed char int8; 00055 typedef unsigned char uint8; 00056 #endif 00057 00058 /* Visual C does not define these functions */ 00059 #if defined(_MSC_VER) 00060 #define copysignf(x, y) ((float)_copysign(x, y)) 00061 #define copysign(x, y) _copysign(x, y) 00062 #define nextafterf(x, y) _nextafterf(x, y) 00063 #define nextafter(x, y) _nextafter(x, y) 00064 #if !defined(_WIN64) 00065 #define _ODE__NEXTAFTERF_REQUIRED 00066 #endif 00067 #endif 00068 00069 00070 00071 /* Define the dInfinity macro */ 00072 #ifdef INFINITY 00073 #define dInfinity INFINITY 00074 #elif defined(HUGE_VAL) 00075 #ifdef dSINGLE 00076 #ifdef HUGE_VALF 00077 #define dInfinity HUGE_VALF 00078 #else 00079 #define dInfinity ((float)HUGE_VAL) 00080 #endif 00081 #else 00082 #define dInfinity HUGE_VAL 00083 #endif 00084 #else 00085 #ifdef dSINGLE 00086 #define dInfinity ((float)(1.0/0.0)) 00087 #else 00088 #define dInfinity (1.0/0.0) 00089 #endif 00090 #endif 00091 00092 00093 #endif