Add gmx_getpid()
[alexxy/gromacs.git] / src / gromacs / random / random.c
index 724012e725e97717ccab4cc8176e65a760be4e64..1e8390abe24ffcb323a0c2c261709d1afec06e03 100644 (file)
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#include "config.h"
+#include "gmxpre.h"
 
 #include "random.h"
 
+#include "config.h"
+
+#include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
 #include <time.h>
-#include <math.h>
-#ifdef GMX_NATIVE_WINDOWS
-#include <process.h>
-#endif
 
 #include "external/Random123-1.08/include/Random123/threefry.h"
 
 #include "gromacs/math/utilities.h"
-#include "random_gausstable.h"
+#include "gromacs/random/random_gausstable.h"
+#include "gromacs/utility/sysinfo.h"
 
 #define RNG_N 624
 #define RNG_M 397
@@ -234,12 +231,8 @@ gmx_rng_make_seed(void)
     else
     {
         /* No random device available, use time-of-day and process id */
-#ifdef GMX_NATIVE_WINDOWS
-        my_pid = (long)_getpid();
-#else
-        my_pid = (long)getpid();
-#endif
-        data = (unsigned int)(((long)time(NULL)+my_pid) % (long)1000000);
+        my_pid = gmx_getpid();
+        data   = (unsigned int)(((long)time(NULL)+my_pid) % (long)1000000);
     }
     return data;
 }