@xnetx/tinyc-native-x86_64-w64-mingw32 0.1.3 → 0.2.0

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 (124) hide show
  1. package/natives/x86_64-w64-mingw32/toolchain/x86_64-w64-mingw32/tinyc.exe +0 -0
  2. package/package.json +1 -1
  3. package/sysroot/x86_64-w64-mingw32/include/tinyc_io.h +131 -131
  4. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/_mingw.h +171 -171
  5. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/arm_neon.h +3585 -0
  6. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/assert.h +62 -62
  7. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx2intrin.h +93 -0
  8. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512bwintrin.h +128 -0
  9. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512cdintrin.h +31 -0
  10. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512dqintrin.h +123 -0
  11. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512fintrin.h +1075 -0
  12. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512vbmiintrin.h +30 -0
  13. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512vlintrin.h +1633 -0
  14. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avx512vnniintrin.h +33 -0
  15. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/avxintrin.h +675 -0
  16. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/conio.h +409 -409
  17. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/ctype.h +281 -281
  18. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dir.h +31 -31
  19. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/direct.h +68 -68
  20. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dirent.h +135 -135
  21. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/dos.h +55 -55
  22. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/emmintrin.h +213 -0
  23. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/errno.h +75 -75
  24. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/excpt.h +123 -123
  25. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/f16cintrin.h +29 -0
  26. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/fcntl.h +52 -52
  27. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/fenv.h +108 -108
  28. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/float.h +75 -75
  29. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/fmaintrin.h +141 -0
  30. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/immintrin.h +21 -0
  31. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/inttypes.h +297 -297
  32. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/io.h +418 -418
  33. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/iso646.h +36 -36
  34. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/limits.h +116 -116
  35. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/locale.h +91 -91
  36. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/malloc.h +181 -181
  37. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/math.h +497 -497
  38. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/mem.h +13 -13
  39. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/memory.h +40 -40
  40. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/process.h +176 -176
  41. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/riscv_vector.h +12334 -0
  42. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/conio_s.h +42 -42
  43. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/crtdbg_s.h +19 -19
  44. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/io_s.h +33 -33
  45. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/mbstring_s.h +52 -52
  46. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/search_s.h +25 -25
  47. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stdio_s.h +145 -145
  48. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stdlib_s.h +67 -67
  49. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/stralign_s.h +30 -30
  50. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/string_s.h +41 -41
  51. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/sys/timeb_s.h +34 -34
  52. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/tchar_s.h +266 -266
  53. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/time_s.h +61 -61
  54. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sec_api/wchar_s.h +128 -128
  55. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/setjmp.h +199 -199
  56. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/share.h +28 -28
  57. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/signal.h +63 -63
  58. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/smmintrin.h +74 -0
  59. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdalign.h +16 -16
  60. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdarg.h +14 -14
  61. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdatomic.h +171 -171
  62. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdbool.h +11 -11
  63. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stddef.h +39 -39
  64. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdint.h +212 -212
  65. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdio.h +429 -429
  66. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdlib.h +606 -606
  67. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/stdnoreturn.h +7 -7
  68. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/string.h +164 -164
  69. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/fcntl.h +13 -13
  70. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/file.h +14 -14
  71. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/locking.h +30 -30
  72. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/stat.h +290 -290
  73. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/time.h +69 -69
  74. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/timeb.h +133 -133
  75. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/types.h +123 -123
  76. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/unistd.h +14 -14
  77. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/sys/utime.h +146 -146
  78. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tcc/tcc_libm.h +618 -618
  79. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tccdefs.h +338 -338
  80. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tcclib.h +82 -82
  81. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tchar.h +1102 -1102
  82. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tgmath.h +89 -89
  83. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/time.h +287 -287
  84. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/tmmintrin.h +19 -0
  85. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/uchar.h +33 -33
  86. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/unistd.h +1 -1
  87. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/vadefs.h +11 -11
  88. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/values.h +4 -4
  89. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/varargs.h +12 -12
  90. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/wchar.h +873 -873
  91. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/wctype.h +172 -172
  92. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/basetsd.h +149 -149
  93. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/basetyps.h +85 -85
  94. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/guiddef.h +156 -156
  95. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/poppack.h +8 -8
  96. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack1.h +8 -8
  97. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack2.h +8 -8
  98. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack4.h +8 -8
  99. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/pshpack8.h +8 -8
  100. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/qos.h +72 -72
  101. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/shellapi.h +59 -59
  102. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winbase.h +2966 -2966
  103. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/wincon.h +309 -309
  104. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/windef.h +293 -293
  105. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/windows.h +127 -127
  106. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winerror.h +3166 -3166
  107. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/wingdi.h +4080 -4080
  108. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winnls.h +778 -778
  109. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winnt.h +5994 -5994
  110. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winreg.h +272 -272
  111. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winsock2.h +1474 -1474
  112. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winuser.h +5652 -5652
  113. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/winver.h +160 -160
  114. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/ws2ipdef.h +21 -21
  115. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/winapi/ws2tcpip.h +391 -391
  116. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/include/xmmintrin.h +170 -0
  117. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/gdi32.def +337 -337
  118. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/kernel32.def +776 -776
  119. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/libtcc1.a +0 -0
  120. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/msvcrt.def +1320 -1320
  121. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/runmain.o +0 -0
  122. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/user32.def +658 -658
  123. package/sysroot/x86_64-w64-mingw32/lib/tcc/win32/lib/ws2_32.def +198 -198
  124. package/sysroot/x86_64-w64-mingw32/manifest.json +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xnetx/tinyc-native-x86_64-w64-mingw32",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "description": "TinyC native binaries for host x86_64-w64-mingw32 (dual-form TCC builds and target sysroots).",
