standalone-ruby 1.4.2 → 1.5.1

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 (95) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -22
  3. data/lib/data/{tcc → c_compilers/tcc}/include/_mingw.h +54 -54
  4. data/lib/data/{tcc → c_compilers/tcc}/include/assert.h +71 -71
  5. data/lib/data/{tcc → c_compilers/tcc}/include/conio.h +159 -159
  6. data/lib/data/{tcc → c_compilers/tcc}/include/ctype.h +232 -232
  7. data/lib/data/{tcc → c_compilers/tcc}/include/dir.h +26 -26
  8. data/lib/data/{tcc → c_compilers/tcc}/include/direct.h +95 -95
  9. data/lib/data/{tcc → c_compilers/tcc}/include/dirent.h +96 -96
  10. data/lib/data/{tcc → c_compilers/tcc}/include/dos.h +110 -110
  11. data/lib/data/{tcc → c_compilers/tcc}/include/errno.h +117 -117
  12. data/lib/data/{tcc → c_compilers/tcc}/include/excpt.h +20 -20
  13. data/lib/data/{tcc → c_compilers/tcc}/include/fcntl.h +135 -135
  14. data/lib/data/{tcc → c_compilers/tcc}/include/fenv.h +85 -85
  15. data/lib/data/{tcc → c_compilers/tcc}/include/float.h +224 -224
  16. data/lib/data/{tcc → c_compilers/tcc}/include/inttypes.h +275 -275
  17. data/lib/data/{tcc → c_compilers/tcc}/include/io.h +296 -296
  18. data/lib/data/{tcc → c_compilers/tcc}/include/limits.h +115 -115
  19. data/lib/data/{tcc → c_compilers/tcc}/include/locale.h +100 -100
  20. data/lib/data/{tcc → c_compilers/tcc}/include/malloc.h +87 -87
  21. data/lib/data/{tcc → c_compilers/tcc}/include/math.h +438 -438
  22. data/lib/data/{tcc → c_compilers/tcc}/include/mem.h +8 -8
  23. data/lib/data/{tcc → c_compilers/tcc}/include/memory.h +9 -9
  24. data/lib/data/{tcc → c_compilers/tcc}/include/process.h +158 -158
  25. data/lib/data/{tcc → c_compilers/tcc}/include/setjmp.h +72 -72
  26. data/lib/data/{tcc → c_compilers/tcc}/include/share.h +44 -44
  27. data/lib/data/{tcc → c_compilers/tcc}/include/signal.h +111 -111
  28. data/lib/data/{tcc → c_compilers/tcc}/include/stdarg.h +16 -16
  29. data/lib/data/{tcc → c_compilers/tcc}/include/stdbool.h +10 -10
  30. data/lib/data/{tcc → c_compilers/tcc}/include/stddef.h +26 -26
  31. data/lib/data/{tcc → c_compilers/tcc}/include/stdint.h +184 -184
  32. data/lib/data/{tcc → c_compilers/tcc}/include/stdio.h +413 -413
  33. data/lib/data/{tcc → c_compilers/tcc}/include/stdlib.h +482 -482
  34. data/lib/data/{tcc → c_compilers/tcc}/include/string.h +206 -206
  35. data/lib/data/{tcc → c_compilers/tcc}/include/sys/fcntl.h +8 -8
  36. data/lib/data/{tcc → c_compilers/tcc}/include/sys/file.h +9 -9
  37. data/lib/data/{tcc → c_compilers/tcc}/include/sys/locking.h +52 -52
  38. data/lib/data/{tcc → c_compilers/tcc}/include/sys/stat.h +190 -190
  39. data/lib/data/{tcc → c_compilers/tcc}/include/sys/time.h +3 -3
  40. data/lib/data/{tcc → c_compilers/tcc}/include/sys/timeb.h +82 -82
  41. data/lib/data/{tcc → c_compilers/tcc}/include/sys/types.h +118 -118
  42. data/lib/data/{tcc/include → c_compilers/tcc/include/sys}/unistd.h +9 -10
  43. data/lib/data/{tcc → c_compilers/tcc}/include/sys/utime.h +89 -89
  44. data/lib/data/{tcc → c_compilers/tcc}/include/tchar.h +367 -367
  45. data/lib/data/{tcc → c_compilers/tcc}/include/time.h +219 -219
  46. data/lib/data/{tcc/include/sys → c_compilers/tcc/include}/unistd.h +10 -9
  47. data/lib/data/{tcc → c_compilers/tcc}/include/values.h +4 -4
  48. data/lib/data/{tcc → c_compilers/tcc}/include/varargs.h +11 -11
  49. data/lib/data/{tcc → c_compilers/tcc}/include/wchar.h +318 -318
  50. data/lib/data/{tcc → c_compilers/tcc}/include/wctype.h +127 -127
  51. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/basetsd.h +119 -119
  52. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/basetyps.h +144 -144
  53. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/winbase.h +1852 -1852
  54. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/wincon.h +207 -207
  55. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/windef.h +240 -240
  56. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/windows.h +176 -176
  57. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/winerror.h +1054 -1054
  58. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/wingdi.h +2843 -2843
  59. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/winnetwk.h +346 -346
  60. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/winnls.h +651 -651
  61. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/winnt.h +2667 -2667
  62. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/winreg.h +159 -159
  63. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/winsvc.h +309 -309
  64. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/winuser.h +3472 -3472
  65. data/lib/data/{tcc → c_compilers/tcc}/include/winapi/winver.h +133 -133
  66. data/lib/data/{tcc → c_compilers/tcc}/lib/gdi32.def +337 -337
  67. data/lib/data/{tcc → c_compilers/tcc}/lib/kernel32.def +763 -763
  68. data/lib/data/{tcc → c_compilers/tcc}/lib/msvcrt.def +782 -782
  69. data/lib/data/{tcc → c_compilers/tcc}/lib/user32.def +654 -654
  70. data/lib/data/{exe_template → exe_templates}/launcher_stub.c +2 -2
  71. data/lib/data/exe_templates/launcher_stub.cpp +31 -0
  72. data/lib/data/{vbs → launcher_templates/vbs}/default_vbs.txt +7 -7
  73. data/lib/data/{vbs → launcher_templates/vbs}/vbs_gui.txt +8 -8
  74. data/lib/data/resource_files/default.rc +17 -0
  75. data/lib/{utils/displayer.rb → displayer.rb} +6 -6
  76. data/lib/exe_packer.rb +68 -0
  77. data/lib/{utils/launcher.rb → launcher.rb} +18 -24
  78. data/lib/launcher_handler.rb +41 -0
  79. data/lib/parameter_parser.rb +201 -0
  80. data/lib/{utils/ruby_copy.rb → ruby_copy.rb} +0 -6
  81. data/lib/sfx_generator.rb +9 -0
  82. data/lib/standalone_ruby.rb +1 -1
  83. data/lib/version/version.rb +1 -1
  84. metadata +84 -87
  85. data/lib/data/bat-cmd/default_bat_cmd.txt +0 -9
  86. data/lib/data/exe_template/launcher_stub.cpp +0 -9
  87. data/lib/data/tcc/tiny_impdef.exe +0 -0
  88. data/lib/data/tcc/tiny_libmaker.exe +0 -0
  89. data/lib/utils/config_generator.rb +0 -5
  90. data/lib/utils/exe_packer.rb +0 -72
  91. data/lib/utils/launcher_handler.rb +0 -111
  92. data/lib/utils/logger_helper.rb +0 -24
  93. data/lib/utils/parameter_parser.rb +0 -211
  94. /data/lib/data/{tcc → c_compilers/tcc}/lib/libtcc1.a +0 -0
  95. /data/lib/data/{tcc → c_compilers/tcc}/tcc.exe +0 -0
