standalone-ruby 1.5.1 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +53 -48
  3. data/bin/standalone-ruby +3 -3
  4. data/lib/data/c_compilers/tcc/include/_mingw.h +54 -54
  5. data/lib/data/c_compilers/tcc/include/assert.h +71 -71
  6. data/lib/data/c_compilers/tcc/include/conio.h +159 -159
  7. data/lib/data/c_compilers/tcc/include/ctype.h +232 -232
  8. data/lib/data/c_compilers/tcc/include/dir.h +26 -26
  9. data/lib/data/c_compilers/tcc/include/direct.h +95 -95
  10. data/lib/data/c_compilers/tcc/include/dirent.h +96 -96
  11. data/lib/data/c_compilers/tcc/include/dos.h +110 -110
  12. data/lib/data/c_compilers/tcc/include/errno.h +117 -117
  13. data/lib/data/c_compilers/tcc/include/excpt.h +20 -20
  14. data/lib/data/c_compilers/tcc/include/fcntl.h +135 -135
  15. data/lib/data/c_compilers/tcc/include/fenv.h +85 -85
  16. data/lib/data/c_compilers/tcc/include/float.h +224 -224
  17. data/lib/data/c_compilers/tcc/include/inttypes.h +275 -275
  18. data/lib/data/c_compilers/tcc/include/io.h +296 -296
  19. data/lib/data/c_compilers/tcc/include/limits.h +115 -115
  20. data/lib/data/c_compilers/tcc/include/locale.h +100 -100
  21. data/lib/data/c_compilers/tcc/include/malloc.h +87 -87
  22. data/lib/data/c_compilers/tcc/include/math.h +438 -438
  23. data/lib/data/c_compilers/tcc/include/mem.h +8 -8
  24. data/lib/data/c_compilers/tcc/include/memory.h +9 -9
  25. data/lib/data/c_compilers/tcc/include/process.h +158 -158
  26. data/lib/data/c_compilers/tcc/include/setjmp.h +72 -72
  27. data/lib/data/c_compilers/tcc/include/share.h +44 -44
  28. data/lib/data/c_compilers/tcc/include/signal.h +111 -111
  29. data/lib/data/c_compilers/tcc/include/stdarg.h +16 -16
  30. data/lib/data/c_compilers/tcc/include/stdbool.h +10 -10
  31. data/lib/data/c_compilers/tcc/include/stddef.h +26 -26
  32. data/lib/data/c_compilers/tcc/include/stdint.h +184 -184
  33. data/lib/data/c_compilers/tcc/include/stdio.h +413 -413
  34. data/lib/data/c_compilers/tcc/include/stdlib.h +482 -482
  35. data/lib/data/c_compilers/tcc/include/string.h +206 -206
  36. data/lib/data/c_compilers/tcc/include/sys/fcntl.h +8 -8
  37. data/lib/data/c_compilers/tcc/include/sys/file.h +9 -9
  38. data/lib/data/c_compilers/tcc/include/sys/locking.h +52 -52
  39. data/lib/data/c_compilers/tcc/include/sys/stat.h +190 -190
  40. data/lib/data/c_compilers/tcc/include/sys/time.h +3 -3
  41. data/lib/data/c_compilers/tcc/include/sys/timeb.h +82 -82
  42. data/lib/data/c_compilers/tcc/include/sys/types.h +118 -118
  43. data/lib/data/c_compilers/tcc/include/sys/unistd.h +9 -9
  44. data/lib/data/c_compilers/tcc/include/sys/utime.h +89 -89
  45. data/lib/data/c_compilers/tcc/include/tchar.h +367 -367
  46. data/lib/data/c_compilers/tcc/include/time.h +219 -219
  47. data/lib/data/c_compilers/tcc/include/unistd.h +10 -10
  48. data/lib/data/c_compilers/tcc/include/values.h +4 -4
  49. data/lib/data/c_compilers/tcc/include/varargs.h +11 -11
  50. data/lib/data/c_compilers/tcc/include/wchar.h +318 -318
  51. data/lib/data/c_compilers/tcc/include/wctype.h +127 -127
  52. data/lib/data/c_compilers/tcc/include/winapi/basetsd.h +119 -119
  53. data/lib/data/c_compilers/tcc/include/winapi/basetyps.h +144 -144
  54. data/lib/data/c_compilers/tcc/include/winapi/winbase.h +1852 -1852
  55. data/lib/data/c_compilers/tcc/include/winapi/wincon.h +207 -207
  56. data/lib/data/c_compilers/tcc/include/winapi/windef.h +240 -240
  57. data/lib/data/c_compilers/tcc/include/winapi/windows.h +176 -176
  58. data/lib/data/c_compilers/tcc/include/winapi/winerror.h +1054 -1054
  59. data/lib/data/c_compilers/tcc/include/winapi/wingdi.h +2843 -2843
  60. data/lib/data/c_compilers/tcc/include/winapi/winnetwk.h +346 -346
  61. data/lib/data/c_compilers/tcc/include/winapi/winnls.h +651 -651
  62. data/lib/data/c_compilers/tcc/include/winapi/winnt.h +2667 -2667
  63. data/lib/data/c_compilers/tcc/include/winapi/winreg.h +159 -159
  64. data/lib/data/c_compilers/tcc/include/winapi/winsvc.h +309 -309
  65. data/lib/data/c_compilers/tcc/include/winapi/winuser.h +3472 -3472
  66. data/lib/data/c_compilers/tcc/include/winapi/winver.h +133 -133
  67. data/lib/data/c_compilers/tcc/lib/gdi32.def +337 -337
  68. data/lib/data/c_compilers/tcc/lib/kernel32.def +763 -763
  69. data/lib/data/c_compilers/tcc/lib/msvcrt.def +782 -782
  70. data/lib/data/c_compilers/tcc/lib/user32.def +654 -654
  71. data/lib/data/exe_templates/launcher_stub.c +29 -29
  72. data/lib/data/exe_templates/launcher_stub.cpp +31 -31
  73. data/lib/data/launcher_templates/vbs/default_vbs.txt +7 -7
  74. data/lib/data/launcher_templates/vbs/vbs_gui.txt +8 -8
  75. data/lib/data/resource_files/default.rc +17 -17
  76. data/lib/displayer.rb +63 -63
  77. data/lib/exe_packer.rb +72 -68
  78. data/lib/launcher.rb +58 -71
  79. data/lib/launcher_handler.rb +40 -40
  80. data/lib/parameter_parser.rb +215 -201
  81. data/lib/ruby_copy.rb +48 -20
  82. data/lib/standalone_ruby.rb +6 -6
  83. data/lib/version/version.rb +2 -2
  84. metadata +3 -4
  85. data/lib/sfx_generator.rb +0 -9
