From 95632a6f0e74cc5a781e756d486020d516959ac4 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Fri, 24 Jul 2015 11:10:03 +0200 Subject: Revert "Correct paths to C sources" This reverts commit 456f54adfbb8a91bce994ba2ee9045f94d46bf77. --- packages/base/hmatrix.cabal | 6 +++--- packages/base/src/Internal/C/windows_random_r.c | 4 ++-- packages/base/src/Internal/C/windows_random_r.h | 20 ++++++++++++-------- 3 files changed, 17 insertions(+), 13 deletions(-) (limited to 'packages/base') diff --git a/packages/base/hmatrix.cabal b/packages/base/hmatrix.cabal index e248886..9b8b108 100644 --- a/packages/base/hmatrix.cabal +++ b/packages/base/hmatrix.cabal @@ -25,7 +25,7 @@ build-type: Simple extra-source-files: THANKS.md CHANGELOG extra-source-files: src/Internal/C/lapack-aux.h - src/Internal/C/windows_random_r.h + src/C/windows_random_r.h flag openblas description: Link with OpenBLAS (https://github.com/xianyi/OpenBLAS) optimized libraries. @@ -75,10 +75,10 @@ library Internal.Util Internal.Modular Internal.Static - + C-sources: src/Internal/C/lapack-aux.c src/Internal/C/vector-aux.c - src/Internal/C/windows_random_r.c + src/C/windows_random_r.c extensions: ForeignFunctionInterface, diff --git a/packages/base/src/Internal/C/windows_random_r.c b/packages/base/src/Internal/C/windows_random_r.c index 872cb2e..c16d96f 100644 --- a/packages/base/src/Internal/C/windows_random_r.c +++ b/packages/base/src/Internal/C/windows_random_r.c @@ -53,7 +53,7 @@ * Rewritten to be reentrant by Ulrich Drepper, 1995 */ -#include "windows_random_r.h" +#include "myrandom.h" /* An improved random number generation package. In addition to the standard rand()/srand() like interface, this package also has a special state info @@ -388,5 +388,5 @@ int random_r (struct random_data *buf, int32_t *result) return -1; } -int windows_random_r; +int my_errno; #endif \ No newline at end of file diff --git a/packages/base/src/Internal/C/windows_random_r.h b/packages/base/src/Internal/C/windows_random_r.h index 4f4d32f..c05caa7 100644 --- a/packages/base/src/Internal/C/windows_random_r.h +++ b/packages/base/src/Internal/C/windows_random_r.h @@ -1,28 +1,32 @@ #if defined(_WIN32) || defined(WIN32) -#ifndef WINDOWS_RANDOM_R_H -#define WINDOWS_RANDOM_R_H +#ifndef MYRANDOM_H +#define MYRANDOM_H #include +#define NULL 0 + #define EINVAL 23 typedef int int32_t; struct random_data { - int *fptr; /* Front pointer. */ - int *rptr; /* Rear pointer. */ - int *state; /* Array of state values. */ + int32_t *fptr; /* Front pointer. */ + int32_t *rptr; /* Rear pointer. */ + int32_t *state; /* Array of state values. */ int rand_type; /* Type of random number generator. */ int rand_deg; /* Degree of random number generator. */ int rand_sep; /* Distance between front and rear. */ - int *end_ptr; /* Pointer behind state table. */ + int32_t *end_ptr; /* Pointer behind state table. */ }; -extern int windows_random_r_errno; -static inline void __set_errno(int err) { windows_random_r_errno = err; }; +#define errno my_errno +extern int my_errno; + +static inline void __set_errno(int err) { my_errno = err; }; int random_r (struct random_data *buf, int32_t *result); -- cgit v1.2.3