Linux/BSD: Fix support for NetBSD

Add __NetBSD__ to `platform_config.h` so that it can find `alloca`
and use the proper `pthread_setname_np` format.

Rename RANDOM_MAX to avoid conflict with NetBSD stdlib.

Fixes #42145.
This commit is contained in:
Rémi Verschelde 2020-09-18 08:27:02 +02:00
parent 2d9b409103
commit 5f4d64f4f3
No known key found for this signature in database
GPG key ID: C3336907360768E1
5 changed files with 33 additions and 14 deletions

View file

@ -31,12 +31,12 @@
#ifndef RANDOM_PCG_H
#define RANDOM_PCG_H
#include <math.h>
#include "core/math/math_defs.h"
#include "thirdparty/misc/pcg.h"
#include <math.h>
#if defined(__GNUC__)
#define CLZ32(x) __builtin_clz(x)
#elif defined(_MSC_VER)
@ -67,7 +67,6 @@ class RandomPCG {
public:
static const uint64_t DEFAULT_SEED = 12047754176567800795U;
static const uint64_t DEFAULT_INC = PCG_DEFAULT_INC_64;
static const uint64_t RANDOM_MAX = 0xFFFFFFFF;
RandomPCG(uint64_t p_seed = DEFAULT_SEED, uint64_t p_inc = DEFAULT_INC);