From 801fd04c979bffb38cc6126c5572dfdf6248b6d4 Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Wed, 5 Nov 2025 15:03:49 +0100 Subject: [PATCH] Fix compilation --- mods/netstim125.mod | 7 ++++++- mods/netstimbox.mod | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mods/netstim125.mod b/mods/netstim125.mod index adf0ca5..243edb4 100644 --- a/mods/netstim125.mod +++ b/mods/netstim125.mod @@ -73,8 +73,13 @@ FUNCTION invl(mean (ms)) (ms) { } } VERBATIM +#ifndef NRN_VERSION_GTEQ_8_2_0 double nrn_random_pick(void* r); void* nrn_random_arg(int argpos); +#define RANDCAST +#else +#define RANDCAST (Rand*) +#endif ENDVERBATIM FUNCTION erand() { @@ -85,7 +90,7 @@ VERBATIM : each instance. However, the corresponding hoc Random : distribution MUST be set to Random.negexp(1) */ - _lerand = nrn_random_pick(_p_donotuse); + _lerand = nrn_random_pick(RANDCAST _p_donotuse); }else{ /* only can be used in main thread */ if (_nt != nrn_threads) { diff --git a/mods/netstimbox.mod b/mods/netstimbox.mod index 2b927e0..a0ffcf6 100644 --- a/mods/netstimbox.mod +++ b/mods/netstimbox.mod @@ -32,8 +32,13 @@ INITIAL { : deactivated by default FUNCTION invl(mean (ms)) (ms) { } VERBATIM +#ifndef NRN_VERSION_GTEQ_8_2_0 double nrn_random_pick(void* r); void* nrn_random_arg(int argpos); +#define RANDCAST +#else +#define RANDCAST (Rand*) +#endif ENDVERBATIM FUNCTION erand() { @@ -45,7 +50,7 @@ VERBATIM : each instance. However, the corresponding hoc Random : distribution MUST be set to Random.negexp(1) */ - _lerand = nrn_random_pick(_p_donotuse); + _lerand = nrn_random_pick(RANDCAST _p_donotuse); }else{ /* only can be used in main thread */ if (_nt != nrn_threads) {