randdouble etc. can have C++ linkage

This commit is contained in:
Jiri Pittner 2023-11-17 23:23:50 +01:00
parent 6ad9ed5538
commit 45e8f6c52e
2 changed files with 0 additions and 4 deletions

View File

@ -3,10 +3,8 @@
namespace LA { namespace LA {
extern "C" {
WEAK_SYMBOL double randdouble() {return random()/(1.+RAND_MAX);} WEAK_SYMBOL double randdouble() {return random()/(1.+RAND_MAX);}
WEAK_SYMBOL double randdoublesigned() {return 2.*random()/(1.+RAND_MAX)-1.;} WEAK_SYMBOL double randdoublesigned() {return 2.*random()/(1.+RAND_MAX)-1.;}
WEAK_SYMBOL int randint32() {return random();} WEAK_SYMBOL int randint32() {return random();}
}
}//namespace }//namespace

View File

@ -16,11 +16,9 @@ namespace LA {
#define RANDINT32 randint32 #define RANDINT32 randint32
#endif #endif
extern "C" {
extern double randdouble(); extern double randdouble();
extern double randdoublesigned(); extern double randdoublesigned();
extern int randint32(); extern int randint32();
}
#ifdef __GNUC__ #ifdef __GNUC__
#define WEAK_SYMBOL __attribute__((weak)) #define WEAK_SYMBOL __attribute__((weak))