standalone-ruby 1.5.0 → 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 (170) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +53 -44
  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 -65
  77. data/lib/exe_packer.rb +72 -82
  78. data/lib/launcher.rb +58 -84
  79. data/lib/launcher_handler.rb +40 -52
  80. data/lib/parameter_parser.rb +215 -210
  81. data/lib/ruby_copy.rb +48 -26
  82. data/lib/standalone_ruby.rb +6 -6
  83. data/lib/version/version.rb +2 -2
  84. metadata +3 -89
  85. data/lib/data/bat-cmd/default_bat_cmd.txt +0 -9
  86. data/lib/data/exe_template/launcher_stub.c +0 -30
  87. data/lib/data/exe_template/launcher_stub.cpp +0 -9
  88. data/lib/data/tcc/include/_mingw.h +0 -54
  89. data/lib/data/tcc/include/assert.h +0 -71
  90. data/lib/data/tcc/include/conio.h +0 -159
  91. data/lib/data/tcc/include/ctype.h +0 -232
  92. data/lib/data/tcc/include/dir.h +0 -26
  93. data/lib/data/tcc/include/direct.h +0 -95
  94. data/lib/data/tcc/include/dirent.h +0 -96
  95. data/lib/data/tcc/include/dos.h +0 -110
  96. data/lib/data/tcc/include/errno.h +0 -117
  97. data/lib/data/tcc/include/excpt.h +0 -20
  98. data/lib/data/tcc/include/fcntl.h +0 -135
  99. data/lib/data/tcc/include/fenv.h +0 -85
  100. data/lib/data/tcc/include/float.h +0 -224
  101. data/lib/data/tcc/include/inttypes.h +0 -275
  102. data/lib/data/tcc/include/io.h +0 -296
  103. data/lib/data/tcc/include/limits.h +0 -115
  104. data/lib/data/tcc/include/locale.h +0 -100
  105. data/lib/data/tcc/include/malloc.h +0 -87
  106. data/lib/data/tcc/include/math.h +0 -438
  107. data/lib/data/tcc/include/mem.h +0 -8
  108. data/lib/data/tcc/include/memory.h +0 -9
  109. data/lib/data/tcc/include/process.h +0 -158
  110. data/lib/data/tcc/include/setjmp.h +0 -72
  111. data/lib/data/tcc/include/share.h +0 -44
  112. data/lib/data/tcc/include/signal.h +0 -111
  113. data/lib/data/tcc/include/stdarg.h +0 -16
  114. data/lib/data/tcc/include/stdbool.h +0 -10
  115. data/lib/data/tcc/include/stddef.h +0 -26
  116. data/lib/data/tcc/include/stdint.h +0 -184
  117. data/lib/data/tcc/include/stdio.h +0 -413
  118. data/lib/data/tcc/include/stdlib.h +0 -482
  119. data/lib/data/tcc/include/string.h +0 -206
  120. data/lib/data/tcc/include/sys/fcntl.h +0 -8
  121. data/lib/data/tcc/include/sys/file.h +0 -9
  122. data/lib/data/tcc/include/sys/locking.h +0 -52
  123. data/lib/data/tcc/include/sys/stat.h +0 -190
  124. data/lib/data/tcc/include/sys/time.h +0 -3
  125. data/lib/data/tcc/include/sys/timeb.h +0 -82
  126. data/lib/data/tcc/include/sys/types.h +0 -118
  127. data/lib/data/tcc/include/sys/unistd.h +0 -9
  128. data/lib/data/tcc/include/sys/utime.h +0 -89
  129. data/lib/data/tcc/include/tchar.h +0 -367
  130. data/lib/data/tcc/include/time.h +0 -219
  131. data/lib/data/tcc/include/unistd.h +0 -10
  132. data/lib/data/tcc/include/values.h +0 -4
  133. data/lib/data/tcc/include/varargs.h +0 -11
  134. data/lib/data/tcc/include/wchar.h +0 -318
  135. data/lib/data/tcc/include/wctype.h +0 -127
  136. data/lib/data/tcc/include/winapi/basetsd.h +0 -119
  137. data/lib/data/tcc/include/winapi/basetyps.h +0 -144
  138. data/lib/data/tcc/include/winapi/winbase.h +0 -1852
  139. data/lib/data/tcc/include/winapi/wincon.h +0 -207
  140. data/lib/data/tcc/include/winapi/windef.h +0 -240
  141. data/lib/data/tcc/include/winapi/windows.h +0 -176
  142. data/lib/data/tcc/include/winapi/winerror.h +0 -1054
  143. data/lib/data/tcc/include/winapi/wingdi.h +0 -2843
  144. data/lib/data/tcc/include/winapi/winnetwk.h +0 -346
  145. data/lib/data/tcc/include/winapi/winnls.h +0 -651
  146. data/lib/data/tcc/include/winapi/winnt.h +0 -2667
  147. data/lib/data/tcc/include/winapi/winreg.h +0 -159
  148. data/lib/data/tcc/include/winapi/winsvc.h +0 -309
  149. data/lib/data/tcc/include/winapi/winuser.h +0 -3472
  150. data/lib/data/tcc/include/winapi/winver.h +0 -133
  151. data/lib/data/tcc/lib/gdi32.def +0 -337
  152. data/lib/data/tcc/lib/kernel32.def +0 -763
  153. data/lib/data/tcc/lib/libtcc1.a +0 -0
  154. data/lib/data/tcc/lib/msvcrt.def +0 -782
  155. data/lib/data/tcc/lib/user32.def +0 -654
  156. data/lib/data/tcc/tcc.exe +0 -0
  157. data/lib/data/tcc/tiny_impdef.exe +0 -0
  158. data/lib/data/tcc/tiny_libmaker.exe +0 -0
  159. data/lib/data/vbs/default_vbs.txt +0 -7
  160. data/lib/data/vbs/vbs_gui.txt +0 -8
  161. data/lib/logger_helper.rb +0 -24
  162. data/lib/sfx_generator.rb +0 -11
  163. data/lib/utils/config_generator.rb +0 -5
  164. data/lib/utils/displayer.rb +0 -64
  165. data/lib/utils/exe_packer.rb +0 -72
  166. data/lib/utils/launcher.rb +0 -77
  167. data/lib/utils/launcher_handler.rb +0 -111
  168. data/lib/utils/logger_helper.rb +0 -24
  169. data/lib/utils/parameter_parser.rb +0 -211
  170. data/lib/utils/ruby_copy.rb +0 -26
