Skip to content

Commit 4ebbf65

Browse files
committed
fasthttp: make public on linux/windows
1 parent c5efd0f commit 4ebbf65

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

vlib/fasthttp/fasthttp_linux.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ mut:
3737
data C.epoll_data_t
3838
}
3939

40-
struct Server {
40+
pub struct Server {
4141
pub:
4242
family net.AddrFamily = .ip6
4343
port int = 3000

vlib/fasthttp/fasthttp_windows.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module fasthttp
22

3-
struct Server {
3+
pub struct Server {
44
pub:
55
port int = 3000
66
max_request_buffer_size int = 8192

vlib/v/gen/c/cheaders.v

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,11 @@ typedef __builtin_va_list va_list;
480480
#ifdef __cplusplus
481481
extern "C" {
482482
#endif
483-
// mingw-w64 stdio.h declares these as static __mingw_ovr inline overrides.
484-
// Skip them under mingw to avoid static-after-extern conflicts when
485-
// thirdparty headers later include stdio.h.
486-
#if !defined(__MINGW32__) && !defined(__MINGW64__)
483+
// mingw-w64 stdio.h declares these as static __mingw_ovr inline overrides
484+
// when __USE_MINGW_ANSI_STDIO is on. Skip them under gcc+mingw to avoid
485+
// static-after-extern conflicts; clang+mingw needs them because it builds
486+
// with -Werror=implicit-function-declaration and does not hit the conflict.
487+
#if !((defined(__MINGW32__) || defined(__MINGW64__)) && !defined(__clang__))
487488
V_CRT_LINKAGE int V_CRT_CALL vfprintf(FILE *stream, const char *format, va_list ap);
488489
V_CRT_LINKAGE int V_CRT_CALL vsnprintf(char *str, size_t size, const char *format, va_list ap);
489490
V_CRT_LINKAGE int V_CRT_CALL fprintf(FILE *stream, const char *format, ...);

vlib/v/gen/c/cheaders_manual_stdlib_decls_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fn test_msvc_windows_prelude_uses_msvc_crt_headers() {
7373
assert generated_c.contains('#ifndef va_copy\n\t#define va_copy(dest, src) ((dest) = (src))\n#endif\n#ifndef _TRUNCATE'), generated_c
7474
assert generated_c.contains('#if defined(_MSC_VER) && !defined(__clang__)\n\t#define V_CRT_LINKAGE __declspec(dllimport)\n\t#define V_CRT_CALL VCALLCONV(cdecl)\n#else\n\t#define V_CRT_LINKAGE\n\t#define V_CRT_CALL\n#endif'), generated_c
7575
assert generated_c.contains('#if !defined(_MSC_VER) || defined(__clang__)\n#ifdef __cplusplus\nextern "C" {\n#endif\n'), generated_c
76-
assert generated_c.contains('#if !defined(__MINGW32__) && !defined(__MINGW64__)\nV_CRT_LINKAGE int V_CRT_CALL vfprintf(FILE *stream, const char *format, va_list ap);'), generated_c
76+
assert generated_c.contains('#if !((defined(__MINGW32__) || defined(__MINGW64__)) && !defined(__clang__))\nV_CRT_LINKAGE int V_CRT_CALL vfprintf(FILE *stream, const char *format, va_list ap);'), generated_c
7777
assert generated_c.contains('V_CRT_LINKAGE int V_CRT_CALL _vscprintf(const char *format, va_list ap);'), generated_c
7878
assert generated_c.contains('V_CRT_LINKAGE int V_CRT_CALL _vsnprintf_s(char *buffer, size_t size, size_t count, const char *format, va_list ap);'), generated_c
7979
assert generated_c.contains('#include <windows.h>'), generated_c

0 commit comments

Comments
 (0)