win32config.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * Summary: Windows configuration header
  3. * Description: Windows configuration header
  4. *
  5. * Copy: See Copyright for the status of this software.
  6. *
  7. * Author: Igor Zlatkovic
  8. */
  9. #ifndef __LIBXSLT_WIN32_CONFIG__
  10. #define __LIBXSLT_WIN32_CONFIG__
  11. #define HAVE_CTYPE_H 1
  12. #define HAVE_STDLIB_H 1
  13. #define HAVE_STDARG_H 1
  14. #define HAVE_MALLOC_H 1
  15. #define HAVE_TIME_H 1
  16. #define HAVE_LOCALTIME 1
  17. #define HAVE_GMTIME 1
  18. #define HAVE_TIME 1
  19. #define HAVE_MATH_H 1
  20. #define HAVE_FCNTL_H 1
  21. #include <io.h>
  22. #define HAVE_ISINF
  23. #define HAVE_ISNAN
  24. #include <math.h>
  25. #if defined _MSC_VER || defined __MINGW32__
  26. /* MS C-runtime has functions which can be used in order to determine if
  27. a given floating-point variable contains NaN, (+-)INF. These are
  28. preferred, because floating-point technology is considered propriatary
  29. by MS and we can assume that their functions know more about their
  30. oddities than we do. */
  31. #include <float.h>
  32. /* Bjorn Reese figured a quite nice construct for isinf() using the
  33. _fpclass() function. */
  34. #ifndef isinf
  35. #define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
  36. : ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))
  37. #endif
  38. /* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
  39. #ifndef isnan
  40. #define isnan(d) (_isnan(d))
  41. #endif
  42. #else /* _MSC_VER */
  43. static int isinf (double d) {
  44. int expon = 0;
  45. double val = frexp (d, &expon);
  46. if (expon == 1025) {
  47. if (val == 0.5) {
  48. return 1;
  49. } else if (val == -0.5) {
  50. return -1;
  51. } else {
  52. return 0;
  53. }
  54. } else {
  55. return 0;
  56. }
  57. }
  58. static int isnan (double d) {
  59. int expon = 0;
  60. double val = frexp (d, &expon);
  61. if (expon == 1025) {
  62. if (val == 0.5) {
  63. return 0;
  64. } else if (val == -0.5) {
  65. return 0;
  66. } else {
  67. return 1;
  68. }
  69. } else {
  70. return 0;
  71. }
  72. }
  73. #endif /* _MSC_VER */
  74. #include <direct.h>
  75. #if defined(_MSC_VER) || defined(__MINGW32__)
  76. #define mkdir(p,m) _mkdir(p)
  77. #define snprintf _snprintf
  78. #if _MSC_VER < 1500
  79. #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
  80. #endif
  81. #endif
  82. #define HAVE_SYS_STAT_H
  83. #define HAVE__STAT
  84. #define HAVE_STRING_H
  85. #include <libxml/xmlversion.h>
  86. #ifndef ATTRIBUTE_UNUSED
  87. #define ATTRIBUTE_UNUSED
  88. #endif
  89. #define _WINSOCKAPI_
  90. #endif /* __LIBXSLT_WIN32_CONFIG__ */