windows.cfg: Add support for `__alignof()` (#2271)

Reference:
https://docs.microsoft.com/en-us/cpp/cpp/alignof-operator?view=vs-2019
This commit is contained in:
Sebastian 2019-10-15 16:02:28 +02:00 committed by GitHub
parent 4a4b4963cc
commit e3fe559f0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -6338,6 +6338,15 @@ HFONT CreateFont(
<not-bool/>
</arg>
</function>
<!-- __alignof Operator, declaration could look like this: size_t __alignof(type); -->
<!-- _alignof is a synonym -->
<function name="__alignof,_alignof">
<noreturn>false</noreturn>
<returnValue type="size_t"/>
<use-retval/>
<leak-ignore/>
<arg nr="1" direction="in"/>
</function>
<podtype name="POINTER_SIGNED" sign="s"/>
<podtype name="POINTER_UNSIGNED" sign="u"/>
<podtype name="__time32_t" sign="s" size="4"/>

View File

@ -192,6 +192,9 @@ void validCode()
::PostMessage(nullptr, WM_QUIT, 0, 0);
printf("%zu", __alignof(int));
printf("%zu", _alignof(double));
// Valid Library usage, no leaks, valid arguments
HINSTANCE hInstLib = LoadLibrary(L"My.dll");
FreeLibrary(hInstLib);