Fix Windows/Linux build

This commit is contained in:
Aurélie Delhaie
2022-12-18 22:00:38 +01:00
parent 159b3064b1
commit 7890d077a8

View File

@@ -16,14 +16,14 @@ Tools::Tools()
const QColor Tools::getRandomColor()
{
srand(time(0));
#ifdef __linux__
uint8_t r = rand() % 255;
uint8_t g = rand() % 255;
uint8_t b = rand() % 255;
#else
#ifdef __APPLE__
uint8_t r = arc4random() % 255;
uint8_t g = arc4random() % 255;
uint8_t b = arc4random() % 255;
#else
uint8_t r = rand() % 255;
uint8_t g = rand() % 255;
uint8_t b = rand() % 255;
#endif
return QColor(r, g, b);
}