@@ -1,127 +1,127 @@
1
- /*
2
- * wctype.h
3
- *
4
- * Functions for testing wide character types and converting characters.
5
- *
6
- * This file is part of the Mingw32 package.
7
- *
8
- * Contributors:
9
- * Created by Mumit Khan <khan@xraylith.wisc.edu>
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
- */
22
-
23
- #ifndef _WCTYPE_H_
24
- #define _WCTYPE_H_
25
-
26
- /* All the headers include this file. */
27
- #include <_mingw.h>
28
-
29
- #define __need_wchar_t
30
- #define __need_wint_t
31
- #ifndef RC_INVOKED
32
- #include <stddef.h>
33
- #endif /* Not RC_INVOKED */
34
-
35
- /*
36
- * The following flags are used to tell iswctype and _isctype what character
37
- * types you are looking for.
38
- */
39
- #define _UPPER 0x0001
40
- #define _LOWER 0x0002
41
- #define _DIGIT 0x0004
42
- #define _SPACE 0x0008
43
- #define _PUNCT 0x0010
44
- #define _CONTROL 0x0020
45
- #define _BLANK 0x0040
46
- #define _HEX 0x0080
47
- #define _LEADBYTE 0x8000
48
-
49
- #define _ALPHA 0x0103
50
-
51
- #ifndef RC_INVOKED
52
-
53
- #ifdef __cplusplus
54
- extern "C" {
55
- #endif
56
-
57
- #ifndef WEOF
58
- #define WEOF (wchar_t)(0xFFFF)
59
- #endif
60
-
61
- #ifndef _WCTYPE_T_DEFINED
62
- typedef wchar_t wctype_t;
63
- #define _WCTYPE_T_DEFINED
64
- #endif
65
-
66
- /* Wide character equivalents - also in ctype.h */
67
- int iswalnum(wint_t);
68
- int iswalpha(wint_t);
69
- int iswascii(wint_t);
70
- int iswcntrl(wint_t);
71
- int iswctype(wint_t, wctype_t);
72
- int is_wctype(wint_t, wctype_t); /* Obsolete! */
73
- int iswdigit(wint_t);
74
- int iswgraph(wint_t);
75
- int iswlower(wint_t);
76
- int iswprint(wint_t);
77
- int iswpunct(wint_t);
78
- int iswspace(wint_t);
79
- int iswupper(wint_t);
80
- int iswxdigit(wint_t);
81
-
82
- wchar_t towlower(wchar_t);
83
- wchar_t towupper(wchar_t);
84
-
85
- int isleadbyte (int);
86
-
87
- /* Also in ctype.h */
88
-
89
- __MINGW_IMPORT unsigned short _ctype[];
90
- #ifdef __MSVCRT__
91
- __MINGW_IMPORT unsigned short* _pctype;
92
- #else
93
- __MINGW_IMPORT unsigned short* _pctype_dll;
94
- #define _pctype _pctype_dll
95
- #endif
96
-
97
- #if !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
98
- #define __WCTYPE_INLINES_DEFINED
99
- extern inline int iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));}
100
- extern inline int iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));}
101
- extern inline int iswascii(wint_t wc) {return (((unsigned)wc & 0x7F) ==0);}
102
- extern inline int iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));}
103
- extern inline int iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));}
104
- extern inline int iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));}
105
- extern inline int iswlower(wint_t wc) {return (iswctype(wc,_LOWER));}
106
- extern inline int iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
107
- extern inline int iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));}
108
- extern inline int iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
109
- extern inline int iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
110
- extern inline int iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
111
- extern inline int isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);}
112
- #endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
113
-
114
-
115
- typedef wchar_t wctrans_t;
116
- wint_t towctrans(wint_t, wctrans_t);
117
- wctrans_t wctrans(const char*);
118
- wctype_t wctype(const char*);
119
-
120
- #ifdef __cplusplus
121
- }
122
- #endif
123
-
124
- #endif /* Not RC_INVOKED */
125
-
126
- #endif /* Not _WCTYPE_H_ */
127
-
1
+ /*
2
+ * wctype.h
3
+ *
4
+ * Functions for testing wide character types and converting characters.
5
+ *
6
+ * This file is part of the Mingw32 package.
7
+ *
8
+ * Contributors:
9
+ * Created by Mumit Khan <khan@xraylith.wisc.edu>
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
+ */
22
+
23
+ #ifndef _WCTYPE_H_
24
+ #define _WCTYPE_H_
25
+
26
+ /* All the headers include this file. */
27
+ #include <_mingw.h>
28
+
29
+ #define __need_wchar_t
30
+ #define __need_wint_t
31
+ #ifndef RC_INVOKED
32
+ #include <stddef.h>
33
+ #endif /* Not RC_INVOKED */
34
+
35
+ /*
36
+ * The following flags are used to tell iswctype and _isctype what character
37
+ * types you are looking for.
38
+ */
39
+ #define _UPPER 0x0001
40
+ #define _LOWER 0x0002
41
+ #define _DIGIT 0x0004
42
+ #define _SPACE 0x0008
43
+ #define _PUNCT 0x0010
44
+ #define _CONTROL 0x0020
45
+ #define _BLANK 0x0040
46
+ #define _HEX 0x0080
47
+ #define _LEADBYTE 0x8000
48
+
49
+ #define _ALPHA 0x0103
50
+
51
+ #ifndef RC_INVOKED
52
+
53
+ #ifdef __cplusplus
54
+ extern "C" {
55
+ #endif
56
+
57
+ #ifndef WEOF
58
+ #define WEOF (wchar_t)(0xFFFF)
59
+ #endif
60
+
61
+ #ifndef _WCTYPE_T_DEFINED
62
+ typedef wchar_t wctype_t;
63
+ #define _WCTYPE_T_DEFINED
64
+ #endif
65
+
66
+ /* Wide character equivalents - also in ctype.h */
67
+ int iswalnum(wint_t);
68
+ int iswalpha(wint_t);
69
+ int iswascii(wint_t);
70
+ int iswcntrl(wint_t);
71
+ int iswctype(wint_t, wctype_t);
72
+ int is_wctype(wint_t, wctype_t); /* Obsolete! */
73
+ int iswdigit(wint_t);
74
+ int iswgraph(wint_t);
75
+ int iswlower(wint_t);
76
+ int iswprint(wint_t);
77
+ int iswpunct(wint_t);
78
+ int iswspace(wint_t);
79
+ int iswupper(wint_t);
80
+ int iswxdigit(wint_t);
81
+
82
+ wchar_t towlower(wchar_t);
83
+ wchar_t towupper(wchar_t);
84
+
85
+ int isleadbyte (int);
86
+
87
+ /* Also in ctype.h */
88
+
89
+ __MINGW_IMPORT unsigned short _ctype[];
90
+ #ifdef __MSVCRT__
91
+ __MINGW_IMPORT unsigned short* _pctype;
92
+ #else
93
+ __MINGW_IMPORT unsigned short* _pctype_dll;
94
+ #define _pctype _pctype_dll
95
+ #endif
96
+
97
+ #if !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
98
+ #define __WCTYPE_INLINES_DEFINED
99
+ extern inline int iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));}
100
+ extern inline int iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));}
101
+ extern inline int iswascii(wint_t wc) {return (((unsigned)wc & 0x7F) ==0);}
102
+ extern inline int iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));}
103
+ extern inline int iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));}
104
+ extern inline int iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));}
105
+ extern inline int iswlower(wint_t wc) {return (iswctype(wc,_LOWER));}
106
+ extern inline int iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
107
+ extern inline int iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));}
108
+ extern inline int iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
109
+ extern inline int iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
110
+ extern inline int iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
111
+ extern inline int isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);}
112
+ #endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
113
+
114
+
115
+ typedef wchar_t wctrans_t;
116
+ wint_t towctrans(wint_t, wctrans_t);
117
+ wctrans_t wctrans(const char*);
118
+ wctype_t wctype(const char*);
119
+
120
+ #ifdef __cplusplus
121
+ }
122
+ #endif
123
+
124
+ #endif /* Not RC_INVOKED */
125
+
126
+ #endif /* Not _WCTYPE_H_ */
127
+
@@ -1,119 +1,119 @@
1
- #ifndef _BASETSD_H
2
- #define _BASETSD_H
3
- #if __GNUC__ >=3
4
- #pragma GCC system_header
5
- #endif
6
-
7
- #ifdef __GNUC__
8
- #ifndef __int64
9
- #define __int64 long long
10
- #endif
11
- #endif
12
-
13
- #if defined(_WIN64)
14
- #define __int3264 __int64
15
- #define ADDRESS_TAG_BIT 0x40000000000UI64
16
- #else /* !_WIN64 */
17
- #define __int3264 __int32
18
- #define ADDRESS_TAG_BIT 0x80000000UL
19
- #define HandleToUlong( h ) ((ULONG)(ULONG_PTR)(h) )
20
- #define HandleToLong( h ) ((LONG)(LONG_PTR) (h) )
21
- #define LongToHandle( h) ((HANDLE)(LONG_PTR) (h))
22
- #define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) )
23
- #define PtrToLong( p ) ((LONG)(LONG_PTR) (p) )
24
- #define PtrToUint( p ) ((UINT)(UINT_PTR) (p) )
25
- #define PtrToInt( p ) ((INT)(INT_PTR) (p) )
26
- #define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) )
27
- #define PtrToShort( p ) ((short)(LONG_PTR)(p) )
28
- #define IntToPtr( i ) ((VOID*)(INT_PTR)((int)i))
29
- #define UIntToPtr( ui ) ((VOID*)(UINT_PTR)((unsigned int)ui))
30
- #define LongToPtr( l ) ((VOID*)(LONG_PTR)((long)l))
31
- #define ULongToPtr( ul ) ((VOID*)(ULONG_PTR)((unsigned long)ul))
32
- #endif /* !_WIN64 */
33
-
34
- #define UlongToPtr(ul) ULongToPtr(ul)
35
- #define UintToPtr(ui) UIntToPtr(ui)
36
- #define MAXUINT_PTR (~((UINT_PTR)0))
37
- #define MAXINT_PTR ((INT_PTR)(MAXUINT_PTR >> 1))
38
- #define MININT_PTR (~MAXINT_PTR)
39
- #define MAXULONG_PTR (~((ULONG_PTR)0))
40
- #define MAXLONG_PTR ((LONG_PTR)(MAXULONG_PTR >> 1))
41
- #define MINLONG_PTR (~MAXLONG_PTR)
42
- #define MAXUHALF_PTR ((UHALF_PTR)~0)
43
- #define MAXHALF_PTR ((HALF_PTR)(MAXUHALF_PTR >> 1))
44
- #define MINHALF_PTR (~MAXHALF_PTR)
45
-
46
- #ifndef RC_INVOKED
47
- #ifdef __cplusplus
48
- extern "C" {
49
- #endif
50
- typedef int LONG32, *PLONG32;
51
- #ifndef XFree86Server
52
- typedef int INT32, *PINT32;
53
- #endif /* ndef XFree86Server */
54
- typedef unsigned int ULONG32, *PULONG32;
55
- typedef unsigned int DWORD32, *PDWORD32;
56
- typedef unsigned int UINT32, *PUINT32;
57
-
58
- #if defined(_WIN64)
59
- typedef __int64 INT_PTR, *PINT_PTR;
60
- typedef unsigned __int64 UINT_PTR, *PUINT_PTR;
61
- typedef __int64 LONG_PTR, *PLONG_PTR;
62
- typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
63
- typedef unsigned __int64 HANDLE_PTR;
64
- typedef unsigned int UHALF_PTR, *PUHALF_PTR;
65
- typedef int HALF_PTR, *PHALF_PTR;
66
-
67
- #if 0 /* TODO when WIN64 is here */
68
- inline unsigned long HandleToUlong(const void* h )
69
- { return((unsigned long) h ); }
70
- inline long HandleToLong( const void* h )
71
- { return((long) h ); }
72
- inline void* LongToHandle( const long h )
73
- { return((void*) (INT_PTR) h ); }
74
- inline unsigned long PtrToUlong( const void* p)
75
- { return((unsigned long) p ); }
76
- inline unsigned int PtrToUint( const void* p )
77
- { return((unsigned int) p ); }
78
- inline unsigned short PtrToUshort( const void* p )
79
- { return((unsigned short) p ); }
80
- inline long PtrToLong( const void* p )
81
- { return((long) p ); }
82
- inline int PtrToInt( const void* p )
83
- { return((int) p ); }
84
- inline short PtrToShort( const void* p )
85
- { return((short) p ); }
86
- inline void* IntToPtr( const int i )
87
- { return( (void*)(INT_PTR)i ); }
88
- inline void* UIntToPtr(const unsigned int ui)
89
- { return( (void*)(UINT_PTR)ui ); }
90
- inline void* LongToPtr( const long l )
91
- { return( (void*)(LONG_PTR)l ); }
92
- inline void* ULongToPtr( const unsigned long ul )
93
- { return( (void*)(ULONG_PTR)ul ); }
94
- #endif /* 0_ */
95
-
96
- #else /* !_WIN64 */
97
- typedef int INT_PTR, *PINT_PTR;
98
- typedef unsigned int UINT_PTR, *PUINT_PTR;
99
- typedef long LONG_PTR, *PLONG_PTR;
100
- typedef unsigned long ULONG_PTR, *PULONG_PTR;
101
- typedef unsigned short UHALF_PTR, *PUHALF_PTR;
102
- typedef short HALF_PTR, *PHALF_PTR;
103
- typedef unsigned long HANDLE_PTR;
104
- #endif /* !_WIN64 */
105
-
106
- typedef ULONG_PTR SIZE_T, *PSIZE_T;
107
- typedef LONG_PTR SSIZE_T, *PSSIZE_T;
108
- typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR;
109
- typedef __int64 LONG64, *PLONG64;
110
- typedef __int64 INT64, *PINT64;
111
- typedef unsigned __int64 ULONG64, *PULONG64;
112
- typedef unsigned __int64 DWORD64, *PDWORD64;
113
- typedef unsigned __int64 UINT64, *PUINT64;
114
- #ifdef __cplusplus
115
- }
116
- #endif
117
- #endif /* !RC_INVOKED */
118
-
119
- #endif /* _BASETSD_H */
1
+ #ifndef _BASETSD_H
2
+ #define _BASETSD_H
3
+ #if __GNUC__ >=3
4
+ #pragma GCC system_header
5
+ #endif
6
+
7
+ #ifdef __GNUC__
8
+ #ifndef __int64
9
+ #define __int64 long long
10
+ #endif
11
+ #endif
12
+
13
+ #if defined(_WIN64)
14
+ #define __int3264 __int64
15
+ #define ADDRESS_TAG_BIT 0x40000000000UI64
16
+ #else /* !_WIN64 */
17
+ #define __int3264 __int32
18
+ #define ADDRESS_TAG_BIT 0x80000000UL
19
+ #define HandleToUlong( h ) ((ULONG)(ULONG_PTR)(h) )
20
+ #define HandleToLong( h ) ((LONG)(LONG_PTR) (h) )
21
+ #define LongToHandle( h) ((HANDLE)(LONG_PTR) (h))
22
+ #define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) )
23
+ #define PtrToLong( p ) ((LONG)(LONG_PTR) (p) )
24
+ #define PtrToUint( p ) ((UINT)(UINT_PTR) (p) )
25
+ #define PtrToInt( p ) ((INT)(INT_PTR) (p) )
26
+ #define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) )
27
+ #define PtrToShort( p ) ((short)(LONG_PTR)(p) )
28
+ #define IntToPtr( i ) ((VOID*)(INT_PTR)((int)i))
29
+ #define UIntToPtr( ui ) ((VOID*)(UINT_PTR)((unsigned int)ui))
30
+ #define LongToPtr( l ) ((VOID*)(LONG_PTR)((long)l))
31
+ #define ULongToPtr( ul ) ((VOID*)(ULONG_PTR)((unsigned long)ul))
32
+ #endif /* !_WIN64 */
33
+
34
+ #define UlongToPtr(ul) ULongToPtr(ul)
35
+ #define UintToPtr(ui) UIntToPtr(ui)
36
+ #define MAXUINT_PTR (~((UINT_PTR)0))
37
+ #define MAXINT_PTR ((INT_PTR)(MAXUINT_PTR >> 1))
38
+ #define MININT_PTR (~MAXINT_PTR)
39
+ #define MAXULONG_PTR (~((ULONG_PTR)0))
40
+ #define MAXLONG_PTR ((LONG_PTR)(MAXULONG_PTR >> 1))
41
+ #define MINLONG_PTR (~MAXLONG_PTR)
42
+ #define MAXUHALF_PTR ((UHALF_PTR)~0)
43
+ #define MAXHALF_PTR ((HALF_PTR)(MAXUHALF_PTR >> 1))
44
+ #define MINHALF_PTR (~MAXHALF_PTR)
45
+
46
+ #ifndef RC_INVOKED
47
+ #ifdef __cplusplus
48
+ extern "C" {
49
+ #endif
50
+ typedef int LONG32, *PLONG32;
51
+ #ifndef XFree86Server
52
+ typedef int INT32, *PINT32;
53
+ #endif /* ndef XFree86Server */
54
+ typedef unsigned int ULONG32, *PULONG32;
55
+ typedef unsigned int DWORD32, *PDWORD32;
56
+ typedef unsigned int UINT32, *PUINT32;
57
+
58
+ #if defined(_WIN64)
59
+ typedef __int64 INT_PTR, *PINT_PTR;
60
+ typedef unsigned __int64 UINT_PTR, *PUINT_PTR;
61
+ typedef __int64 LONG_PTR, *PLONG_PTR;
62
+ typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
63
+ typedef unsigned __int64 HANDLE_PTR;
64
+ typedef unsigned int UHALF_PTR, *PUHALF_PTR;
65
+ typedef int HALF_PTR, *PHALF_PTR;
66
+
67
+ #if 0 /* TODO when WIN64 is here */
68
+ inline unsigned long HandleToUlong(const void* h )
69
+ { return((unsigned long) h ); }
70
+ inline long HandleToLong( const void* h )
71
+ { return((long) h ); }
72
+ inline void* LongToHandle( const long h )
73
+ { return((void*) (INT_PTR) h ); }
74
+ inline unsigned long PtrToUlong( const void* p)
75
+ { return((unsigned long) p ); }
76
+ inline unsigned int PtrToUint( const void* p )
77
+ { return((unsigned int) p ); }
78
+ inline unsigned short PtrToUshort( const void* p )
79
+ { return((unsigned short) p ); }
80
+ inline long PtrToLong( const void* p )
81
+ { return((long) p ); }
82
+ inline int PtrToInt( const void* p )
83
+ { return((int) p ); }
84
+ inline short PtrToShort( const void* p )
85
+ { return((short) p ); }
86
+ inline void* IntToPtr( const int i )
87
+ { return( (void*)(INT_PTR)i ); }
88
+ inline void* UIntToPtr(const unsigned int ui)
89
+ { return( (void*)(UINT_PTR)ui ); }
90
+ inline void* LongToPtr( const long l )
91
+ { return( (void*)(LONG_PTR)l ); }
92
+ inline void* ULongToPtr( const unsigned long ul )
93
+ { return( (void*)(ULONG_PTR)ul ); }
94
+ #endif /* 0_ */
95
+
96
+ #else /* !_WIN64 */
97
+ typedef int INT_PTR, *PINT_PTR;
98
+ typedef unsigned int UINT_PTR, *PUINT_PTR;
99
+ typedef long LONG_PTR, *PLONG_PTR;
100
+ typedef unsigned long ULONG_PTR, *PULONG_PTR;
101
+ typedef unsigned short UHALF_PTR, *PUHALF_PTR;
102
+ typedef short HALF_PTR, *PHALF_PTR;
103
+ typedef unsigned long HANDLE_PTR;
104
+ #endif /* !_WIN64 */
105
+
106
+ typedef ULONG_PTR SIZE_T, *PSIZE_T;
107
+ typedef LONG_PTR SSIZE_T, *PSSIZE_T;
108
+ typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR;
109
+ typedef __int64 LONG64, *PLONG64;
110
+ typedef __int64 INT64, *PINT64;
111
+ typedef unsigned __int64 ULONG64, *PULONG64;
112
+ typedef unsigned __int64 DWORD64, *PDWORD64;
113
+ typedef unsigned __int64 UINT64, *PUINT64;
114
+ #ifdef __cplusplus
115
+ }
116
+ #endif
117
+ #endif /* !RC_INVOKED */
118
+
119
+ #endif /* _BASETSD_H */