Package: dsfmt / 2.2.3+dfsg-4

extern-inline-functions.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
Description: Export inline functions when building library
 This patch adds a preprocessor flag DSFMT_BUILDING_LIB that when
 specified causes the compiler to emit symbols for inline functions,
 which is achieved using C99 extern inline function declarations.
 This allows invoking these functions in programs that dynamically
 load the library for use with a foreign function interface (FFI).
Author: Peter Colberg <peter@colberg.org>
Forwarded: no
Last-Update: 2015-10-28
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/dSFMT.h
+++ b/dSFMT.h
@@ -191,14 +191,17 @@ void dsfmt_chk_init_by_array(dsfmt_t *dsfmt, uint32_t init_key[],
 const char *dsfmt_get_idstring(void);
 int dsfmt_get_min_array_size(void);
 
-#if defined(__GNUC__)
-#  define DSFMT_PRE_INLINE inline static
+#if defined(DSFMT_BUILDING_LIB)
+#  define DSFMT_PRE_INLINE extern inline
+#  define DSFMT_PST_INLINE
+#elif defined(__GNUC__)
+#  define DSFMT_PRE_INLINE inline
 #  define DSFMT_PST_INLINE __attribute__((always_inline))
 #elif defined(_MSC_VER) && _MSC_VER >= 1200
-#  define DSFMT_PRE_INLINE __forceinline static
+#  define DSFMT_PRE_INLINE __forceinline
 #  define DSFMT_PST_INLINE
 #else
-#  define DSFMT_PRE_INLINE inline static
+#  define DSFMT_PRE_INLINE inline
 #  define DSFMT_PST_INLINE
 #endif
 DSFMT_PRE_INLINE uint32_t dsfmt_genrand_uint32(dsfmt_t *dsfmt) DSFMT_PST_INLINE;
@@ -239,7 +242,7 @@ DSFMT_PRE_INLINE void dsfmt_init_by_array(dsfmt_t *dsfmt, uint32_t init_key[],
  * @param dsfmt dsfmt internal state date
  * @return double precision floating point pseudorandom number
  */
-inline static uint32_t dsfmt_genrand_uint32(dsfmt_t *dsfmt) {
+inline uint32_t dsfmt_genrand_uint32(dsfmt_t *dsfmt) {
     uint32_t r;
     uint64_t *psfmt64 = &dsfmt->status[0].u[0];
 
@@ -260,7 +263,7 @@ inline static uint32_t dsfmt_genrand_uint32(dsfmt_t *dsfmt) {
  * @param dsfmt dsfmt internal state date
  * @return double precision floating point pseudorandom number
  */
-inline static double dsfmt_genrand_close1_open2(dsfmt_t *dsfmt) {
+inline double dsfmt_genrand_close1_open2(dsfmt_t *dsfmt) {
     double r;
     double *psfmt64 = &dsfmt->status[0].d[0];
 
@@ -279,7 +282,7 @@ inline static double dsfmt_genrand_close1_open2(dsfmt_t *dsfmt) {
  * before this function.  This function uses \b global variables.
  * @return double precision floating point pseudorandom number
  */
-inline static uint32_t dsfmt_gv_genrand_uint32(void) {
+inline uint32_t dsfmt_gv_genrand_uint32(void) {
     return dsfmt_genrand_uint32(&dsfmt_global_data);
 }
 
@@ -290,7 +293,7 @@ inline static uint32_t dsfmt_gv_genrand_uint32(void) {
  * before this function. This function uses \b global variables.
  * @return double precision floating point pseudorandom number
  */
-inline static double dsfmt_gv_genrand_close1_open2(void) {
+inline double dsfmt_gv_genrand_close1_open2(void) {
     return dsfmt_genrand_close1_open2(&dsfmt_global_data);
 }
 
@@ -302,7 +305,7 @@ inline static double dsfmt_gv_genrand_close1_open2(void) {
  * @param dsfmt dsfmt internal state date
  * @return double precision floating point pseudorandom number
  */
-inline static double dsfmt_genrand_close_open(dsfmt_t *dsfmt) {
+inline double dsfmt_genrand_close_open(dsfmt_t *dsfmt) {
     return dsfmt_genrand_close1_open2(dsfmt) - 1.0;
 }
 
@@ -313,7 +316,7 @@ inline static double dsfmt_genrand_close_open(dsfmt_t *dsfmt) {
  * before this function. This function uses \b global variables.
  * @return double precision floating point pseudorandom number
  */
-inline static double dsfmt_gv_genrand_close_open(void) {
+inline double dsfmt_gv_genrand_close_open(void) {
     return dsfmt_gv_genrand_close1_open2() - 1.0;
 }
 
@@ -325,7 +328,7 @@ inline static double dsfmt_gv_genrand_close_open(void) {
  * @param dsfmt dsfmt internal state date
  * @return double precision floating point pseudorandom number
  */
-inline static double dsfmt_genrand_open_close(dsfmt_t *dsfmt) {
+inline double dsfmt_genrand_open_close(dsfmt_t *dsfmt) {
     return 2.0 - dsfmt_genrand_close1_open2(dsfmt);
 }
 
@@ -336,7 +339,7 @@ inline static double dsfmt_genrand_open_close(dsfmt_t *dsfmt) {
  * before this function. This function uses \b global variables.
  * @return double precision floating point pseudorandom number
  */
-inline static double dsfmt_gv_genrand_open_close(void) {
+inline double dsfmt_gv_genrand_open_close(void) {
     return 2.0 - dsfmt_gv_genrand_close1_open2();
 }
 
@@ -348,7 +351,7 @@ inline static double dsfmt_gv_genrand_open_close(void) {
  * @param dsfmt dsfmt internal state date
  * @return double precision floating point pseudorandom number
  */
-inline static double dsfmt_genrand_open_open(dsfmt_t *dsfmt) {
+inline double dsfmt_genrand_open_open(dsfmt_t *dsfmt) {
     double *dsfmt64 = &dsfmt->status[0].d[0];
     union {
         double d;
@@ -371,7 +374,7 @@ inline static double dsfmt_genrand_open_open(dsfmt_t *dsfmt) {
  * before this function. This function uses \b global variables.
  * @return double precision floating point pseudorandom number
  */
-inline static double dsfmt_gv_genrand_open_open(void) {
+inline double dsfmt_gv_genrand_open_open(void) {
     return dsfmt_genrand_open_open(&dsfmt_global_data);
 }
 
@@ -386,7 +389,7 @@ inline static double dsfmt_gv_genrand_open_open(void) {
  * @param size the number of pseudorandom numbers to be generated.
  * see also \sa dsfmt_fill_array_close1_open2()
  */
-inline static void dsfmt_gv_fill_array_close1_open2(double array[], ptrdiff_t size) {
+inline void dsfmt_gv_fill_array_close1_open2(double array[], ptrdiff_t size) {
     dsfmt_fill_array_close1_open2(&dsfmt_global_data, array, size);
 }
 
@@ -402,7 +405,7 @@ inline static void dsfmt_gv_fill_array_close1_open2(double array[], ptrdiff_t si
  * see also \sa dsfmt_fill_array_close1_open2() and \sa
  * dsfmt_gv_fill_array_close1_open2()
  */
-inline static void dsfmt_gv_fill_array_open_close(double array[], ptrdiff_t size) {
+inline void dsfmt_gv_fill_array_open_close(double array[], ptrdiff_t size) {
     dsfmt_fill_array_open_close(&dsfmt_global_data, array, size);
 }
 
@@ -418,7 +421,7 @@ inline static void dsfmt_gv_fill_array_open_close(double array[], ptrdiff_t size
  * see also \sa dsfmt_fill_array_close1_open2() \sa
  * dsfmt_gv_fill_array_close1_open2()
  */
-inline static void dsfmt_gv_fill_array_close_open(double array[], ptrdiff_t size) {
+inline void dsfmt_gv_fill_array_close_open(double array[], ptrdiff_t size) {
     dsfmt_fill_array_close_open(&dsfmt_global_data, array, size);
 }
 
@@ -434,7 +437,7 @@ inline static void dsfmt_gv_fill_array_close_open(double array[], ptrdiff_t size
  * see also \sa dsfmt_fill_array_close1_open2() \sa
  * dsfmt_gv_fill_array_close1_open2()
  */
-inline static void dsfmt_gv_fill_array_open_open(double array[], ptrdiff_t size) {
+inline void dsfmt_gv_fill_array_open_open(double array[], ptrdiff_t size) {
     dsfmt_fill_array_open_open(&dsfmt_global_data, array, size);
 }
 
@@ -444,7 +447,7 @@ inline static void dsfmt_gv_fill_array_open_open(double array[], ptrdiff_t size)
  * @param dsfmt dsfmt state vector.
  * @param seed a 32-bit integer used as the seed.
  */
-inline static void dsfmt_init_gen_rand(dsfmt_t *dsfmt, uint32_t seed) {
+inline void dsfmt_init_gen_rand(dsfmt_t *dsfmt, uint32_t seed) {
     dsfmt_chk_init_gen_rand(dsfmt, seed, DSFMT_MEXP);
 }
 
@@ -454,7 +457,7 @@ inline static void dsfmt_init_gen_rand(dsfmt_t *dsfmt, uint32_t seed) {
  * @param seed a 32-bit integer used as the seed.
  * see also \sa dsfmt_init_gen_rand()
  */
-inline static void dsfmt_gv_init_gen_rand(uint32_t seed) {
+inline void dsfmt_gv_init_gen_rand(uint32_t seed) {
     dsfmt_init_gen_rand(&dsfmt_global_data, seed);
 }
 
@@ -465,7 +468,7 @@ inline static void dsfmt_gv_init_gen_rand(uint32_t seed) {
  * @param init_key the array of 32-bit integers, used as a seed.
  * @param key_length the length of init_key.
  */
-inline static void dsfmt_init_by_array(dsfmt_t *dsfmt, uint32_t init_key[],
+inline void dsfmt_init_by_array(dsfmt_t *dsfmt, uint32_t init_key[],
                                        int key_length) {
     dsfmt_chk_init_by_array(dsfmt, init_key, key_length, DSFMT_MEXP);
 }
@@ -478,7 +481,7 @@ inline static void dsfmt_init_by_array(dsfmt_t *dsfmt, uint32_t init_key[],
  * @param key_length the length of init_key.
  * see also \sa dsfmt_init_by_array()
  */
-inline static void dsfmt_gv_init_by_array(uint32_t init_key[], int key_length) {
+inline void dsfmt_gv_init_by_array(uint32_t init_key[], int key_length) {
     dsfmt_init_by_array(&dsfmt_global_data, init_key, key_length);
 }
 
@@ -506,7 +509,7 @@ DSFMT_PRE_INLINE void fill_array_close1_open2(double array[], ptrdiff_t size)
  * @return id string.
  * see also \sa dsfmt_get_idstring()
  */
-inline static const char *get_idstring(void) {
+inline const char *get_idstring(void) {
     return dsfmt_get_idstring();
 }
 
@@ -515,7 +518,7 @@ inline static const char *get_idstring(void) {
  * @return minimum size of array used for fill_array functions.
  * see also \sa dsfmt_get_min_array_size()
  */
-inline static int get_min_array_size(void) {
+inline int get_min_array_size(void) {
     return dsfmt_get_min_array_size();
 }
 
@@ -524,7 +527,7 @@ inline static int get_min_array_size(void) {
  * @param seed a 32-bit integer used as the seed.
  * see also \sa dsfmt_gv_init_gen_rand(), \sa dsfmt_init_gen_rand().
  */
-inline static void init_gen_rand(uint32_t seed) {
+inline void init_gen_rand(uint32_t seed) {
     dsfmt_gv_init_gen_rand(seed);
 }
 
@@ -534,7 +537,7 @@ inline static void init_gen_rand(uint32_t seed) {
  * @param key_length the length of init_key.
  * see also \sa dsfmt_gv_init_by_array(), \sa dsfmt_init_by_array().
  */
-inline static void init_by_array(uint32_t init_key[], int key_length) {
+inline void init_by_array(uint32_t init_key[], int key_length) {
     dsfmt_gv_init_by_array(init_key, key_length);
 }
 
@@ -544,7 +547,7 @@ inline static void init_by_array(uint32_t init_key[], int key_length) {
  * see also \sa dsfmt_genrand_close1_open2() \sa
  * dsfmt_gv_genrand_close1_open2()
  */
-inline static double genrand_close1_open2(void) {
+inline double genrand_close1_open2(void) {
     return dsfmt_gv_genrand_close1_open2();
 }
 
@@ -554,7 +557,7 @@ inline static double genrand_close1_open2(void) {
  * see also \sa dsfmt_genrand_close_open() \sa
  * dsfmt_gv_genrand_close_open()
  */
-inline static double genrand_close_open(void) {
+inline double genrand_close_open(void) {
     return dsfmt_gv_genrand_close_open();
 }
 
@@ -564,7 +567,7 @@ inline static double genrand_close_open(void) {
  * see also \sa dsfmt_genrand_open_close() \sa
  * dsfmt_gv_genrand_open_close()
  */
-inline static double genrand_open_close(void) {
+inline double genrand_open_close(void) {
     return dsfmt_gv_genrand_open_close();
 }
 
@@ -574,7 +577,7 @@ inline static double genrand_open_close(void) {
  * see also \sa dsfmt_genrand_open_open() \sa
  * dsfmt_gv_genrand_open_open()
  */
-inline static double genrand_open_open(void) {
+inline double genrand_open_open(void) {
     return dsfmt_gv_genrand_open_open();
 }
 
@@ -587,7 +590,7 @@ inline static double genrand_open_open(void) {
  * dsfmt_fill_array_close1_open2(), \sa
  * dsfmt_gv_fill_array_close1_open2()
  */
-inline static void fill_array_open_close(double array[], ptrdiff_t size) {
+inline void fill_array_open_close(double array[], ptrdiff_t size) {
     dsfmt_gv_fill_array_open_close(array, size);
 }
 
@@ -600,7 +603,7 @@ inline static void fill_array_open_close(double array[], ptrdiff_t size) {
  * dsfmt_fill_array_close1_open2(), \sa
  * dsfmt_gv_fill_array_close1_open2()
  */
-inline static void fill_array_close_open(double array[], ptrdiff_t size) {
+inline void fill_array_close_open(double array[], ptrdiff_t size) {
     dsfmt_gv_fill_array_close_open(array, size);
 }
 
@@ -613,7 +616,7 @@ inline static void fill_array_close_open(double array[], ptrdiff_t size) {
  * dsfmt_fill_array_close1_open2(), \sa
  * dsfmt_gv_fill_array_close1_open2()
  */
-inline static void fill_array_open_open(double array[], ptrdiff_t size) {
+inline void fill_array_open_open(double array[], ptrdiff_t size) {
     dsfmt_gv_fill_array_open_open(array, size);
 }
 
@@ -625,7 +628,7 @@ inline static void fill_array_open_open(double array[], ptrdiff_t size) {
  * see also \sa dsfmt_fill_array_close1_open2(), \sa
  * dsfmt_gv_fill_array_close1_open2()
  */
-inline static void fill_array_close1_open2(double array[], ptrdiff_t size) {
+inline void fill_array_close1_open2(double array[], ptrdiff_t size) {
     dsfmt_gv_fill_array_close1_open2(array, size);
 }
 #endif /* DSFMT_DO_NOT_USE_OLD_NAMES */