This is just false
__attribute__((__gnu_inline__))
Is equal to inline in C++.
It won’t cause ODR issues.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

________________________________
From: LIU Hao <lh_mo...@126.com>
Sent: Wednesday, January 5, 2022 2:02:55 AM
To: mingw-w64-public@lists.sourceforge.net 
<mingw-w64-public@lists.sourceforge.net>; Luca Bacci <luca.bacci...@gmail.com>
Subject: Re: [Mingw-w64-public] Informations about the use of mingw-w64 GCC 
with the Windows SDK headers

在 12/7/21 10:07 PM, Luca Bacci 写道:
> In addition to that, have you ever considered using
> https://github.com/microsoft/win32metadata to generate mingw win32api
> headers?
>
> Luca
>

I haven't had a look at it so far. Some random search results on web suggest 
that its main objective
is to ease integration of new APIs into C# or Rust; note this doesn't include 
C. But I do consider
it a great improvement, if someone can figure out how to generate 
mingw-w64-compatible headers with it.


> Il giorno lun 29 nov 2021 alle ore 13:59 Luca Bacci <luca.bacci...@gmail.com>
> ha scritto:
>
>> Hello,
>>
>> I'd like to know if anyone has ever attempted to use the Windows SDK
>> headers with mingw-w64 GCC instead of the re-engineered win32api headers,
>> how many incompatibilities are there and if those incompatibilities are
>> surmountable.
>>
>> It would be great to have support for the Windows SDK headers!
>>
>>

It would hardly be possible to use MS headers verbatim:

1) The `long` type is defined as 4 bytes in MS headers (note this also applies
    to literals such as `42L`), but in mingw-w64 headers it's variable. We have
    `__MSABI_LONG` which, when building native applications expands to a `long`,
    but for Cygwin or MSYS2 where `long` is 8 bytes expands to an `int`.

2) GCC does not allow nameless `struct` or `union` members to contain another
    `struct`. They have to be moved outside.

3) MSVC `__inline` in C behaves like `inline` in C++, while there is no exact
    equivalent in GCC. Failure to inline such functions (such as compiling with
    `-O0`) would cause undefined references. The closest and safest thing (to
    allow such code to build) is `static __inline` I think.

4) `BOOL` is an alias for `bool` in Objective-C so we have to take `WINBOOL`
    for `BOOL` in MS headers.


This list is not exhaustive. It is no simple matter.



--
Best regards,
LIU Hao


_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to