1 #include <iso646.h> 2 #if !defined(__MINGW32__) && !defined(_WINDOWS) 3 #include "erf.h" 4 #endif 5 #include "direct.h" 6 #include <cmath> 7 // LAMMPS uses usleep with 100 ms arguments, no microsecond precision needed 8 #if !defined(__MINGW32__) && !defined(_WINDOWS) 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__) 23 //inline double pow(int i, int j){ 24 // return pow((double)i,j); 25 //} 26 //#endif 27 28 #if !defined(__MINGW32__) sqrt(int i)29inline double sqrt(int i){ 30 return sqrt((double) i); 31 } 32 #endif 33 fabs(int i)34inline double fabs(int i){ 35 return fabs((double) i); 36 } 37 round(double d)38inline double round(double d) 39 { 40 return floor(d + 0.5); 41 } 42 trunc(double x)43inline double trunc(double x) { 44 return x > 0 ? floor(x) : ceil(x); 45 } 46 47 // Windows version of mkdir function does not have permission flags 48 # define S_IRWXU 0 49 # define S_IRGRP 0 50 # define S_IXGRP 0 mkdir(const char * path,int)51inline int mkdir(const char *path, int){ 52 return _mkdir(path); 53 } 54