From 0a9633dc1da7e728535854e4b7131d56334e9955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20B=C3=A9ron?= Date: Mon, 21 Mar 2005 10:52:53 +0000 Subject: [PATCH] Teach winapi_check about other calling convention shorthands (they all are really stdcall). --- tools/winapi_check/winapi_function.pm | 4 ++-- tools/winapi_check/winapi_local.pm | 4 ++-- tools/winapi_check/winapi_parser.pm | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/winapi_check/winapi_function.pm b/tools/winapi_check/winapi_function.pm index 688651a25d1..b9e6f68f26f 100644 --- a/tools/winapi_check/winapi_function.pm +++ b/tools/winapi_check/winapi_function.pm @@ -309,7 +309,7 @@ sub calling_convention16($) { } elsif(/^(?:VFWAPIV|WINAPIV)$/) { if(!defined($suffix)) { return undef; } return "pascal$suffix"; # FIXME: Is this correct? - } elsif(/^(?:__stdcall|VFWAPI|WINAPI|CALLBACK)$/) { + } elsif(/^(?:__stdcall|NET_API_FUNCTION|RPC_ENTRY|VFWAPI|WINAPI|CALLBACK)$/) { if(!defined($suffix)) { return undef; } return "pascal$suffix"; } elsif($_ eq "__asm") { @@ -327,7 +327,7 @@ sub calling_convention32($) { return "cdecl"; } elsif(/^(?:VFWAPIV|WINAPIV)$/) { return "varargs"; - } elsif(/^(?:__stdcall|VFWAPI|WINAPI|CALLBACK)$/) { + } elsif(/^(?:__stdcall|NET_API_FUNCTION|RPC_ENTRY|VFWAPI|WINAPI|CALLBACK)$/) { return "stdcall"; } elsif($_ eq "__asm") { return "asm"; diff --git a/tools/winapi_check/winapi_local.pm b/tools/winapi_check/winapi_local.pm index fb9a3309fb3..d3432e21500 100644 --- a/tools/winapi_check/winapi_local.pm +++ b/tools/winapi_check/winapi_local.pm @@ -85,7 +85,7 @@ sub _check_function($$$$$$) { $implemented_calling_convention = "cdecl"; } elsif($calling_convention =~ /^(?:VFWAPIV|WINAPIV)$/) { $implemented_calling_convention = "varargs"; - } elsif($calling_convention =~ /^(?:__stdcall|VFWAPI|WINAPI|CALLBACK)$/) { + } elsif($calling_convention =~ /^(?:__stdcall|NET_API_FUNCTION|RPC_ENTRY|VFWAPI|WINAPI|CALLBACK)$/) { if(defined($implemented_return_kind) && $implemented_return_kind =~ /^(?:s_word|word|void)$/) { $implemented_calling_convention = "pascal16"; } else { @@ -101,7 +101,7 @@ sub _check_function($$$$$$) { $implemented_calling_convention = "cdecl"; } elsif($calling_convention =~ /^(?:VFWAPIV|WINAPIV)$/) { $implemented_calling_convention = "varargs"; - } elsif($calling_convention =~ /^(?:__stdcall|VFWAPI|WINAPI|CALLBACK)$/) { + } elsif($calling_convention =~ /^(?:__stdcall|NET_API_FUNCTION|RPC_ENTRY|VFWAPI|WINAPI|CALLBACK)$/) { if(defined($implemented_return_kind) && $implemented_return_kind eq "longlong") { $implemented_calling_convention = "stdcall"; # FIXME: Check entry flags } else { diff --git a/tools/winapi_check/winapi_parser.pm b/tools/winapi_check/winapi_parser.pm index 15ed3641b31..731ab881fdd 100644 --- a/tools/winapi_check/winapi_parser.pm +++ b/tools/winapi_check/winapi_parser.pm @@ -370,7 +370,7 @@ sub parse_c_file($$) { } next; } elsif(/(extern\s+|static\s+)?((struct\s+|union\s+|enum\s+|signed\s+|unsigned\s+)?\w+((\s*\*)+\s*|\s+)) - ((__cdecl|__stdcall|CDECL|VFWAPIV|VFWAPI|WINAPIV|WINAPI|CALLBACK)\s+)? + ((__cdecl|__stdcall|CDECL|NET_API_FUNCTION|RPC_ENTRY|VFWAPIV|VFWAPI|WINAPIV|WINAPI|CALLBACK)\s+)? (\w+(\(\w+\))?)\s*\((.*?)\)\s*(\{|\;)/sx) { my @lines = split(/\n/, $&); @@ -443,8 +443,8 @@ sub parse_c_file($$) { ((?:struct\s+|union\s+|enum\s+|register\s+|(?:signed\s+|unsigned\s+) (?:short\s+(?=int)|long\s+(?=int))?)?\w+)\s* ((?:const)?\s*(?:\*\s*(?:const)?\s*?)*)\s* - (?:__cdecl\s+|__stdcall\s+|CALLBACK\s+|WINAPI\s+)? - \(\s*(?:__cdecl|__stdcall|CALLBACK|WINAPI)?\s*\*\s*((?:\w+)?)\s*\)\s* + (?:__cdecl\s+|__stdcall\s+|CALLBACK\s+|CDECL\s+|NET_API_FUNCTION\s+|RPC_ENTRY\s+|VFWAPIV\s+|VFWAPI\s+|WINAPIV\s+|WINAPI\s+)? + \(\s*(?:__cdecl|__stdcall|CALLBACK|CDECL|NET_API_FUNCTION|RPC_ENTRY|VFWAPIV|VFWAPI|WINAPIV|WINAPI)?\s*\*\s*((?:\w+)?)\s*\)\s* \(\s*(.*?)\s*\)$/x) { my $return_type = $1;