1 #include <iso646.h> 2 #if !defined(__MINGW32__) 3 #include "erf.h" 4 #endif 5 #include "direct.h" 6 #include "math.h" 7 // SPARTA uses usleep with 100 ms arguments, no microsecond precision needed 8 #if !defined(__MINGW32__) 9 #include "sleep.h" 10 #endif 11 12 // some symbols have different names in Windows 13 14 #undef ATOBIGINT 15 #define ATOBIGINT _atoi64 16 17 #define pclose _pclose 18 #define __restrict__ __restrict 19 20 // the following functions ared defined to get rid of 21 // 'ambiguous call to overloaded function' error in VSS for mismathched type arguments 22 #if !defined(__MINGW32__) pow(int i,int j)23inline double pow(int i, int j){ 24 return pow((double)i,j); 25 } 26 #endif sqrt(int i)27inline double sqrt(int i){ 28 return sqrt((double) i); 29 } 30 fabs(int i)31inline double fabs(int i){ 32 return fabs((double) i); 33 } 34 trunc(double x)35inline double trunc(double x) { 36 return x > 0 ? floor(x) : ceil(x); 37 } 38 39 // Windows version of mkdir function does not have permission flags 40 #ifndef S_IRWXU 41 # define S_IRWXU 0 42 #endif 43 #ifndef S_IRGRP 44 # define S_IRGRP 0 45 #endif 46 #ifndef S_IXGRP 47 # define S_IXGRP 0 48 #endif mkdir(const char * path,int)49inline int mkdir(const char *path, int){ 50 return _mkdir(path); 51 } 52