[fix] conditional compilation for strndup and drand48 for Windows, using config.h

This commit is contained in:
Al
2017-11-29 12:21:13 -05:00
parent 18eb5ef9ee
commit 26e4ef08bc
6 changed files with 25 additions and 6 deletions

View File

@@ -14,6 +14,12 @@
//I've rearranged the source into a header-only implementation for drand48() -Benjamin Kusin
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef HAVE_DRAND48
#include <math.h>
#include "drand48.h"
@@ -67,4 +73,6 @@ double erand48(unsigned short xseed[3])
double drand48(void)
{
return erand48(_rand48_seed);
}
}
#endif // HAVE_DRAND48

View File

@@ -12,11 +12,15 @@
* to anyone/anything when using this software.
*/
//I've rearranged the source into a header-only implementation for drand48() -Benjamin Kusin
#ifndef _DRAND48_H
#define _DRAND48_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef HAVE_DRAND48
#define RAND48_SEED_0 (0x330e)
#define RAND48_SEED_1 (0xabcd)
#define RAND48_SEED_2 (0x1234)
@@ -37,5 +41,7 @@ double erand48(unsigned short xseed[3]);
double drand48(void);
#endif // HAVE_DRAND48
#endif // _DRAND48_H
#endif // _DRAND48_H

View File

@@ -1,4 +1,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef HAVE_STRNDUP
#include <stdlib.h>

View File

@@ -1,7 +1,9 @@
#ifndef STRNDUP_H
#define STRNDUP_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef HAVE_STRNDUP