fix(win): remove duplicated constructor block from the earlier patch
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-12 11:06:58
Commit7957f1ea
Parents1b79a003
Changed files
src/plugin_sqlite.c+0−12■■■■■
1 file+0−12
Diff
src/plugin_sqlite.c+0−12■■■■■
index bae1882..bc1ecf1 100644
--- a/src/plugin_sqlite.c
+++ b/src/plugin_sqlite.c
@@ -61,18 +61,6 @@ static void sx_plugin_binary_stdio(void) {
6161 _setmode(_fileno(stdout), _O_BINARY);
6262 _setmode(_fileno(stdin), _O_BINARY);
6363 }
64-# include <fcntl.h>
65-/* MinGW/MSVC CRT starts stdout in TEXT mode, which rewrites every \n we emit
66- * into \r\n. A CGI header block must end with exactly CRLF CRLF; text mode
67- * turns "\r\n\r\n" into "\r\r\n\r\r\n", scorpiox-server cannot find the
68- * header/body separator, and the whole reply (headers included) is served as a
69- * body with Content-Type: text/html. Force binary stdio before main() runs —
70- * the same constructor scorpiox-bot-api handlers use (sx_shell.h). */
71-__attribute__((constructor))
72-static void sx_plugin_binary_stdio(void) {
73- _setmode(_fileno(stdout), _O_BINARY);
74- _setmode(_fileno(stdin), _O_BINARY);
75-}
7664 # include <sys/stat.h>
7765 # define SX_STAT struct _stat64
7866 # define sx_stat(p,s) _stat64((p),(s))
7967
src/plugin_sqlite.c+0−12■■■■■
index bae1882..bc1ecf1 100644index bae1882..bc1ecf1 100644
--- a/src/plugin_sqlite.c--- a/src/plugin_sqlite.c
+++ b/src/plugin_sqlite.c+++ b/src/plugin_sqlite.c
@@ -61,18 +61,6 @@ static void sx_plugin_binary_stdio(void) {@@ -61,18 +61,6 @@ static void sx_plugin_binary_stdio(void) {
61 _setmode(_fileno(stdout), _O_BINARY);61 _setmode(_fileno(stdout), _O_BINARY);
62 _setmode(_fileno(stdin), _O_BINARY);62 _setmode(_fileno(stdin), _O_BINARY);
63 }63 }
64-# include <fcntl.h>
65-/* MinGW/MSVC CRT starts stdout in TEXT mode, which rewrites every \n we emit
66- * into \r\n. A CGI header block must end with exactly CRLF CRLF; text mode
67- * turns "\r\n\r\n" into "\r\r\n\r\r\n", scorpiox-server cannot find the
68- * header/body separator, and the whole reply (headers included) is served as a
69- * body with Content-Type: text/html. Force binary stdio before main() runs —
70- * the same constructor scorpiox-bot-api handlers use (sx_shell.h). */
71-__attribute__((constructor))
72-static void sx_plugin_binary_stdio(void) {
73- _setmode(_fileno(stdout), _O_BINARY);
74- _setmode(_fileno(stdin), _O_BINARY);
75-}
76 # include <sys/stat.h>64 # include <sys/stat.h>
77 # define SX_STAT struct _stat6465 # define SX_STAT struct _stat64
78 # define sx_stat(p,s) _stat64((p),(s))66 # define sx_stat(p,s) _stat64((p),(s))
7967