5
5
  "license": "LGPL-2.1-or-later",
6
6
  "os": [
@@ -1,131 +1,131 @@
1
- /* tinyc_io.h - IO abstraction for the TinyC dual-form kernel.
2
- *
3
- * All compiler-owned input/output goes through a TCCIO object owned
4
- * by a TCCState: tcc_set_io (libtcc.h) installs one on a state, and
5
- * every compiler output path of that state - diagnostics, help,
6
- * version, -E output, the -run stdio redirect - goes through it.
7
- * There is no process-wide current IO. A state with no IO installed,
8
- * and a NULL TCCIO everywhere in this API, mean the stdio
9
- * implementation: output goes directly to the process's real
10
- * stdout/stderr and input comes from the real stdin.
11
- */
12
- #ifndef TINYC_IO_H
13
- #define TINYC_IO_H
14
-
15
- #include <stddef.h>
16
- #include <stdio.h>
17
-
18
- #ifdef __cplusplus
19
- extern "C" {
20
- #endif
21
-
22
- typedef struct TCCIO TCCIO;
23
- struct TCCIO {
24
- void *ctx;
25
- /* Return the number of bytes consumed, or -1 on error. */
26
- int (*write_out)(void *ctx, const char *buf, size_t len);
27
- int (*write_err)(void *ctx, const char *buf, size_t len);
28
- /* Return bytes read (0 = EOF), or -1 on error. */
29
- int (*read_in)(void *ctx, char *buf, size_t cap);
30
- void (*flush)(void *ctx);
31
- /* Internal: release ctx. Set by constructors, used by tcc_io_free. */
32
- void (*destroy_ctx)(void *ctx);
33
- int is_singleton; /* stdio/null: tcc_io_free is a no-op */
34
- };
35
-
36
- /* ---- ready-made implementations ------------------------------------ */
37
-
38
- /* The default: out -> stdout, err -> stderr, in <- stdin. Singleton. */
39
- TCCIO *tcc_io_stdio(void);
40
- /* Discards all output, input is always EOF. Singleton. */
41
- TCCIO *tcc_io_null(void);
42
- /* Accumulates out and err in two separate memory buffers. */
43
- TCCIO *tcc_io_buffer(void);
44
- /* Accumulates out and err in one shared buffer, in write order. */
45
- TCCIO *tcc_io_buffer_merged(void);
46
- /* Writes to files it opens itself (closed by tcc_io_free).
47
- * err_path == NULL sends err to the same file as out. */
48
- TCCIO *tcc_io_file(const char *out_path, const char *err_path);
49
- /* Writes to borrowed file descriptors (never closed by tcc_io_free).
50
- * A descriptor of -1 leaves that channel on stdio. */
51
- TCCIO *tcc_io_fd(int out_fd, int err_fd, int in_fd);
52
- /* Writes to borrowed FILE* streams (never closed by tcc_io_free).
53
- * A NULL stream leaves that channel on stdio. */
54
- TCCIO *tcc_io_FILE(FILE *out, FILE *err, FILE *in);
55
- /* Fully custom callbacks. Any callback may be NULL (channel = stdio). */
56
- TCCIO *tcc_io_callback(int (*write_out)(void *, const char *, size_t),
57
- int (*write_err)(void *, const char *, size_t),
58
- int (*read_in)(void *, char *, size_t),
59
- void *ctx);
60
- /* Sends every channel to both a and b. Takes ownership of neither. */
61
- TCCIO *tcc_io_tee(TCCIO *a, TCCIO *b);
62
-
63
- void tcc_io_free(TCCIO *io);
64
-
65
- /* Buffer implementations only: channel 0 = out, 1 = err.
66
- * For the merged buffer both channels return the same data. */
67
- const char *tcc_io_buffer_data(TCCIO *io, int channel, size_t *len);
68
- void tcc_io_buffer_clear(TCCIO *io);
69
-
70
- /* ---- write helpers (used by the compiler's own output paths) ------- */
71
-
72
- /* Each helper takes the IO to write to - a state's IO as returned by
73
- * tcc_get_io (libtcc.h), or any TCCIO directly. A NULL IO, like a
74
- * state with nothing installed, resolves to the stdio singleton. */
75
- int tinyc_io_write_out(TCCIO *io, const char *buf, size_t len);
76
- int tinyc_io_write_err(TCCIO *io, const char *buf, size_t len);
77
- void tinyc_io_out_str(TCCIO *io, const char *s);
78
- void tinyc_io_err_str(TCCIO *io, const char *s);
79
- void tinyc_io_out_fmt(TCCIO *io, const char *fmt, ...);
80
- void tinyc_io_err_fmt(TCCIO *io, const char *fmt, ...);
81
- void tinyc_io_err_line(TCCIO *io, const char *s); /* writes s + "\n" to err */
82
- /* Flush io; on Windows also delivers any of io's -E stream output
83
- * still sitting in its temp file (see tinyc_io_open_out_stream). */
84
- void tinyc_io_flush(TCCIO *io);
85
-
86
- /* A FILE* whose writes forward to io's out channel, or NULL when io
87
- * resolves to the stdio default (callers then keep using stdout). */
88
- FILE *tinyc_io_open_out_stream(TCCIO *io);
89
-
90
- /* ---- -run stdio redirection ----------------------------------------- */
91
-
92
- /* Called by tcc_run around the run program's entry point, with the
93
- * running state's IO. When that IO is a non-stdio TCCIO, the
94
- * process's fd 0/1/2 are redirected through it for the duration of
95
- * the run: fd 0 is fed the bytes read_in returns (then EOF), and
96
- * what the program writes to fd 1/2 is delivered to write_out /
97
- * write_err, per channel, when the run ends. The host's fds are
98
- * restored by tinyc_run_redirect_end. With the stdio IO both
99
- * functions are no-ops and the run program uses the process's real
100
- * stdio. keep_stdin != 0 leaves fd 0 alone (tcc_run has already
101
- * reopened stdin from a file for the program). Nested calls are
102
- * counted: only the outermost pair redirects. */
103
- void tinyc_run_redirect_begin(TCCIO *io, int keep_stdin);
104
- void tinyc_run_redirect_end(void);
105
-
106
- /* ---- run-path diagnostic markers ------------------------------------ */
107
-
108
- /* Append one line to the platform diagnostic markers file
109
- * (tinyc_init.markers on Windows). The run path calls these at its
110
- * internal stage boundaries so that a crash inside tcc_run leaves
111
- * the last completed stage on record. Only the Windows image has
112
- * a markers file; everywhere else these are no-ops. */
113
- void tinyc_diag_mark(const char *line);
114
- void tinyc_diag_mark_ptr(const char *label, const void *p);
115
-
116
- /* ---- dual-form entry points ----------------------------------------- */
117
-
118
- /* The compiler's real main, exported from the dual-form file. */
119
- int tinyc_main(int argc, char **argv);
120
- /* tinyc_main with io installed on every state main creates during
121
- * the call (main builds a fresh state per pass). States created
122
- * through the tcc_* API are unaffected. */
123
- int tinyc_main_with_io(int argc, char **argv, TCCIO *io);
124
- /* tinyc_main_with_io, plus a flush of io once main has returned:
125
- * the form the packages' CLI capture calls bind. */
126
- int tinyc_main_io(int argc, char **argv, TCCIO *io);
127
-
128
- #ifdef __cplusplus
129
- }
130
- #endif
131
- #endif /* TINYC_IO_H */
1
+ /* tinyc_io.h - IO abstraction for the TinyC dual-form kernel.
2
+ *
3
+ * All compiler-owned input/output goes through a TCCIO object owned
4
+ * by a TCCState: tcc_set_io (libtcc.h) installs one on a state, and
5
+ * every compiler output path of that state - diagnostics, help,
6
+ * version, -E output, the -run stdio redirect - goes through it.
7
+ * There is no process-wide current IO. A state with no IO installed,
8
+ * and a NULL TCCIO everywhere in this API, mean the stdio
9
+ * implementation: output goes directly to the process's real
10
+ * stdout/stderr and input comes from the real stdin.
11
+ */
12
+ #ifndef TINYC_IO_H
13
+ #define TINYC_IO_H
14
+
15
+ #include <stddef.h>
16
+ #include <stdio.h>
17
+
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+ typedef struct TCCIO TCCIO;
23
+ struct TCCIO {
24
+ void *ctx;
25
+ /* Return the number of bytes consumed, or -1 on error. */
26
+ int (*write_out)(void *ctx, const char *buf, size_t len);
27
+ int (*write_err)(void *ctx, const char *buf, size_t len);
28
+ /* Return bytes read (0 = EOF), or -1 on error. */
29
+ int (*read_in)(void *ctx, char *buf, size_t cap);
30
+ void (*flush)(void *ctx);
31
+ /* Internal: release ctx. Set by constructors, used by tcc_io_free. */
32
+ void (*destroy_ctx)(void *ctx);
33
+ int is_singleton; /* stdio/null: tcc_io_free is a no-op */
34
+ };
35
+
36
+ /* ---- ready-made implementations ------------------------------------ */
37
+
38
+ /* The default: out -> stdout, err -> stderr, in <- stdin. Singleton. */
39
+ TCCIO *tcc_io_stdio(void);
40
+ /* Discards all output, input is always EOF. Singleton. */
41
+ TCCIO *tcc_io_null(void);
42
+ /* Accumulates out and err in two separate memory buffers. */
43
+ TCCIO *tcc_io_buffer(void);
44
+ /* Accumulates out and err in one shared buffer, in write order. */
45
+ TCCIO *tcc_io_buffer_merged(void);
46
+ /* Writes to files it opens itself (closed by tcc_io_free).
47
+ * err_path == NULL sends err to the same file as out. */
48
+ TCCIO *tcc_io_file(const char *out_path, const char *err_path);
49
+ /* Writes to borrowed file descriptors (never closed by tcc_io_free).
50
+ * A descriptor of -1 leaves that channel on stdio. */
51
+ TCCIO *tcc_io_fd(int out_fd, int err_fd, int in_fd);
52
+ /* Writes to borrowed FILE* streams (never closed by tcc_io_free).
53
+ * A NULL stream leaves that channel on stdio. */
54
+ TCCIO *tcc_io_FILE(FILE *out, FILE *err, FILE *in);
55
+ /* Fully custom callbacks. Any callback may be NULL (channel = stdio). */
56
+ TCCIO *tcc_io_callback(int (*write_out)(void *, const char *, size_t),
57
+ int (*write_err)(void *, const char *, size_t),
58
+ int (*read_in)(void *, char *, size_t),
59
+ void *ctx);
60
+ /* Sends every channel to both a and b. Takes ownership of neither. */
61
+ TCCIO *tcc_io_tee(TCCIO *a, TCCIO *b);
62
+
63
+ void tcc_io_free(TCCIO *io);
64
+
65
+ /* Buffer implementations only: channel 0 = out, 1 = err.
66
+ * For the merged buffer both channels return the same data. */
67
+ const char *tcc_io_buffer_data(TCCIO *io, int channel, size_t *len);
68
+ void tcc_io_buffer_clear(TCCIO *io);
69
+
70
+ /* ---- write helpers (used by the compiler's own output paths) ------- */
71
+
72
+ /* Each helper takes the IO to write to - a state's IO as returned by
73
+ * tcc_get_io (libtcc.h), or any TCCIO directly. A NULL IO, like a
74
+ * state with nothing installed, resolves to the stdio singleton. */
75
+ int tinyc_io_write_out(TCCIO *io, const char *buf, size_t len);
76
+ int tinyc_io_write_err(TCCIO *io, const char *buf, size_t len);
77
+ void tinyc_io_out_str(TCCIO *io, const char *s);
78
+ void tinyc_io_err_str(TCCIO *io, const char *s);
79
+ void tinyc_io_out_fmt(TCCIO *io, const char *fmt, ...);
80
+ void tinyc_io_err_fmt(TCCIO *io, const char *fmt, ...);
81
+ void tinyc_io_err_line(TCCIO *io, const char *s); /* writes s + "\n" to err */
82
+ /* Flush io; on Windows also delivers any of io's -E stream output
83
+ * still sitting in its temp file (see tinyc_io_open_out_stream). */
84
+ void tinyc_io_flush(TCCIO *io);
85
+
86
+ /* A FILE* whose writes forward to io's out channel, or NULL when io
87
+ * resolves to the stdio default (callers then keep using stdout). */
88
+ FILE *tinyc_io_open_out_stream(TCCIO *io);
89
+
90
+ /* ---- -run stdio redirection ----------------------------------------- */
91
+
92
+ /* Called by tcc_run around the run program's entry point, with the
93
+ * running state's IO. When that IO is a non-stdio TCCIO, the
94
+ * process's fd 0/1/2 are redirected through it for the duration of
95
+ * the run: fd 0 is fed the bytes read_in returns (then EOF), and
96
+ * what the program writes to fd 1/2 is delivered to write_out /
97
+ * write_err, per channel, when the run ends. The host's fds are
98
+ * restored by tinyc_run_redirect_end. With the stdio IO both
99
+ * functions are no-ops and the run program uses the process's real
100
+ * stdio. keep_stdin != 0 leaves fd 0 alone (tcc_run has already
101
+ * reopened stdin from a file for the program). Nested calls are
102
+ * counted: only the outermost pair redirects. */
103
+ void tinyc_run_redirect_begin(TCCIO *io, int keep_stdin);
104
+ void tinyc_run_redirect_end(void);
105
+
106
+ /* ---- run-path diagnostic markers ------------------------------------ */
107
+
108
+ /* Append one line to the platform diagnostic markers file
109
+ * (tinyc_init.markers on Windows). The run path calls these at its
110
+ * internal stage boundaries so that a crash inside tcc_run leaves
111
+ * the last completed stage on record. Only the Windows image has
112
+ * a markers file; everywhere else these are no-ops. */
113
+ void tinyc_diag_mark(const char *line);
114
+ void tinyc_diag_mark_ptr(const char *label, const void *p);
115
+
116
+ /* ---- dual-form entry points ----------------------------------------- */
117
+
118
+ /* The compiler's real main, exported from the dual-form file. */
119
+ int tinyc_main(int argc, char **argv);
120
+ /* tinyc_main with io installed on every state main creates during
121
+ * the call (main builds a fresh state per pass). States created
122
+ * through the tcc_* API are unaffected. */
123
+ int tinyc_main_with_io(int argc, char **argv, TCCIO *io);
124
+ /* tinyc_main_with_io, plus a flush of io once main has returned:
125
+ * the form the packages' CLI capture calls bind. */
126
+ int tinyc_main_io(int argc, char **argv, TCCIO *io);
127
+
128
+ #ifdef __cplusplus
129
+ }
130
+ #endif
131
+ #endif /* TINYC_IO_H */
@@ -1,171 +1,171 @@
1
- /*
2
- * _mingw.h
3
- *
4
- * This file is for TinyCC and not part of the Mingw32 package.
5
- *
6
- * THIS SOFTWARE IS NOT COPYRIGHTED
7
- *
8
- * This source code is offered for use in the public domain. You may
9
- * use, modify or distribute it freely.
10
- *
11
- * This code is distributed in the hope that it will be useful but
12
- * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
13
- * DISCLAIMED. This includes but is not limited to warranties of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
- *
16
- */
17
-
18
- #ifndef __MINGW_H
19
- #define __MINGW_H
20
-
21
- /* some winapi files define these before including _mingw.h --> */
22
- #undef __cdecl
23
- #undef _X86_
24
- #undef WIN32
25
- /* <-- */
26
-
27
- #include <stddef.h>
28
- #include <stdarg.h>
29
-
30
- #define __int8 char
31
- #define __int16 short
32
- #define __int32 int
33
- #define __int64 long long
34
- #define _HAVE_INT64
35
-
36
- #define __cdecl
37
- #define __declspec(x) __attribute__((x))
38
- #define __unaligned __attribute__((packed))
39
- #define __fastcall __attribute__((fastcall))
40
-
41
- #define __MSVCRT__ 1
42
- #undef _MSVCRT_
43
- #define __MINGW_IMPORT extern __declspec(dllimport)
44
- #define __MINGW_ATTRIB_NORETURN __declspec(noreturn)
45
- #define __MINGW_ATTRIB_CONST
46
- #define __MINGW_ATTRIB_DEPRECATED
47
- #define __MINGW_ATTRIB_MALLOC
48
- #define __MINGW_ATTRIB_PURE
49
- #define __MINGW_ATTRIB_NONNULL(arg)
50
- #define __MINGW_NOTHROW
51
- #define __GNUC_VA_LIST
52
-
53
- #define _CRTIMP extern
54
- #define __CRT_INLINE static __inline__
55
-
56
- #define _CRT_ALIGN(x) __attribute__((aligned(x)))
57
- #define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
58
- #define _CRT_PACKING 8
59
- #define __CRT_UNALIGNED
60
- #define _CONST_RETURN
61
-
62
- #ifndef _TRUNCATE
63
- #define _TRUNCATE ((size_t)-1)
64
- #endif
65
-
66
- #define __CRT_STRINGIZE(_Value) #_Value
67
- #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
68
- #define __CRT_WIDE(_String) L ## _String
69
- #define _CRT_WIDE(_String) __CRT_WIDE(_String)
70
-
71
- #ifdef _WIN64
72
- #define __stdcall
73
- #if defined(__aarch64__)
74
- #define _M_ARM64 1
75
- #define _ARM64_ 1
76
- #else
77
- #define _AMD64_ 1
78
- #define __x86_64 1
79
- #define _M_X64 100 /* Visual Studio */
80
- #define _M_AMD64 100 /* Visual Studio */
81
- #endif
82
- #else
83
- #define __stdcall __attribute__((__stdcall__))
84
- #define _X86_ 1
85
- #define _M_IX86 300 /* Visual Studio */
86
- #ifndef __MINGW_USE_VC2005_COMPAT /* time became 64, but not timeval.tv_sec */
87
- # ifndef _USE_32BIT_TIME_T
88
- # define _USE_32BIT_TIME_T
89
- # endif
90
- #endif
91
- #endif
92
-
93
- /* in stddef.h */
94
- #define _SIZE_T_DEFINED
95
- #define _SSIZE_T_DEFINED
96
- #define _PTRDIFF_T_DEFINED
97
- #define _WCHAR_T_DEFINED
98
- #define _UINTPTR_T_DEFINED
99
- #define _INTPTR_T_DEFINED
100
- #define _INTEGRAL_MAX_BITS 64
101
-
102
- #ifndef _TIME32_T_DEFINED
103
- #define _TIME32_T_DEFINED
104
- typedef long __time32_t;
105
- #endif
106
-
107
- #ifndef _TIME64_T_DEFINED
108
- #define _TIME64_T_DEFINED
109
- typedef long long __time64_t;
110
- #endif
111
-
112
- #ifndef _TIME_T_DEFINED
113
- #define _TIME_T_DEFINED
114
- #ifdef _USE_32BIT_TIME_T
115
- typedef __time32_t time_t;
116
- #else
117
- typedef __time64_t time_t;
118
- #endif
119
- #endif
120
-
121
- #ifndef _WCTYPE_T_DEFINED
122
- #define _WCTYPE_T_DEFINED
123
- typedef wchar_t wctype_t;
124
- #endif
125
-
126
- #ifndef _WINT_T
127
- #define _WINT_T
128
- typedef __WINT_TYPE__ wint_t;
129
- #endif
130
-
131
- typedef int errno_t;
132
- #define _ERRCODE_DEFINED
133
-
134
- typedef struct threadlocaleinfostruct *pthreadlocinfo;
135
- typedef struct threadmbcinfostruct *pthreadmbcinfo;
136
- typedef struct localeinfo_struct _locale_tstruct,*_locale_t;
137
-
138
- /* for winapi */
139
- #define _ANONYMOUS_UNION
140
- #define _ANONYMOUS_STRUCT
141
- #define DECLSPEC_NORETURN __declspec(noreturn)
142
- #define DECLARE_STDCALL_P(type) __stdcall type
143
- #define NOSERVICE 1
144
- #define NOMCX 1
145
- #define NOIME 1
146
- #define __INTRIN_H_
147
- #ifndef DUMMYUNIONNAME
148
- # define DUMMYUNIONNAME
149
- # define DUMMYUNIONNAME1
150
- # define DUMMYUNIONNAME2
151
- # define DUMMYUNIONNAME3
152
- # define DUMMYUNIONNAME4
153
- # define DUMMYUNIONNAME5
154
- #endif
155
- #ifndef DUMMYSTRUCTNAME
156
- # define DUMMYSTRUCTNAME
157
- #endif
158
- #ifndef WINVER
159
- # define WINVER 0x0502
160
- #endif
161
- #ifndef _WIN32_WINNT
162
- # define _WIN32_WINNT 0x502
163
- #endif
164
-
165
- #define __C89_NAMELESS
166
- #define __MINGW_EXTENSION
167
- #define WINAPI_FAMILY_PARTITION(X) 1
168
- #define MINGW_HAS_SECURE_API
169
- #define WIN32 1
170
-
171
- #endif /* __MINGW_H */
1
+ /*
2
+ * _mingw.h
3
+ *
4
+ * This file is for TinyCC and not part of the Mingw32 package.
5
+ *
6
+ * THIS SOFTWARE IS NOT COPYRIGHTED
7
+ *
8
+ * This source code is offered for use in the public domain. You may
9
+ * use, modify or distribute it freely.
10
+ *
11
+ * This code is distributed in the hope that it will be useful but
12
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
13
+ * DISCLAIMED. This includes but is not limited to warranties of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
+ *
16
+ */
17
+
18
+ #ifndef __MINGW_H
19
+ #define __MINGW_H
20
+
21
+ /* some winapi files define these before including _mingw.h --> */
22
+ #undef __cdecl
23
+ #undef _X86_
24
+ #undef WIN32
25
+ /* <-- */
26
+
27
+ #include <stddef.h>
28
+ #include <stdarg.h>
29
+
30
+ #define __int8 char
31
+ #define __int16 short
32
+ #define __int32 int
33
+ #define __int64 long long
34
+ #define _HAVE_INT64
35
+
36
+ #define __cdecl
37
+ #define __declspec(x) __attribute__((x))
38
+ #define __unaligned __attribute__((packed))
39
+ #define __fastcall __attribute__((fastcall))
40
+
41
+ #define __MSVCRT__ 1
42
+ #undef _MSVCRT_
43
+ #define __MINGW_IMPORT extern __declspec(dllimport)
44
+ #define __MINGW_ATTRIB_NORETURN __declspec(noreturn)
45
+ #define __MINGW_ATTRIB_CONST
46
+ #define __MINGW_ATTRIB_DEPRECATED
47
+ #define __MINGW_ATTRIB_MALLOC
48
+ #define __MINGW_ATTRIB_PURE
49
+ #define __MINGW_ATTRIB_NONNULL(arg)
50
+ #define __MINGW_NOTHROW
51
+ #define __GNUC_VA_LIST
52
+
53
+ #define _CRTIMP extern
54
+ #define __CRT_INLINE static __inline__
55
+
56
+ #define _CRT_ALIGN(x) __attribute__((aligned(x)))
57
+ #define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
58
+ #define _CRT_PACKING 8
59
+ #define __CRT_UNALIGNED
60
+ #define _CONST_RETURN
61
+
62
+ #ifndef _TRUNCATE
63
+ #define _TRUNCATE ((size_t)-1)
64
+ #endif
65
+
66
+ #define __CRT_STRINGIZE(_Value) #_Value
67
+ #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
68
+ #define __CRT_WIDE(_String) L ## _String
69
+ #define _CRT_WIDE(_String) __CRT_WIDE(_String)
70
+
71
+ #ifdef _WIN64
72
+ #define __stdcall
73
+ #if defined(__aarch64__)
74
+ #define _M_ARM64 1
75
+ #define _ARM64_ 1
76
+ #else
77
+ #define _AMD64_ 1
78
+ #define __x86_64 1
79
+ #define _M_X64 100 /* Visual Studio */
80
+ #define _M_AMD64 100 /* Visual Studio */
81
+ #endif
82
+ #else
83
+ #define __stdcall __attribute__((__stdcall__))
84
+ #define _X86_ 1
85
+ #define _M_IX86 300 /* Visual Studio */
86
+ #ifndef __MINGW_USE_VC2005_COMPAT /* time became 64, but not timeval.tv_sec */
87
+ # ifndef _USE_32BIT_TIME_T
88
+ # define _USE_32BIT_TIME_T
89
+ # endif
90
+ #endif
91
+ #endif
92
+
93
+ /* in stddef.h */
94
+ #define _SIZE_T_DEFINED
95
+ #define _SSIZE_T_DEFINED
96
+ #define _PTRDIFF_T_DEFINED
97
+ #define _WCHAR_T_DEFINED
98
+ #define _UINTPTR_T_DEFINED
99
+ #define _INTPTR_T_DEFINED
100
+ #define _INTEGRAL_MAX_BITS 64
101
+
102
+ #ifndef _TIME32_T_DEFINED
103
+ #define _TIME32_T_DEFINED
104
+ typedef long __time32_t;
105
+ #endif
106
+
107
+ #ifndef _TIME64_T_DEFINED
108
+ #define _TIME64_T_DEFINED
109
+ typedef long long __time64_t;
110
+ #endif
111
+
112
+ #ifndef _TIME_T_DEFINED
113
+ #define _TIME_T_DEFINED
114
+ #ifdef _USE_32BIT_TIME_T
115
+ typedef __time32_t time_t;
116
+ #else
117
+ typedef __time64_t time_t;
118
+ #endif
119
+ #endif
120
+
121
+ #ifndef _WCTYPE_T_DEFINED
122
+ #define _WCTYPE_T_DEFINED
123
+ typedef wchar_t wctype_t;
124
+ #endif
125
+
126
+ #ifndef _WINT_T
127
+ #define _WINT_T
128
+ typedef __WINT_TYPE__ wint_t;
129
+ #endif
130
+
131
+ typedef int errno_t;
132
+ #define _ERRCODE_DEFINED
133
+
134
+ typedef struct threadlocaleinfostruct *pthreadlocinfo;
135
+ typedef struct threadmbcinfostruct *pthreadmbcinfo;
136
+ typedef struct localeinfo_struct _locale_tstruct,*_locale_t;
137
+
138
+ /* for winapi */
139
+ #define _ANONYMOUS_UNION
140
+ #define _ANONYMOUS_STRUCT
141
+ #define DECLSPEC_NORETURN __declspec(noreturn)
142
+ #define DECLARE_STDCALL_P(type) __stdcall type
143
+ #define NOSERVICE 1
144
+ #define NOMCX 1
145
+ #define NOIME 1
146
+ #define __INTRIN_H_
147
+ #ifndef DUMMYUNIONNAME
148
+ # define DUMMYUNIONNAME
149
+ # define DUMMYUNIONNAME1
150
+ # define DUMMYUNIONNAME2
151
+ # define DUMMYUNIONNAME3
152
+ # define DUMMYUNIONNAME4
153
+ # define DUMMYUNIONNAME5
154
+ #endif
155
+ #ifndef DUMMYSTRUCTNAME
156
+ # define DUMMYSTRUCTNAME
157
+ #endif
158
+ #ifndef WINVER
159
+ # define WINVER 0x0502
160
+ #endif
161
+ #ifndef _WIN32_WINNT
162
+ # define _WIN32_WINNT 0x502
163
+ #endif
164
+
165
+ #define __C89_NAMELESS
166
+ #define __MINGW_EXTENSION
167
+ #define WINAPI_FAMILY_PARTITION(X) 1
168
+ #define MINGW_HAS_SECURE_API
169
+ #define WIN32 1
170
+
171
+ #endif /* __MINGW_H */