odeconfig.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #ifndef ODECONFIG_H
  2. #define ODECONFIG_H
  3. /* Pull in the standard headers */
  4. #include <stddef.h>
  5. #include <limits.h>
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <stdarg.h>
  9. #include <math.h>
  10. #include <string.h>
  11. #include <float.h>
  12. #if defined(ODE_DLL) || defined(ODE_LIB)
  13. #define __ODE__
  14. #endif
  15. /* Define a DLL export symbol for those platforms that need it */
  16. #if defined(_MSC_VER)
  17. #if defined(ODE_DLL)
  18. #define ODE_API __declspec(dllexport)
  19. #elif !defined(ODE_LIB)
  20. #define ODE_DLL_API __declspec(dllimport)
  21. #endif
  22. #endif
  23. #if !defined(ODE_API)
  24. #define ODE_API
  25. #endif
  26. #if defined(_MSC_VER)
  27. # define ODE_API_DEPRECATED __declspec(deprecated)
  28. #elif defined (__GNUC__) && ( (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)) )
  29. # define ODE_API_DEPRECATED __attribute__((__deprecated__))
  30. #else
  31. # define ODE_API_DEPRECATED
  32. #endif
  33. /* Well-defined common data types...need to define for 64 bit systems */
  34. #if defined(_M_IA64) || defined(__ia64__) || defined(_M_AMD64) || defined(__x86_64__)
  35. #define X86_64_SYSTEM 1
  36. typedef int int32;
  37. typedef unsigned int uint32;
  38. typedef short int16;
  39. typedef unsigned short uint16;
  40. typedef signed char int8;
  41. typedef unsigned char uint8;
  42. #else
  43. typedef int int32;
  44. typedef unsigned int uint32;
  45. typedef short int16;
  46. typedef unsigned short uint16;
  47. typedef signed char int8;
  48. typedef unsigned char uint8;
  49. #endif
  50. /* Visual C does not define these functions */
  51. #if defined(_MSC_VER)
  52. #define copysignf(x, y) ((float)_copysign(x, y))
  53. #define copysign(x, y) _copysign(x, y)
  54. #define nextafterf(x, y) _nextafterf(x, y)
  55. #define nextafter(x, y) _nextafter(x, y)
  56. #if !defined(_WIN64)
  57. #define _ODE__NEXTAFTERF_REQUIRED
  58. #endif
  59. #endif
  60. /* Define the dInfinity macro */
  61. #ifdef INFINITY
  62. #define dInfinity INFINITY
  63. #elif defined(HUGE_VAL)
  64. #ifdef dSINGLE
  65. #ifdef HUGE_VALF
  66. #define dInfinity HUGE_VALF
  67. #else
  68. #define dInfinity ((float)HUGE_VAL)
  69. #endif
  70. #else
  71. #define dInfinity HUGE_VAL
  72. #endif
  73. #else
  74. #ifdef dSINGLE
  75. #define dInfinity ((float)(1.0/0.0))
  76. #else
  77. #define dInfinity (1.0/0.0)
  78. #endif
  79. #endif
  80. #endif