@@ -1,85 +1,85 @@
1
- #ifndef _FENV_H
2
- #define _FENV_H
3
-
4
- /*
5
- For now, support only for the basic abstraction of flags that are
6
- either set or clear. fexcept_t could be structure that holds more info
7
- about the fp environment.
8
- */
9
- typedef unsigned short fexcept_t;
10
-
11
- /* This 28-byte struct represents the entire floating point
12
- environment as stored by fnstenv or fstenv */
13
- typedef struct
14
- {
15
- unsigned short __control_word;
16
- unsigned short __unused0;
17
- unsigned short __status_word;
18
- unsigned short __unused1;
19
- unsigned short __tag_word;
20
- unsigned short __unused2;
21
- unsigned int __ip_offset; /* instruction pointer offset */
22
- unsigned short __ip_selector;
23
- unsigned short __opcode;
24
- unsigned int __data_offset;
25
- unsigned short __data_selector;
26
- unsigned short __unused3;
27
- } fenv_t;
28
-
29
-
30
- /* FPU status word exception flags */
31
- #define FE_INVALID 0x01
32
- #define FE_DENORMAL 0x02
33
- #define FE_DIVBYZERO 0x04
34
- #define FE_OVERFLOW 0x08
35
- #define FE_UNDERFLOW 0x10
36
- #define FE_INEXACT 0x20
37
- #define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \
38
- | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
39
-
40
- /* FPU control word rounding flags */
41
- #define FE_TONEAREST 0x0000
42
- #define FE_DOWNWARD 0x0400
43
- #define FE_UPWARD 0x0800
44
- #define FE_TOWARDZERO 0x0c00
45
-
46
-
47
- /* The default floating point environment */
48
- #define FE_DFL_ENV ((const fenv_t *)-1)
49
-
50
-
51
- #ifndef RC_INVOKED
52
- #ifdef __cplusplus
53
- extern "C" {
54
- #endif
55
-
56
-
57
- /*TODO: Some of these could be inlined */
58
- /* 7.6.2 Exception */
59
-
60
- extern int feclearexcept (int);
61
- extern int fegetexceptflag (fexcept_t * flagp, int excepts);
62
- extern int feraiseexcept (int excepts );
63
- extern int fesetexceptflag (const fexcept_t *, int);
64
- extern int fetestexcept (int excepts);
65
-
66
-
67
- /* 7.6.3 Rounding */
68
-
69
- extern int fegetround (void);
70
- extern int fesetround (int mode);
71
-
72
-
73
- /* 7.6.4 Environment */
74
-
75
- extern int fegetenv (fenv_t * envp);
76
- extern int fesetenv (const fenv_t * );
77
- extern int feupdateenv (const fenv_t *);
78
- extern int feholdexcept (fenv_t *);
79
-
80
- #ifdef __cplusplus
81
- }
82
- #endif
83
- #endif /* Not RC_INVOKED */
84
-
85
- #endif /* ndef _FENV_H */
1
+ #ifndef _FENV_H
2
+ #define _FENV_H
3
+
4
+ /*
5
+ For now, support only for the basic abstraction of flags that are
6
+ either set or clear. fexcept_t could be structure that holds more info
7
+ about the fp environment.
8
+ */
9
+ typedef unsigned short fexcept_t;
10
+
11
+ /* This 28-byte struct represents the entire floating point
12
+ environment as stored by fnstenv or fstenv */
13
+ typedef struct
14
+ {
15
+ unsigned short __control_word;
16
+ unsigned short __unused0;
17
+ unsigned short __status_word;
18
+ unsigned short __unused1;
19
+ unsigned short __tag_word;
20
+ unsigned short __unused2;
21
+ unsigned int __ip_offset; /* instruction pointer offset */
22
+ unsigned short __ip_selector;
23
+ unsigned short __opcode;
24
+ unsigned int __data_offset;
25
+ unsigned short __data_selector;
26
+ unsigned short __unused3;
27
+ } fenv_t;
28
+
29
+
30
+ /* FPU status word exception flags */
31
+ #define FE_INVALID 0x01
32
+ #define FE_DENORMAL 0x02
33
+ #define FE_DIVBYZERO 0x04
34
+ #define FE_OVERFLOW 0x08
35
+ #define FE_UNDERFLOW 0x10
36
+ #define FE_INEXACT 0x20
37
+ #define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \
38
+ | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
39
+
40
+ /* FPU control word rounding flags */
41
+ #define FE_TONEAREST 0x0000
42
+ #define FE_DOWNWARD 0x0400
43
+ #define FE_UPWARD 0x0800
44
+ #define FE_TOWARDZERO 0x0c00
45
+
46
+
47
+ /* The default floating point environment */
48
+ #define FE_DFL_ENV ((const fenv_t *)-1)
49
+
50
+
51
+ #ifndef RC_INVOKED
52
+ #ifdef __cplusplus
53
+ extern "C" {
54
+ #endif
55
+
56
+
57
+ /*TODO: Some of these could be inlined */
58
+ /* 7.6.2 Exception */
59
+
60
+ extern int feclearexcept (int);
61
+ extern int fegetexceptflag (fexcept_t * flagp, int excepts);
62
+ extern int feraiseexcept (int excepts );
63
+ extern int fesetexceptflag (const fexcept_t *, int);
64
+ extern int fetestexcept (int excepts);
65
+
66
+
67
+ /* 7.6.3 Rounding */
68
+
69
+ extern int fegetround (void);
70
+ extern int fesetround (int mode);
71
+
72
+
73
+ /* 7.6.4 Environment */
74
+
75
+ extern int fegetenv (fenv_t * envp);
76
+ extern int fesetenv (const fenv_t * );
77
+ extern int feupdateenv (const fenv_t *);
78
+ extern int feholdexcept (fenv_t *);
79
+
80
+ #ifdef __cplusplus
81
+ }
82
+ #endif
83
+ #endif /* Not RC_INVOKED */
84
+
85
+ #endif /* ndef _FENV_H */
@@ -1,224 +1,224 @@
1
- /*
2
- * float.h
3
- *
4
- * Constants related to floating point arithmetic.
5
- *
6
- * Also included here are some non-ANSI bits for accessing the floating
7
- * point controller.
8
- *
9
- * NOTE: GCC provides float.h, and it is probably more accurate than this,
10
- * but it doesn't include the non-standard stuff for accessing the
11
- * fp controller. (TODO: Move those bits elsewhere?) Thus it is
12
- * probably not a good idea to use the GCC supplied version instead
13
- * of this header.
14
- *
15
- * This file is part of the Mingw32 package.
16
- *
17
- * Contributors:
18
- * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
19
- *
20
- * THIS SOFTWARE IS NOT COPYRIGHTED
21
- *
22
- * This source code is offered for use in the public domain. You may
23
- * use, modify or distribute it freely.
24
- *
25
- * This code is distributed in the hope that it will be useful but
26
- * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
27
- * DISCLAIMED. This includes but is not limited to warranties of
28
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
29
- *
30
- * $Revision: 1.2 $
31
- * $Author: bellard $
32
- * $Date: 2005/04/17 13:14:29 $
33
- *
34
- */
35
-
36
- #ifndef _FLOAT_H_
37
- #define _FLOAT_H_
38
-
39
- /* All the headers include this file. */
40
- #include <_mingw.h>
41
-
42
- #define FLT_ROUNDS 1
43
- #define FLT_GUARD 1
44
- #define FLT_NORMALIZE 1
45
-
46
- /*
47
- * The characteristics of float.
48
- */
49
-
50
- /* The radix for floating point representation. */
51
- #define FLT_RADIX 2
52
-
53
- /* Decimal digits of precision. */
54
- #define FLT_DIG 6
55
-
56
- /* Smallest number such that 1+x != 1 */
57
- #define FLT_EPSILON 1.19209290e-07F
58
-
59
- /* The number of base FLT_RADIX digits in the mantissa. */
60
- #define FLT_MANT_DIG 24
61
-
62
- /* The maximum floating point number. */
63
- #define FLT_MAX 3.40282347e+38F
64
-
65
- /* Maximum n such that FLT_RADIX^n - 1 is representable. */
66
- #define FLT_MAX_EXP 128
67
-
68
- /* Maximum n such that 10^n is representable. */
69
- #define FLT_MAX_10_EXP 38
70
-
71
- /* Minimum normalized floating-point number. */
72
- #define FLT_MIN 1.17549435e-38F
73
-
74
- /* Minimum n such that FLT_RADIX^n is a normalized number. */
75
- #define FLT_MIN_EXP (-125)
76
-
77
- /* Minimum n such that 10^n is a normalized number. */
78
- #define FLT_MIN_10_EXP (-37)
79
-
80
-
81
- /*
82
- * The characteristics of double.
83
- */
84
- #define DBL_DIG 15
85
- #define DBL_EPSILON 1.1102230246251568e-16
86
- #define DBL_MANT_DIG 53
87
- #define DBL_MAX 1.7976931348623157e+308
88
- #define DBL_MAX_EXP 1024
89
- #define DBL_MAX_10_EXP 308
90
- #define DBL_MIN 2.2250738585072014e-308
91
- #define DBL_MIN_EXP (-1021)
92
- #define DBL_MIN_10_EXP (-307)
93
-
94
-
95
- /*
96
- * The characteristics of long double.
97
- * NOTE: long double is the same as double.
98
- */
99
- #define LDBL_DIG 15
100
- #define LDBL_EPSILON 1.1102230246251568e-16L
101
- #define LDBL_MANT_DIG 53
102
- #define LDBL_MAX 1.7976931348623157e+308L
103
- #define LDBL_MAX_EXP 1024
104
- #define LDBL_MAX_10_EXP 308
105
- #define LDBL_MIN 2.2250738585072014e-308L
106
- #define LDBL_MIN_EXP (-1021)
107
- #define LDBL_MIN_10_EXP (-307)
108
-
109
-
110
- /*
111
- * Functions and definitions for controlling the FPU.
112
- */
113
- #ifndef __STRICT_ANSI__
114
-
115
- /* TODO: These constants are only valid for x86 machines */
116
-
117
- /* Control word masks for unMask */
118
- #define _MCW_EM 0x0008001F /* Error masks */
119
- #define _MCW_IC 0x00040000 /* Infinity */
120
- #define _MCW_RC 0x00000300 /* Rounding */
121
- #define _MCW_PC 0x00030000 /* Precision */
122
-
123
- /* Control word values for unNew (use with related unMask above) */
124
- #define _EM_INVALID 0x00000010
125
- #define _EM_DENORMAL 0x00080000
126
- #define _EM_ZERODIVIDE 0x00000008
127
- #define _EM_OVERFLOW 0x00000004
128
- #define _EM_UNDERFLOW 0x00000002
129
- #define _EM_INEXACT 0x00000001
130
- #define _IC_AFFINE 0x00040000
131
- #define _IC_PROJECTIVE 0x00000000
132
- #define _RC_CHOP 0x00000300
133
- #define _RC_UP 0x00000200
134
- #define _RC_DOWN 0x00000100
135
- #define _RC_NEAR 0x00000000
136
- #define _PC_24 0x00020000
137
- #define _PC_53 0x00010000
138
- #define _PC_64 0x00000000
139
-
140
- /* These are also defined in Mingw math.h, needed to work around
141
- GCC build issues. */
142
- /* Return values for fpclass. */
143
- #ifndef __MINGW_FPCLASS_DEFINED
144
- #define __MINGW_FPCLASS_DEFINED 1
145
- #define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
146
- #define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
147
- #define _FPCLASS_NINF 0x0004 /* Negative Infinity */
148
- #define _FPCLASS_NN 0x0008 /* Negative Normal */
149
- #define _FPCLASS_ND 0x0010 /* Negative Denormal */
150
- #define _FPCLASS_NZ 0x0020 /* Negative Zero */
151
- #define _FPCLASS_PZ 0x0040 /* Positive Zero */
152
- #define _FPCLASS_PD 0x0080 /* Positive Denormal */
153
- #define _FPCLASS_PN 0x0100 /* Positive Normal */
154
- #define _FPCLASS_PINF 0x0200 /* Positive Infinity */
155
- #endif /* __MINGW_FPCLASS_DEFINED */
156
-
157
- /* invalid subconditions (_SW_INVALID also set) */
158
- #define _SW_UNEMULATED 0x0040 /* unemulated instruction */
159
- #define _SW_SQRTNEG 0x0080 /* square root of a neg number */
160
- #define _SW_STACKOVERFLOW 0x0200 /* FP stack overflow */
161
- #define _SW_STACKUNDERFLOW 0x0400 /* FP stack underflow */
162
-
163
- /* Floating point error signals and return codes */
164
- #define _FPE_INVALID 0x81
165
- #define _FPE_DENORMAL 0x82
166
- #define _FPE_ZERODIVIDE 0x83
167
- #define _FPE_OVERFLOW 0x84
168
- #define _FPE_UNDERFLOW 0x85
169
- #define _FPE_INEXACT 0x86
170
- #define _FPE_UNEMULATED 0x87
171
- #define _FPE_SQRTNEG 0x88
172
- #define _FPE_STACKOVERFLOW 0x8a
173
- #define _FPE_STACKUNDERFLOW 0x8b
174
- #define _FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */
175
-
176
- #ifndef RC_INVOKED
177
-
178
- #ifdef __cplusplus
179
- extern "C" {
180
- #endif
181
-
182
- /* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask),
183
- * i.e. change the bits in unMask to have the values they have in unNew,
184
- * leaving other bits unchanged. */
185
- unsigned int _controlfp (unsigned int unNew, unsigned int unMask);
186
- unsigned int _control87 (unsigned int unNew, unsigned int unMask);
187
-
188
-
189
- unsigned int _clearfp (void); /* Clear the FPU status word */
190
- unsigned int _statusfp (void); /* Report the FPU status word */
191
- #define _clear87 _clearfp
192
- #define _status87 _statusfp
193
-
194
- void _fpreset (void); /* Reset the FPU */
195
- void fpreset (void);
196
-
197
- /* Global 'variable' for the current floating point error code. */
198
- int * __fpecode(void);
199
- #define _fpecode (*(__fpecode()))
200
-
201
- /*
202
- * IEEE recommended functions
203
- */
204
-
205
- double _chgsign (double);
206
- double _copysign (double, double);
207
- double _logb (double);
208
- double _nextafter (double, double);
209
- double _scalb (double, long);
210
-
211
- int _finite (double);
212
- int _fpclass (double);
213
- int _isnan (double);
214
-
215
- #ifdef __cplusplus
216
- }
217
- #endif
218
-
219
- #endif /* Not RC_INVOKED */
220
-
221
- #endif /* Not __STRICT_ANSI__ */
222
-
223
- #endif /* _FLOAT_H_ */
224
-
1
+ /*
2
+ * float.h
3
+ *
4
+ * Constants related to floating point arithmetic.
5
+ *
6
+ * Also included here are some non-ANSI bits for accessing the floating
7
+ * point controller.
8
+ *
9
+ * NOTE: GCC provides float.h, and it is probably more accurate than this,
10
+ * but it doesn't include the non-standard stuff for accessing the
11
+ * fp controller. (TODO: Move those bits elsewhere?) Thus it is
12
+ * probably not a good idea to use the GCC supplied version instead
13
+ * of this header.
14
+ *
15
+ * This file is part of the Mingw32 package.
16
+ *
17
+ * Contributors:
18
+ * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
19
+ *
20
+ * THIS SOFTWARE IS NOT COPYRIGHTED
21
+ *
22
+ * This source code is offered for use in the public domain. You may
23
+ * use, modify or distribute it freely.
24
+ *
25
+ * This code is distributed in the hope that it will be useful but
26
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
27
+ * DISCLAIMED. This includes but is not limited to warranties of
28
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
29
+ *
30
+ * $Revision: 1.2 $
31
+ * $Author: bellard $
32
+ * $Date: 2005/04/17 13:14:29 $
33
+ *
34
+ */
35
+
36
+ #ifndef _FLOAT_H_
37
+ #define _FLOAT_H_
38
+
39
+ /* All the headers include this file. */
40
+ #include <_mingw.h>
41
+
42
+ #define FLT_ROUNDS 1
43
+ #define FLT_GUARD 1
44
+ #define FLT_NORMALIZE 1
45
+
46
+ /*
47
+ * The characteristics of float.
48
+ */
49
+
50
+ /* The radix for floating point representation. */
51
+ #define FLT_RADIX 2
52
+
53
+ /* Decimal digits of precision. */
54
+ #define FLT_DIG 6
55
+
56
+ /* Smallest number such that 1+x != 1 */
57
+ #define FLT_EPSILON 1.19209290e-07F
58
+
59
+ /* The number of base FLT_RADIX digits in the mantissa. */
60
+ #define FLT_MANT_DIG 24
61
+
62
+ /* The maximum floating point number. */
63
+ #define FLT_MAX 3.40282347e+38F
64
+
65
+ /* Maximum n such that FLT_RADIX^n - 1 is representable. */
66
+ #define FLT_MAX_EXP 128
67
+
68
+ /* Maximum n such that 10^n is representable. */
69
+ #define FLT_MAX_10_EXP 38
70
+
71
+ /* Minimum normalized floating-point number. */
72
+ #define FLT_MIN 1.17549435e-38F
73
+
74
+ /* Minimum n such that FLT_RADIX^n is a normalized number. */
75
+ #define FLT_MIN_EXP (-125)
76
+
77
+ /* Minimum n such that 10^n is a normalized number. */
78
+ #define FLT_MIN_10_EXP (-37)
79
+
80
+
81
+ /*
82
+ * The characteristics of double.
83
+ */
84
+ #define DBL_DIG 15
85
+ #define DBL_EPSILON 1.1102230246251568e-16
86
+ #define DBL_MANT_DIG 53
87
+ #define DBL_MAX 1.7976931348623157e+308
88
+ #define DBL_MAX_EXP 1024
89
+ #define DBL_MAX_10_EXP 308
90
+ #define DBL_MIN 2.2250738585072014e-308
91
+ #define DBL_MIN_EXP (-1021)
92
+ #define DBL_MIN_10_EXP (-307)
93
+
94
+
95
+ /*
96
+ * The characteristics of long double.
97
+ * NOTE: long double is the same as double.
98
+ */
99
+ #define LDBL_DIG 15
100
+ #define LDBL_EPSILON 1.1102230246251568e-16L
101
+ #define LDBL_MANT_DIG 53
102
+ #define LDBL_MAX 1.7976931348623157e+308L
103
+ #define LDBL_MAX_EXP 1024
104
+ #define LDBL_MAX_10_EXP 308
105
+ #define LDBL_MIN 2.2250738585072014e-308L
106
+ #define LDBL_MIN_EXP (-1021)
107
+ #define LDBL_MIN_10_EXP (-307)
108
+
109
+
110
+ /*
111
+ * Functions and definitions for controlling the FPU.
112
+ */
113
+ #ifndef __STRICT_ANSI__
114
+
115
+ /* TODO: These constants are only valid for x86 machines */
116
+
117
+ /* Control word masks for unMask */
118
+ #define _MCW_EM 0x0008001F /* Error masks */
119
+ #define _MCW_IC 0x00040000 /* Infinity */
120
+ #define _MCW_RC 0x00000300 /* Rounding */
121
+ #define _MCW_PC 0x00030000 /* Precision */
122
+
123
+ /* Control word values for unNew (use with related unMask above) */
124
+ #define _EM_INVALID 0x00000010
125
+ #define _EM_DENORMAL 0x00080000
126
+ #define _EM_ZERODIVIDE 0x00000008
127
+ #define _EM_OVERFLOW 0x00000004
128
+ #define _EM_UNDERFLOW 0x00000002
129
+ #define _EM_INEXACT 0x00000001
130
+ #define _IC_AFFINE 0x00040000
131
+ #define _IC_PROJECTIVE 0x00000000
132
+ #define _RC_CHOP 0x00000300
133
+ #define _RC_UP 0x00000200
134
+ #define _RC_DOWN 0x00000100
135
+ #define _RC_NEAR 0x00000000
136
+ #define _PC_24 0x00020000
137
+ #define _PC_53 0x00010000
138
+ #define _PC_64 0x00000000
139
+
140
+ /* These are also defined in Mingw math.h, needed to work around
141
+ GCC build issues. */
142
+ /* Return values for fpclass. */
143
+ #ifndef __MINGW_FPCLASS_DEFINED
144
+ #define __MINGW_FPCLASS_DEFINED 1
145
+ #define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
146
+ #define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
147
+ #define _FPCLASS_NINF 0x0004 /* Negative Infinity */
148
+ #define _FPCLASS_NN 0x0008 /* Negative Normal */
149
+ #define _FPCLASS_ND 0x0010 /* Negative Denormal */
150
+ #define _FPCLASS_NZ 0x0020 /* Negative Zero */
151
+ #define _FPCLASS_PZ 0x0040 /* Positive Zero */
152
+ #define _FPCLASS_PD 0x0080 /* Positive Denormal */
153
+ #define _FPCLASS_PN 0x0100 /* Positive Normal */
154
+ #define _FPCLASS_PINF 0x0200 /* Positive Infinity */
155
+ #endif /* __MINGW_FPCLASS_DEFINED */
156
+
157
+ /* invalid subconditions (_SW_INVALID also set) */
158
+ #define _SW_UNEMULATED 0x0040 /* unemulated instruction */
159
+ #define _SW_SQRTNEG 0x0080 /* square root of a neg number */
160
+ #define _SW_STACKOVERFLOW 0x0200 /* FP stack overflow */
161
+ #define _SW_STACKUNDERFLOW 0x0400 /* FP stack underflow */
162
+
163
+ /* Floating point error signals and return codes */
164
+ #define _FPE_INVALID 0x81
165
+ #define _FPE_DENORMAL 0x82
166
+ #define _FPE_ZERODIVIDE 0x83
167
+ #define _FPE_OVERFLOW 0x84
168
+ #define _FPE_UNDERFLOW 0x85
169
+ #define _FPE_INEXACT 0x86
170
+ #define _FPE_UNEMULATED 0x87
171
+ #define _FPE_SQRTNEG 0x88
172
+ #define _FPE_STACKOVERFLOW 0x8a
173
+ #define _FPE_STACKUNDERFLOW 0x8b
174
+ #define _FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */
175
+
176
+ #ifndef RC_INVOKED
177
+
178
+ #ifdef __cplusplus
179
+ extern "C" {
180
+ #endif
181
+
182
+ /* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask),
183
+ * i.e. change the bits in unMask to have the values they have in unNew,
184
+ * leaving other bits unchanged. */
185
+ unsigned int _controlfp (unsigned int unNew, unsigned int unMask);
186
+ unsigned int _control87 (unsigned int unNew, unsigned int unMask);
187
+
188
+
189
+ unsigned int _clearfp (void); /* Clear the FPU status word */
190
+ unsigned int _statusfp (void); /* Report the FPU status word */
191
+ #define _clear87 _clearfp
192
+ #define _status87 _statusfp
193
+
194
+ void _fpreset (void); /* Reset the FPU */
195
+ void fpreset (void);
196
+
197
+ /* Global 'variable' for the current floating point error code. */
198
+ int * __fpecode(void);
199
+ #define _fpecode (*(__fpecode()))
200
+
201
+ /*
202
+ * IEEE recommended functions
203
+ */
204
+
205
+ double _chgsign (double);
206
+ double _copysign (double, double);
207
+ double _logb (double);
208
+ double _nextafter (double, double);
209
+ double _scalb (double, long);
210
+
211
+ int _finite (double);
212
+ int _fpclass (double);
213
+ int _isnan (double);
214
+
215
+ #ifdef __cplusplus
216
+ }
217
+ #endif
218
+
219
+ #endif /* Not RC_INVOKED */
220
+
221
+ #endif /* Not __STRICT_ANSI__ */
222
+
223
+ #endif /* _FLOAT_H_ */
224
+