From a16a3d511502986812ef0dc7be08916b9e981952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=85=D9=87=D8=AF=D9=8A=20=D8=B4=D9=8A=D9=86=D9=88=D9=86?= =?UTF-8?q?=20=28Mehdi=20Chinoune=29?= Date: Tue, 11 Jun 2024 16:18:53 +0100 Subject: [PATCH] Use rand/srand instead of random/srandom on Windows random/srandom are not C standard functions. Use standard rand/srand on Windows. --- XClib/beefleg.h | 4 ++++ XClib/beefun.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/XClib/beefleg.h b/XClib/beefleg.h index 8747ccb98..91cc607a3 100755 --- a/XClib/beefleg.h +++ b/XClib/beefleg.h @@ -8,6 +8,10 @@ #define nmax 30 +#ifdef _WIN32 +#define random rand +#endif + extern void dgemv_(const char *, const int *, const int *, const double *, double *, const int *, double *, const int *, const double *, double *, const int *); diff --git a/XClib/beefun.c b/XClib/beefun.c index 8f06f13ed..9c943fa4d 100755 --- a/XClib/beefun.c +++ b/XClib/beefun.c @@ -9,6 +9,10 @@ #include "pbecor.h" +#ifdef _WIN32 +#define srandom srand +#endif + // evaluate bee exchange energy and its derivatives de/drho and ( de/d|grad rho| ) / |grad rho| #pragma acc routine seq void beefx_(double *r, double *g, double *e, double *dr, double *dg, int *addlda)