Skip to content

Commit

Permalink
Fix bugzilla 24509: importC cannot handle _stdcall Function Calling … (
Browse files Browse the repository at this point in the history
…#16392)

* Fix bugzilla 24509: importC cannot handle _stdcall Function Calling Convention with single heading underscore
  • Loading branch information
aferust authored Apr 21, 2024
1 parent 978a26d commit d61f72c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/test/compilable/test22727.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ __stdcall int foostdcall(int a) { return a; }

int __stdcall foostdcall2(int a) { return a; }

#if _MSC_VER
int _stdcall foostdcall3(int a) { return a; } // test issue 24509
#endif

int __stdcall (*fp1)(int a) = &foostdcall;

int (__stdcall *fp2)(int a) = &foostdcall2;
1 change: 1 addition & 0 deletions druntime/src/importc.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ typedef unsigned long long __uint64_t;
#define __ptr64
#define __unaligned
#define _NO_CRT_STDIO_INLINE 1
#define _stdcall __stdcall

// This header disables the Windows API Annotations macros
// Need to include sal.h to get the pragma once to prevent macro redefinition.
Expand Down

0 comments on commit d61f72c

Please sign in to comment.