Path: blob/master/venv/Lib/site-packages/lxml/includes/libxslt/win32config.h
811 views
/*1* Summary: Windows configuration header2* Description: Windows configuration header3*4* Copy: See Copyright for the status of this software.5*6* Author: Igor Zlatkovic7*/8#ifndef __LIBXSLT_WIN32_CONFIG__9#define __LIBXSLT_WIN32_CONFIG__1011#define HAVE_CTYPE_H 112#define HAVE_STDLIB_H 113#define HAVE_STDARG_H 114#define HAVE_MALLOC_H 115#define HAVE_TIME_H 116#define HAVE_LOCALTIME 117#define HAVE_GMTIME 118#define HAVE_TIME 119#define HAVE_MATH_H 120#define HAVE_FCNTL_H 12122#include <io.h>2324#define HAVE_ISINF25#define HAVE_ISNAN2627#include <math.h>28#if defined _MSC_VER || defined __MINGW32__29/* MS C-runtime has functions which can be used in order to determine if30a given floating-point variable contains NaN, (+-)INF. These are31preferred, because floating-point technology is considered propriatary32by MS and we can assume that their functions know more about their33oddities than we do. */34#include <float.h>35/* Bjorn Reese figured a quite nice construct for isinf() using the36_fpclass() function. */37#ifndef isinf38#define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \39: ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))40#endif41/* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */42#ifndef isnan43#define isnan(d) (_isnan(d))44#endif45#else /* _MSC_VER */46static int isinf (double d) {47int expon = 0;48double val = frexp (d, &expon);49if (expon == 1025) {50if (val == 0.5) {51return 1;52} else if (val == -0.5) {53return -1;54} else {55return 0;56}57} else {58return 0;59}60}61static int isnan (double d) {62int expon = 0;63double val = frexp (d, &expon);64if (expon == 1025) {65if (val == 0.5) {66return 0;67} else if (val == -0.5) {68return 0;69} else {70return 1;71}72} else {73return 0;74}75}76#endif /* _MSC_VER */7778#include <direct.h>7980/* snprintf emulation taken from http://stackoverflow.com/a/8712996/1956010 */81#if defined(_MSC_VER) && _MSC_VER < 19008283#include <stdarg.h>84#include <stdio.h>8586#define snprintf c99_snprintf87#define vsnprintf c99_vsnprintf8889__inline int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap)90{91int count = -1;9293if (size != 0)94count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap);95if (count == -1)96count = _vscprintf(format, ap);9798return count;99}100101__inline int c99_snprintf(char *outBuf, size_t size, const char *format, ...)102{103int count;104va_list ap;105106va_start(ap, format);107count = c99_vsnprintf(outBuf, size, format, ap);108va_end(ap);109110return count;111}112113#endif /* defined(_MSC_VER) && _MSC_VER < 1900 */114115#define HAVE_SYS_STAT_H116#define HAVE__STAT117#define HAVE_STRING_H118119#include <libxml/xmlversion.h>120121#ifndef ATTRIBUTE_UNUSED122#define ATTRIBUTE_UNUSED123#endif124125#define _WINSOCKAPI_126127#endif /* __LIBXSLT_WIN32_CONFIG__ */128129130131