summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2015-07-24 11:10:03 +0200
committerAlberto Ruiz <aruiz@um.es>2015-07-24 11:10:03 +0200
commit95632a6f0e74cc5a781e756d486020d516959ac4 (patch)
tree8c9f08d5d800be5360604925c0ed9736fbca4398 /packages/base/src/Internal
parentacf9e00b3b8f1779b07a3f200026a2f5d315d33c (diff)
Revert "Correct paths to C sources"
This reverts commit 456f54adfbb8a91bce994ba2ee9045f94d46bf77.
Diffstat (limited to 'packages/base/src/Internal')
-rw-r--r--packages/base/src/Internal/C/windows_random_r.c4
-rw-r--r--packages/base/src/Internal/C/windows_random_r.h20
2 files changed, 14 insertions, 10 deletions
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 @@
53 * Rewritten to be reentrant by Ulrich Drepper, 1995 53 * Rewritten to be reentrant by Ulrich Drepper, 1995
54 */ 54 */
55 55
56#include "windows_random_r.h" 56#include "myrandom.h"
57 57
58/* An improved random number generation package. In addition to the standard 58/* An improved random number generation package. In addition to the standard
59 rand()/srand() like interface, this package also has a special state info 59 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)
388 return -1; 388 return -1;
389} 389}
390 390
391int windows_random_r; 391int my_errno;
392#endif \ No newline at end of file 392#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 @@
1#if defined(_WIN32) || defined(WIN32) 1#if defined(_WIN32) || defined(WIN32)
2 2
3#ifndef WINDOWS_RANDOM_R_H 3#ifndef MYRANDOM_H
4#define WINDOWS_RANDOM_R_H 4#define MYRANDOM_H
5 5
6#include <stddef.h> 6#include <stddef.h>
7 7
8#define NULL 0
9
8#define EINVAL 23 10#define EINVAL 23
9 11
10typedef int int32_t; 12typedef int int32_t;
11 13
12struct random_data 14struct random_data
13{ 15{
14 int *fptr; /* Front pointer. */ 16 int32_t *fptr; /* Front pointer. */
15 int *rptr; /* Rear pointer. */ 17 int32_t *rptr; /* Rear pointer. */
16 int *state; /* Array of state values. */ 18 int32_t *state; /* Array of state values. */
17 int rand_type; /* Type of random number generator. */ 19 int rand_type; /* Type of random number generator. */
18 int rand_deg; /* Degree of random number generator. */ 20 int rand_deg; /* Degree of random number generator. */
19 int rand_sep; /* Distance between front and rear. */ 21 int rand_sep; /* Distance between front and rear. */
20 int *end_ptr; /* Pointer behind state table. */ 22 int32_t *end_ptr; /* Pointer behind state table. */
21}; 23};
22 24
23extern int windows_random_r_errno;
24 25
25static inline void __set_errno(int err) { windows_random_r_errno = err; }; 26#define errno my_errno
27extern int my_errno;
28
29static inline void __set_errno(int err) { my_errno = err; };
26 30
27int random_r (struct random_data *buf, int32_t *result); 31int random_r (struct random_data *buf, int32_t *result);
28 32