win32config.h

Go to the documentation of this file.
00001 #ifndef __LIBXML_WIN32_CONFIG__
00002 #define __LIBXML_WIN32_CONFIG__
00003 
00004 #define HAVE_CTYPE_H
00005 #define HAVE_STDARG_H
00006 #define HAVE_MALLOC_H
00007 #define HAVE_ERRNO_H
00008 
00009 #ifdef _WIN32_WCE
00010 #undef HAVE_ERRNO_H
00011 #include <windows.h>
00012 #include "wincecompat.h"
00013 #else
00014 #define HAVE_SYS_STAT_H
00015 #define HAVE__STAT
00016 #define HAVE_STAT
00017 #define HAVE_STDLIB_H
00018 #define HAVE_TIME_H
00019 #define HAVE_FCNTL_H
00020 #include <io.h>
00021 #include <direct.h>
00022 #endif
00023 
00024 #include <libxml/xmlversion.h>
00025 
00026 #ifdef NEED_SOCKETS
00027 #include <wsockcompat.h>
00028 #endif
00029 
00030 #define HAVE_ISINF
00031 #define HAVE_ISNAN
00032 #include <math.h>
00033 #if defined(_MSC_VER) || defined(__BORLANDC__)
00034 /* MS C-runtime has functions which can be used in order to determine if
00035    a given floating-point variable contains NaN, (+-)INF. These are 
00036    preferred, because floating-point technology is considered propriatary
00037    by MS and we can assume that their functions know more about their 
00038    oddities than we do. */
00039 #include <float.h>
00040 /* Bjorn Reese figured a quite nice construct for isinf() using the _fpclass
00041    function. */
00042 #ifndef isinf
00043 #define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
00044     : ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))
00045 #endif
00046 /* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
00047 #ifndef isnan
00048 #define isnan(d) (_isnan(d))
00049 #endif
00050 #else /* _MSC_VER */
00051 #ifndef isinf
00052 static int isinf (double d) {
00053     int expon = 0;
00054     double val = frexp (d, &expon);
00055     if (expon == 1025) {
00056         if (val == 0.5) {
00057             return 1;
00058         } else if (val == -0.5) {
00059             return -1;
00060         } else {
00061             return 0;
00062         }
00063     } else {
00064         return 0;
00065     }
00066 }
00067 #endif
00068 #ifndef isnan
00069 static int isnan (double d) {
00070     int expon = 0;
00071     double val = frexp (d, &expon);
00072     if (expon == 1025) {
00073         if (val == 0.5) {
00074             return 0;
00075         } else if (val == -0.5) {
00076             return 0;
00077         } else {
00078             return 1;
00079         }
00080     } else {
00081         return 0;
00082     }
00083 }
00084 #endif
00085 #endif /* _MSC_VER */
00086 
00087 #if defined(_MSC_VER)
00088 #define mkdir(p,m) _mkdir(p)
00089 #define snprintf _snprintf
00090 #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
00091 #elif defined(__MINGW32__)
00092 #define mkdir(p,m) _mkdir(p)
00093 #endif
00094 
00095 /* Threading API to use should be specified here for compatibility reasons.
00096    This is however best specified on the compiler's command-line. */
00097 #if defined(LIBXML_THREAD_ENABLED)
00098 #if !defined(HAVE_PTHREAD_H) && !defined(HAVE_WIN32_THREADS)
00099 #define HAVE_WIN32_THREADS
00100 #endif
00101 #endif
00102 
00103 /* Some third-party libraries far from our control assume the following
00104    is defined, which it is not if we don't include windows.h. */
00105 #if !defined(FALSE)
00106 #define FALSE 0
00107 #endif
00108 #if !defined(TRUE)
00109 #define TRUE (!(FALSE))
00110 #endif
00111 
00112 #endif /* __LIBXML_WIN32_CONFIG__ */
00113 
footer
 SourceForge.net Logo