May 24, 2023
https://issues.dlang.org/show_bug.cgi?id=23935

          Issue ID: 23935
           Summary: ImportC for libuv
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: black80@bk.ru

Created attachment 1875
  --> https://issues.dlang.org/attachment.cgi?id=1875&action=edit
proceeded uv9.i

1) I compiled uv.dll with vcpkg

2) I preprocessed "uv.h" (all libuv stuff) with command MSVC:
cl.exe -P -Fiuv.i -DUSING_UV_SHARED -DWIN32_LEAN_AND_MEAN uv.h
and got uv.i

3) I removed empty/#pragma/#line lines from the last one with commands:
@findstr /v /r /c:"^[ \x09]*$" /c:"^$" uv.i >uv2.i
@findstr /v /r /c:"^.*#line" uv2.i >uv3.i
@findstr /v /r /c:"^.*#pragma warning" /c:"^.*#pragma once" /c:"^.*#pragma
region" /c:"^.*#pragma endregion" uv3.i >uv9.i
and got uv9.i ~1MB (in attachments)

4) dmd/ldc2 -c uv9.i gives to me many issues:
uv9.i(2): Error: missing comma or semicolon after declaration of `__anonymous`,
found `uintptr_t` instead
                                                                    ══uv9.i(4):
Error: identifier or `(` expected

                                                           Euv9.i(7): Error:
missing comma or semicolon after declaration of `__anonymous`, found `size_t`
instead
                                                     rruv9.i(12): Error:
identifier or `(` expected

first 12LOC of uv9.i:
#pragma pack(push, 8)
        typedef unsigned __int64  uintptr_t;
        typedef char* va_list;
    void __cdecl __va_start(va_list* , ...);
#pragma pack(pop)
__pragma(pack(push, 8))
    typedef unsigned __int64 size_t;
    typedef __int64          ptrdiff_t;
    typedef __int64          intptr_t;
    typedef _Bool __vcrt_bool;
    typedef unsigned short wchar_t;

--