From cb50d5d933a5b5f16d8e6f6a07eb786e15c7d6c5 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 13 Jun 2011 23:54:36 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6390 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/lmptype.h | 2 +- src/lmpwindows.h | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 src/lmpwindows.h diff --git a/src/lmptype.h b/src/lmptype.h index a44e4eb834..9854934b04 100644 --- a/src/lmptype.h +++ b/src/lmptype.h @@ -117,7 +117,7 @@ typedef int bigint; // settings to enable LAMMPS build under Windows #ifdef _WIN32 -#include "lmp_windows.h" +#include "lmpwindows.h" #endif #endif diff --git a/src/lmpwindows.h b/src/lmpwindows.h new file mode 100644 index 0000000000..a3324f1f9d --- /dev/null +++ b/src/lmpwindows.h @@ -0,0 +1,41 @@ +#include +#include "erf.h" +#include "direct.h" +#include "math.h" +// LAMMPS uses usleep with 100 ms arguments, no microsecond precision needed +#include "sleep.h" + +// some symbols have different names in Windows + +#undef ATOBIGINT +#define ATOBIGINT _atoi64 + +#define pclose _pclose +#define __restrict__ __restrict + +// the following functions ared defined to get rid of +// 'ambiguous call to overloaded function' error in VSS for mismathched type arguments + +inline double pow(int i, int j){ + return pow((double)i,(double) j); +} + +inline double sqrt(int i){ + return sqrt((double) i); +} + +inline double fabs(int i){ + return fabs((double) i); +} + +inline double trunc(double x) { + return x > 0 ? floor(x) : ceil(x); +} + +// Windows version of mkdir function does not have permission flags +# define S_IRWXU 0 +# define S_IRGRP 0 +# define S_IXGRP 0 +inline int mkdir(const char *path, int flags){ + return _mkdir(path); +}