@@ -1,438 +1,438 @@
1
- /*
2
- * math.h
3
- *
4
- * Mathematical functions.
5
- *
6
- * This file is part of the Mingw32 package.
7
- *
8
- * Contributors:
9
- * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
10
- *
11
- * THIS SOFTWARE IS NOT COPYRIGHTED
12
- *
13
- * This source code is offered for use in the public domain. You may
14
- * use, modify or distribute it freely.
15
- *
16
- * This code is distributed in the hope that it will be useful but
17
- * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18
- * DISCLAIMED. This includes but is not limited to warranties of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
- *
21
- * $Revision: 1.2 $
22
- * $Author: bellard $
23
- * $Date: 2005/04/17 13:14:29 $
24
- *
25
- */
26
-
27
- #ifndef _MATH_H_
28
- #define _MATH_H_
29
-
30
- /* All the headers include this file. */
31
- #include <_mingw.h>
32
-
33
- /*
34
- * Types for the _exception structure.
35
- */
36
-
37
- #define _DOMAIN 1 /* domain error in argument */
38
- #define _SING 2 /* singularity */
39
- #define _OVERFLOW 3 /* range overflow */
40
- #define _UNDERFLOW 4 /* range underflow */
41
- #define _TLOSS 5 /* total loss of precision */
42
- #define _PLOSS 6 /* partial loss of precision */
43
-
44
- /*
45
- * Exception types with non-ANSI names for compatibility.
46
- */
47
-
48
- #ifndef __STRICT_ANSI__
49
- #ifndef _NO_OLDNAMES
50
-
51
- #define DOMAIN _DOMAIN
52
- #define SING _SING
53
- #define OVERFLOW _OVERFLOW
54
- #define UNDERFLOW _UNDERFLOW
55
- #define TLOSS _TLOSS
56
- #define PLOSS _PLOSS
57
-
58
- #endif /* Not _NO_OLDNAMES */
59
- #endif /* Not __STRICT_ANSI__ */
60
-
61
-
62
- /* These are also defined in Mingw float.h; needed here as well to work
63
- around GCC build issues. */
64
- #ifndef __STRICT_ANSI__
65
- #ifndef __MINGW_FPCLASS_DEFINED
66
- #define __MINGW_FPCLASS_DEFINED 1
67
- /* IEEE 754 classication */
68
- #define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
69
- #define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
70
- #define _FPCLASS_NINF 0x0004 /* Negative Infinity */
71
- #define _FPCLASS_NN 0x0008 /* Negative Normal */
72
- #define _FPCLASS_ND 0x0010 /* Negative Denormal */
73
- #define _FPCLASS_NZ 0x0020 /* Negative Zero */
74
- #define _FPCLASS_PZ 0x0040 /* Positive Zero */
75
- #define _FPCLASS_PD 0x0080 /* Positive Denormal */
76
- #define _FPCLASS_PN 0x0100 /* Positive Normal */
77
- #define _FPCLASS_PINF 0x0200 /* Positive Infinity */
78
- #endif /* __MINGW_FPCLASS_DEFINED */
79
- #endif /* Not __STRICT_ANSI__ */
80
-
81
- #ifndef RC_INVOKED
82
-
83
- #ifdef __cplusplus
84
- extern "C" {
85
- #endif
86
-
87
- /*
88
- * HUGE_VAL is returned by strtod when the value would overflow the
89
- * representation of 'double'. There are other uses as well.
90
- *
91
- * __imp__HUGE is a pointer to the actual variable _HUGE in
92
- * MSVCRT.DLL. If we used _HUGE directly we would get a pointer
93
- * to a thunk function.
94
- *
95
- * NOTE: The CRTDLL version uses _HUGE_dll instead.
96
- */
97
-
98
- #ifndef __DECLSPEC_SUPPORTED
99
-
100
- #ifdef __MSVCRT__
101
- extern double* __imp__HUGE;
102
- #define HUGE_VAL (*__imp__HUGE)
103
- #else
104
- /* CRTDLL */
105
- extern double* __imp__HUGE_dll;
106
- #define HUGE_VAL (*__imp__HUGE_dll)
107
- #endif
108
-
109
- #else /* __DECLSPEC_SUPPORTED */
110
-
111
- #ifdef __MSVCRT__
112
- __MINGW_IMPORT double _HUGE;
113
- #define HUGE_VAL _HUGE
114
- #else
115
- /* CRTDLL */
116
- __MINGW_IMPORT double _HUGE_dll;
117
- #define HUGE_VAL _HUGE_dll
118
- #endif
119
-
120
- #endif /* __DECLSPEC_SUPPORTED */
121
-
122
- struct _exception
123
- {
124
- int type;
125
- char *name;
126
- double arg1;
127
- double arg2;
128
- double retval;
129
- };
130
-
131
-
132
- double sin (double);
133
- double cos (double);
134
- double tan (double);
135
- double sinh (double);
136
- double cosh (double);
137
- double tanh (double);
138
- double asin (double);
139
- double acos (double);
140
- double atan (double);
141
- double atan2 (double, double);
142
- double exp (double);
143
- double log (double);
144
- double log10 (double);
145
- double pow (double, double);
146
- double sqrt (double);
147
- double ceil (double);
148
- double floor (double);
149
- double fabs (double);
150
- double ldexp (double, int);
151
- double frexp (double, int*);
152
- double modf (double, double*);
153
- double fmod (double, double);
154
-
155
-
156
- #ifndef __STRICT_ANSI__
157
-
158
- /* Complex number (for cabs) */
159
- struct _complex
160
- {
161
- double x; /* Real part */
162
- double y; /* Imaginary part */
163
- };
164
-
165
- double _cabs (struct _complex);
166
- double _hypot (double, double);
167
- double _j0 (double);
168
- double _j1 (double);
169
- double _jn (int, double);
170
- double _y0 (double);
171
- double _y1 (double);
172
- double _yn (int, double);
173
- int _matherr (struct _exception *);
174
-
175
- /* These are also declared in Mingw float.h; needed here as well to work
176
- around GCC build issues. */
177
- /* BEGIN FLOAT.H COPY */
178
- /*
179
- * IEEE recommended functions
180
- */
181
-
182
- double _chgsign (double);
183
- double _copysign (double, double);
184
- double _logb (double);
185
- double _nextafter (double, double);
186
- double _scalb (double, long);
187
-
188
- int _finite (double);
189
- int _fpclass (double);
190
- int _isnan (double);
191
-
192
- /* END FLOAT.H COPY */
193
-
194
- #if !defined (_NO_OLDNAMES) \
195
- || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L )
196
-
197
- /*
198
- * Non-underscored versions of non-ANSI functions. These reside in
199
- * liboldnames.a. They are now also ISO C99 standand names.
200
- * Provided for extra portability.
201
- */
202
-
203
- double cabs (struct _complex);
204
- double hypot (double, double);
205
- double j0 (double);
206
- double j1 (double);
207
- double jn (int, double);
208
- double y0 (double);
209
- double y1 (double);
210
- double yn (int, double);
211
-
212
- #endif /* Not _NO_OLDNAMES */
213
-
214
- #endif /* Not __STRICT_ANSI__ */
215
-
216
- #ifdef __cplusplus
217
- }
218
- #endif
219
- #endif /* Not RC_INVOKED */
220
-
221
-
222
- #ifndef __NO_ISOCEXT
223
-
224
- #define INFINITY HUGE_VAL
225
- #define NAN (0.0F/0.0F)
226
-
227
- /*
228
- Return values for fpclassify.
229
- These are based on Intel x87 fpu condition codes
230
- in the high byte of status word and differ from
231
- the return values for MS IEEE 754 extension _fpclass()
232
- */
233
- #define FP_NAN 0x0100
234
- #define FP_NORMAL 0x0400
235
- #define FP_INFINITE (FP_NAN | FP_NORMAL)
236
- #define FP_ZERO 0x4000
237
- #define FP_SUBNORMAL (FP_NORMAL | FP_ZERO)
238
- /* 0x0200 is signbit mask */
239
-
240
- #ifndef RC_INVOKED
241
- #ifdef __cplusplus
242
- extern "C" {
243
- #endif
244
-
245
- double nan(const char *tagp);
246
- float nanf(const char *tagp);
247
-
248
- #ifndef __STRICT_ANSI__
249
- #define nan() nan("")
250
- #define nanf() nanf("")
251
- #endif
252
-
253
-
254
- /*
255
- We can't inline float, because we want to ensure truncation
256
- to semantic type before classification. If we extend to long
257
- double, we will also need to make double extern only.
258
- (A normal long double value might become subnormal when
259
- converted to double, and zero when converted to float.)
260
- */
261
- extern __inline__ int __fpclassify (double x){
262
- unsigned short sw;
263
- __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x));
264
- return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
265
- }
266
-
267
- extern int __fpclassifyf (float);
268
-
269
- #define fpclassify(x) ((sizeof(x) == sizeof(float)) ? __fpclassifyf(x) \
270
- : __fpclassify(x))
271
-
272
- /* We don't need to worry about trucation here:
273
- A NaN stays a NaN. */
274
-
275
- extern __inline__ int __isnan (double _x)
276
- {
277
- unsigned short sw;
278
- __asm__ ("fxam;"
279
- "fstsw %%ax": "=a" (sw) : "t" (_x));
280
- return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
281
- == FP_NAN;
282
- }
283
-
284
- extern __inline__ int __isnanf (float _x)
285
- {
286
- unsigned short sw;
287
- __asm__ ("fxam;"
288
- "fstsw %%ax": "=a" (sw) : "t" (_x));
289
- return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
290
- == FP_NAN;
291
- }
292
-
293
- #define isnan(x) ((sizeof(x) == sizeof(float)) ? __isnanf(x) \
294
- : __isnan(x))
295
-
296
-
297
- #define isfinite(x) ((fpclassify(x) & FP_NAN) == 0)
298
- #define isinf(x) (fpclassify(x) == FP_INFINITE)
299
- #define isnormal(x) (fpclassify(x) == FP_NORMAL)
300
-
301
-
302
- extern __inline__ int __signbit (double x) {
303
- unsigned short stw;
304
- __asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
305
- return stw & 0x0200;
306
- }
307
-
308
- extern __inline__ int __signbitf (float x) {
309
- unsigned short stw;
310
- __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
311
- return stw & 0x0200;
312
- }
313
-
314
- #define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) \
315
- : __signbit(x))
316
- /*
317
- * With these functions, comparisons involving quiet NaNs set the FP
318
- * condition code to "unordered". The IEEE floating-point spec
319
- * dictates that the result of floating-point comparisons should be
320
- * false whenever a NaN is involved, with the exception of the !=,
321
- * which always returns true.
322
- */
323
-
324
- #if __GNUC__ >= 3
325
-
326
- #define isgreater(x, y) __builtin_isgreater(x, y)
327
- #define isgreaterequal(x, y) __builtin_isgreaterequal(x, y)
328
- #define isless(x, y) __builtin_isless(x, y)
329
- #define islessequal(x, y) __builtin_islessequal(x, y)
330
- #define islessgreater(x, y) __builtin_islessgreater(x, y)
331
- #define isunordered(x, y) __builtin_isunordered(x, y)
332
-
333
- #else
334
- /* helper */
335
- extern __inline__ int __fp_unordered_compare (double x, double y){
336
- unsigned short retval;
337
- __asm__ ("fucom %%st(1);"
338
- "fnstsw;": "=a" (retval) : "t" (x), "u" (y));
339
- return retval;
340
- }
341
-
342
- #define isgreater(x, y) ((__fp_unordered_compare(x, y) \
343
- & 0x4500) == 0)
344
- #define isless(x, y) ((__fp_unordered_compare (y, x) \
345
- & 0x4500) == 0)
346
- #define isgreaterequal(x, y) ((__fp_unordered_compare (x, y) \
347
- & FP_INFINITE) == 0)
348
- #define islessequal(x, y) ((__fp_unordered_compare(y, x) \
349
- & FP_INFINITE) == 0)
350
- #define islessgreater(x, y) ((__fp_unordered_compare(x, y) \
351
- & FP_SUBNORMAL) == 0)
352
- #define isunordered(x, y) ((__fp_unordered_compare(x, y) \
353
- & 0x4500) == 0x4500)
354
-
355
- #endif
356
-
357
- /* round, using fpu control word settings */
358
- extern __inline__ double rint (double x)
359
- {
360
- double retval;
361
- __asm__ ("frndint;": "=t" (retval) : "0" (x));
362
- return retval;
363
- }
364
-
365
- extern __inline__ float rintf (float x)
366
- {
367
- float retval;
368
- __asm__ ("frndint;" : "=t" (retval) : "0" (x) );
369
- return retval;
370
- }
371
-
372
- /* round away from zero, regardless of fpu control word settings */
373
- extern double round (double);
374
- extern float roundf (float);
375
-
376
- /* round towards zero, regardless of fpu control word settings */
377
- extern double trunc (double);
378
- extern float truncf (float);
379
-
380
-
381
- /* fmax and fmin.
382
- NaN arguments are treated as missing data: if one argument is a NaN and the other numeric, then the
383
- these functions choose the numeric value.
384
- */
385
-
386
- extern double fmax (double, double);
387
- extern double fmin (double, double);
388
- extern float fmaxf (float, float);
389
- float fminf (float, float);
390
-
391
- /* return x * y + z as a ternary op */
392
- extern double fma (double, double, double);
393
- extern float fmaf (float, float, float);
394
-
395
- /* one lonely transcendental */
396
- extern double log2 (double _x);
397
- extern float log2f (float _x);
398
-
399
- /* The underscored versions are in MSVCRT.dll.
400
- The stubs for these are in libmingwex.a */
401
-
402
- double copysign (double, double);
403
- float copysignf (float, float);
404
- double logb (double);
405
- float logbf (float);
406
- double nextafter (double, double);
407
- float nextafterf (float, float);
408
- double scalb (double, long);
409
- float scalbf (float, long);
410
-
411
- #if !defined (__STRICT_ANSI__) /* inline using non-ANSI functions */
412
- extern __inline__ double copysign (double x, double y)
413
- { return _copysign(x, y); }
414
- extern __inline__ float copysignf (float x, float y)
415
- { return _copysign(x, y); }
416
- extern __inline__ double logb (double x)
417
- { return _logb(x); }
418
- extern __inline__ float logbf (float x)
419
- { return _logb(x); }
420
- extern __inline__ double nextafter(double x, double y)
421
- { return _nextafter(x, y); }
422
- extern __inline__ float nextafterf(float x, float y)
423
- { return _nextafter(x, y); }
424
- extern __inline__ double scalb (double x, long i)
425
- { return _scalb (x, i); }
426
- extern __inline__ float scalbf (float x, long i)
427
- { return _scalb(x, i); }
428
- #endif /* (__STRICT_ANSI__) */
429
-
430
- #ifdef __cplusplus
431
- }
432
- #endif
433
- #endif /* Not RC_INVOKED */
434
-
435
- #endif /* __NO_ISOCEXT */
436
-
437
- #endif /* Not _MATH_H_ */
438
-
1
+ /*
2
+ * math.h
3
+ *
4
+ * Mathematical functions.
5
+ *
6
+ * This file is part of the Mingw32 package.
7
+ *
8
+ * Contributors:
9
+ * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
10
+ *
11
+ * THIS SOFTWARE IS NOT COPYRIGHTED
12
+ *
13
+ * This source code is offered for use in the public domain. You may
14
+ * use, modify or distribute it freely.
15
+ *
16
+ * This code is distributed in the hope that it will be useful but
17
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18
+ * DISCLAIMED. This includes but is not limited to warranties of
19
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
+ *
21
+ * $Revision: 1.2 $
22
+ * $Author: bellard $
23
+ * $Date: 2005/04/17 13:14:29 $
24
+ *
25
+ */
26
+
27
+ #ifndef _MATH_H_
28
+ #define _MATH_H_
29
+
30
+ /* All the headers include this file. */
31
+ #include <_mingw.h>
32
+
33
+ /*
34
+ * Types for the _exception structure.
35
+ */
36
+
37
+ #define _DOMAIN 1 /* domain error in argument */
38
+ #define _SING 2 /* singularity */
39
+ #define _OVERFLOW 3 /* range overflow */
40
+ #define _UNDERFLOW 4 /* range underflow */
41
+ #define _TLOSS 5 /* total loss of precision */
42
+ #define _PLOSS 6 /* partial loss of precision */
43
+
44
+ /*
45
+ * Exception types with non-ANSI names for compatibility.
46
+ */
47
+
48
+ #ifndef __STRICT_ANSI__
49
+ #ifndef _NO_OLDNAMES
50
+
51
+ #define DOMAIN _DOMAIN
52
+ #define SING _SING
53
+ #define OVERFLOW _OVERFLOW
54
+ #define UNDERFLOW _UNDERFLOW
55
+ #define TLOSS _TLOSS
56
+ #define PLOSS _PLOSS
57
+
58
+ #endif /* Not _NO_OLDNAMES */
59
+ #endif /* Not __STRICT_ANSI__ */
60
+
61
+
62
+ /* These are also defined in Mingw float.h; needed here as well to work
63
+ around GCC build issues. */
64
+ #ifndef __STRICT_ANSI__
65
+ #ifndef __MINGW_FPCLASS_DEFINED
66
+ #define __MINGW_FPCLASS_DEFINED 1
67
+ /* IEEE 754 classication */
68
+ #define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
69
+ #define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
70
+ #define _FPCLASS_NINF 0x0004 /* Negative Infinity */
71
+ #define _FPCLASS_NN 0x0008 /* Negative Normal */
72
+ #define _FPCLASS_ND 0x0010 /* Negative Denormal */
73
+ #define _FPCLASS_NZ 0x0020 /* Negative Zero */
74
+ #define _FPCLASS_PZ 0x0040 /* Positive Zero */
75
+ #define _FPCLASS_PD 0x0080 /* Positive Denormal */
76
+ #define _FPCLASS_PN 0x0100 /* Positive Normal */
77
+ #define _FPCLASS_PINF 0x0200 /* Positive Infinity */
78
+ #endif /* __MINGW_FPCLASS_DEFINED */
79
+ #endif /* Not __STRICT_ANSI__ */
80
+
81
+ #ifndef RC_INVOKED
82
+
83
+ #ifdef __cplusplus
84
+ extern "C" {
85
+ #endif
86
+
87
+ /*
88
+ * HUGE_VAL is returned by strtod when the value would overflow the
89
+ * representation of 'double'. There are other uses as well.
90
+ *
91
+ * __imp__HUGE is a pointer to the actual variable _HUGE in
92
+ * MSVCRT.DLL. If we used _HUGE directly we would get a pointer
93
+ * to a thunk function.
94
+ *
95
+ * NOTE: The CRTDLL version uses _HUGE_dll instead.
96
+ */
97
+
98
+ #ifndef __DECLSPEC_SUPPORTED
99
+
100
+ #ifdef __MSVCRT__
101
+ extern double* __imp__HUGE;
102
+ #define HUGE_VAL (*__imp__HUGE)
103
+ #else
104
+ /* CRTDLL */
105
+ extern double* __imp__HUGE_dll;
106
+ #define HUGE_VAL (*__imp__HUGE_dll)
107
+ #endif
108
+
109
+ #else /* __DECLSPEC_SUPPORTED */
110
+
111
+ #ifdef __MSVCRT__
112
+ __MINGW_IMPORT double _HUGE;
113
+ #define HUGE_VAL _HUGE
114
+ #else
115
+ /* CRTDLL */
116
+ __MINGW_IMPORT double _HUGE_dll;
117
+ #define HUGE_VAL _HUGE_dll
118
+ #endif
119
+
120
+ #endif /* __DECLSPEC_SUPPORTED */
121
+
122
+ struct _exception
123
+ {
124
+ int type;
125
+ char *name;
126
+ double arg1;
127
+ double arg2;
128
+ double retval;
129
+ };
130
+
131
+
132
+ double sin (double);
133
+ double cos (double);
134
+ double tan (double);
135
+ double sinh (double);
136
+ double cosh (double);
137
+ double tanh (double);
138
+ double asin (double);
139
+ double acos (double);
140
+ double atan (double);
141
+ double atan2 (double, double);
142
+ double exp (double);
143
+ double log (double);
144
+ double log10 (double);
145
+ double pow (double, double);
146
+ double sqrt (double);
147
+ double ceil (double);
148
+ double floor (double);
149
+ double fabs (double);
150
+ double ldexp (double, int);
151
+ double frexp (double, int*);
152
+ double modf (double, double*);
153
+ double fmod (double, double);
154
+
155
+
156
+ #ifndef __STRICT_ANSI__
157
+
158
+ /* Complex number (for cabs) */
159
+ struct _complex
160
+ {
161
+ double x; /* Real part */
162
+ double y; /* Imaginary part */
163
+ };
164
+
165
+ double _cabs (struct _complex);
166
+ double _hypot (double, double);
167
+ double _j0 (double);
168
+ double _j1 (double);
169
+ double _jn (int, double);
170
+ double _y0 (double);
171
+ double _y1 (double);
172
+ double _yn (int, double);
173
+ int _matherr (struct _exception *);
174
+
175
+ /* These are also declared in Mingw float.h; needed here as well to work
176
+ around GCC build issues. */
177
+ /* BEGIN FLOAT.H COPY */
178
+ /*
179
+ * IEEE recommended functions
180
+ */
181
+
182
+ double _chgsign (double);
183
+ double _copysign (double, double);
184
+ double _logb (double);
185
+ double _nextafter (double, double);
186
+ double _scalb (double, long);
187
+
188
+ int _finite (double);
189
+ int _fpclass (double);
190
+ int _isnan (double);
191
+
192
+ /* END FLOAT.H COPY */
193
+
194
+ #if !defined (_NO_OLDNAMES) \
195
+ || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L )
196
+
197
+ /*
198
+ * Non-underscored versions of non-ANSI functions. These reside in
199
+ * liboldnames.a. They are now also ISO C99 standand names.
200
+ * Provided for extra portability.
201
+ */
202
+
203
+ double cabs (struct _complex);
204
+ double hypot (double, double);
205
+ double j0 (double);
206
+ double j1 (double);
207
+ double jn (int, double);
208
+ double y0 (double);
209
+ double y1 (double);
210
+ double yn (int, double);
211
+
212
+ #endif /* Not _NO_OLDNAMES */
213
+
214
+ #endif /* Not __STRICT_ANSI__ */
215
+
216
+ #ifdef __cplusplus
217
+ }
218
+ #endif
219
+ #endif /* Not RC_INVOKED */
220
+
221
+
222
+ #ifndef __NO_ISOCEXT
223
+
224
+ #define INFINITY HUGE_VAL
225
+ #define NAN (0.0F/0.0F)
226
+
227
+ /*
228
+ Return values for fpclassify.
229
+ These are based on Intel x87 fpu condition codes
230
+ in the high byte of status word and differ from
231
+ the return values for MS IEEE 754 extension _fpclass()
232
+ */
233
+ #define FP_NAN 0x0100
234
+ #define FP_NORMAL 0x0400
235
+ #define FP_INFINITE (FP_NAN | FP_NORMAL)
236
+ #define FP_ZERO 0x4000
237
+ #define FP_SUBNORMAL (FP_NORMAL | FP_ZERO)
238
+ /* 0x0200 is signbit mask */
239
+
240
+ #ifndef RC_INVOKED
241
+ #ifdef __cplusplus
242
+ extern "C" {
243
+ #endif
244
+
245
+ double nan(const char *tagp);
246
+ float nanf(const char *tagp);
247
+
248
+ #ifndef __STRICT_ANSI__
249
+ #define nan() nan("")
250
+ #define nanf() nanf("")
251
+ #endif
252
+
253
+
254
+ /*
255
+ We can't inline float, because we want to ensure truncation
256
+ to semantic type before classification. If we extend to long
257
+ double, we will also need to make double extern only.
258
+ (A normal long double value might become subnormal when
259
+ converted to double, and zero when converted to float.)
260
+ */
261
+ extern __inline__ int __fpclassify (double x){
262
+ unsigned short sw;
263
+ __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x));
264
+ return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
265
+ }
266
+
267
+ extern int __fpclassifyf (float);
268
+
269
+ #define fpclassify(x) ((sizeof(x) == sizeof(float)) ? __fpclassifyf(x) \
270
+ : __fpclassify(x))
271
+
272
+ /* We don't need to worry about trucation here:
273
+ A NaN stays a NaN. */
274
+
275
+ extern __inline__ int __isnan (double _x)
276
+ {
277
+ unsigned short sw;
278
+ __asm__ ("fxam;"
279
+ "fstsw %%ax": "=a" (sw) : "t" (_x));
280
+ return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
281
+ == FP_NAN;
282
+ }
283
+
284
+ extern __inline__ int __isnanf (float _x)
285
+ {
286
+ unsigned short sw;
287
+ __asm__ ("fxam;"
288
+ "fstsw %%ax": "=a" (sw) : "t" (_x));
289
+ return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
290
+ == FP_NAN;
291
+ }
292
+
293
+ #define isnan(x) ((sizeof(x) == sizeof(float)) ? __isnanf(x) \
294
+ : __isnan(x))
295
+
296
+
297
+ #define isfinite(x) ((fpclassify(x) & FP_NAN) == 0)
298
+ #define isinf(x) (fpclassify(x) == FP_INFINITE)
299
+ #define isnormal(x) (fpclassify(x) == FP_NORMAL)
300
+
301
+
302
+ extern __inline__ int __signbit (double x) {
303
+ unsigned short stw;
304
+ __asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
305
+ return stw & 0x0200;
306
+ }
307
+
308
+ extern __inline__ int __signbitf (float x) {
309
+ unsigned short stw;
310
+ __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
311
+ return stw & 0x0200;
312
+ }
313
+
314
+ #define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) \
315
+ : __signbit(x))
316
+ /*
317
+ * With these functions, comparisons involving quiet NaNs set the FP
318
+ * condition code to "unordered". The IEEE floating-point spec
319
+ * dictates that the result of floating-point comparisons should be
320
+ * false whenever a NaN is involved, with the exception of the !=,
321
+ * which always returns true.
322
+ */
323
+
324
+ #if __GNUC__ >= 3
325
+
326
+ #define isgreater(x, y) __builtin_isgreater(x, y)
327
+ #define isgreaterequal(x, y) __builtin_isgreaterequal(x, y)
328
+ #define isless(x, y) __builtin_isless(x, y)
329
+ #define islessequal(x, y) __builtin_islessequal(x, y)
330
+ #define islessgreater(x, y) __builtin_islessgreater(x, y)
331
+ #define isunordered(x, y) __builtin_isunordered(x, y)
332
+
333
+ #else
334
+ /* helper */
335
+ extern __inline__ int __fp_unordered_compare (double x, double y){
336
+ unsigned short retval;
337
+ __asm__ ("fucom %%st(1);"
338
+ "fnstsw;": "=a" (retval) : "t" (x), "u" (y));
339
+ return retval;
340
+ }
341
+
342
+ #define isgreater(x, y) ((__fp_unordered_compare(x, y) \
343
+ & 0x4500) == 0)
344
+ #define isless(x, y) ((__fp_unordered_compare (y, x) \
345
+ & 0x4500) == 0)
346
+ #define isgreaterequal(x, y) ((__fp_unordered_compare (x, y) \
347
+ & FP_INFINITE) == 0)
348
+ #define islessequal(x, y) ((__fp_unordered_compare(y, x) \
349
+ & FP_INFINITE) == 0)
350
+ #define islessgreater(x, y) ((__fp_unordered_compare(x, y) \
351
+ & FP_SUBNORMAL) == 0)
352
+ #define isunordered(x, y) ((__fp_unordered_compare(x, y) \
353
+ & 0x4500) == 0x4500)
354
+
355
+ #endif
356
+
357
+ /* round, using fpu control word settings */
358
+ extern __inline__ double rint (double x)
359
+ {
360
+ double retval;
361
+ __asm__ ("frndint;": "=t" (retval) : "0" (x));
362
+ return retval;
363
+ }
364
+
365
+ extern __inline__ float rintf (float x)
366
+ {
367
+ float retval;
368
+ __asm__ ("frndint;" : "=t" (retval) : "0" (x) );
369
+ return retval;
370
+ }
371
+
372
+ /* round away from zero, regardless of fpu control word settings */
373
+ extern double round (double);
374
+ extern float roundf (float);
375
+
376
+ /* round towards zero, regardless of fpu control word settings */
377
+ extern double trunc (double);
378
+ extern float truncf (float);
379
+
380
+
381
+ /* fmax and fmin.
382
+ NaN arguments are treated as missing data: if one argument is a NaN and the other numeric, then the
383
+ these functions choose the numeric value.
384
+ */
385
+
386
+ extern double fmax (double, double);
387
+ extern double fmin (double, double);
388
+ extern float fmaxf (float, float);
389
+ float fminf (float, float);
390
+
391
+ /* return x * y + z as a ternary op */
392
+ extern double fma (double, double, double);
393
+ extern float fmaf (float, float, float);
394
+
395
+ /* one lonely transcendental */
396
+ extern double log2 (double _x);
397
+ extern float log2f (float _x);
398
+
399
+ /* The underscored versions are in MSVCRT.dll.
400
+ The stubs for these are in libmingwex.a */
401
+
402
+ double copysign (double, double);
403
+ float copysignf (float, float);
404
+ double logb (double);
405
+ float logbf (float);
406
+ double nextafter (double, double);
407
+ float nextafterf (float, float);
408
+ double scalb (double, long);
409
+ float scalbf (float, long);
410
+
411
+ #if !defined (__STRICT_ANSI__) /* inline using non-ANSI functions */
412
+ extern __inline__ double copysign (double x, double y)
413
+ { return _copysign(x, y); }
414
+ extern __inline__ float copysignf (float x, float y)
415
+ { return _copysign(x, y); }
416
+ extern __inline__ double logb (double x)
417
+ { return _logb(x); }
418
+ extern __inline__ float logbf (float x)
419
+ { return _logb(x); }
420
+ extern __inline__ double nextafter(double x, double y)
421
+ { return _nextafter(x, y); }
422
+ extern __inline__ float nextafterf(float x, float y)
423
+ { return _nextafter(x, y); }
424
+ extern __inline__ double scalb (double x, long i)
425
+ { return _scalb (x, i); }
426
+ extern __inline__ float scalbf (float x, long i)
427
+ { return _scalb(x, i); }
428
+ #endif /* (__STRICT_ANSI__) */
429
+
430
+ #ifdef __cplusplus
431
+ }
432
+ #endif
433
+ #endif /* Not RC_INVOKED */
434
+
435
+ #endif /* __NO_ISOCEXT */
436
+
437
+ #endif /* Not _MATH_H_ */
438
+