fix linux-specific compilation errors
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
#ifndef BLUELIB_MISB_H_
|
||||
#define BLUELIB_MISB_H_
|
||||
|
||||
#ifndef _Nonnull
|
||||
#define _Nonnull
|
||||
#endif
|
||||
|
||||
#define b_unbox(type, box, member) \
|
||||
((type *_Nonnull)((box) ? (uintptr_t)(box) - (offsetof(type, member)) : 0))
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ static void init_by_array64(
|
||||
}
|
||||
|
||||
/* generates a random number on [0, 2^64-1]-interval */
|
||||
static unsigned long long genrand64_int64(struct b_random_ctx *context)
|
||||
static uint64_t genrand64_int64(struct b_random_ctx *context)
|
||||
{
|
||||
#if 0
|
||||
/* This is the original implementation. It is replaced by the alternate implementation, below. */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <fcntl.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
uint64_t z__c_platform_random_seed()
|
||||
uint64_t z__b_platform_random_seed()
|
||||
{
|
||||
int fd = open("/dev/urandom", O_RDONLY);
|
||||
if (fd == -1) {
|
||||
@@ -18,7 +18,7 @@ uint64_t z__c_platform_random_seed()
|
||||
return v;
|
||||
}
|
||||
|
||||
uint64_t z__c_platform_random_seed_secure()
|
||||
uint64_t z__b_platform_random_seed_secure()
|
||||
{
|
||||
int fd = open("/dev/random", O_RDONLY);
|
||||
if (fd == -1) {
|
||||
|
||||
Reference in New Issue
Block a user