1 // Windows-specific code, include with:
\r
3 // #include <msvc_compat.h>
\r
6 //#define _CRT_SECURE_NO_WARNINGS
\r
7 #ifndef MSVC_COMPAT_H
\r
8 #define MSVC_COMPAT_H
\r
10 #define inline __inline
\r
11 #define __func__ __FUNCTION__
\r
14 #define isnan _isnan
\r
15 static int isinf(double x) {
\r
23 #define alloca _alloca
\r
24 #define atoll _atoi64
\r
26 #define ftello ftell
\r
33 /* Log gamma function
\r
35 * AS245, 2nd algorithm, http://lib.stat.cmu.edu/apstat/245
\r
37 static double lgamma(double z)
\r
40 x += 0.1659470187408462e-06 / (z+7);
\r
41 x += 0.9934937113930748e-05 / (z+6);
\r
42 x -= 0.1385710331296526 / (z+5);
\r
43 x += 12.50734324009056 / (z+4);
\r
44 x -= 176.6150291498386 / (z+3);
\r
45 x += 771.3234287757674 / (z+2);
\r
46 x -= 1259.139216722289 / (z+1);
\r
47 x += 676.5203681218835 / z;
\r
48 x += 0.9999999999995183;
\r
49 return log(x) - 5.58106146679532777 - z + (z-0.5) * log(z+6.5);
\r
54 #define M_LN10 2.30258509299404568402
\r
57 #define M_LN2 0.69314718055994530942
\r