From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Cygwin: remove most occurrences of __stdcall, WINAPI, and, __cdecl
Date: Wed, 8 Jun 2022 01:49:16 +0900 [thread overview]
Message-ID: <20220608014916.df0275787115d55138757a3c@nifty.ne.jp> (raw)
In-Reply-To: <b5f56fb5-48eb-8596-5855-35a35dcb8a55@cornell.edu>
On Mon, 6 Jun 2022 12:24:15 -0400
Ken Brown wrote:
> On 6/5/2022 4:24 PM, Jon Turney wrote:
> > On 03/06/2022 15:00, Ken Brown wrote:
> >> remove most occurrences of __stdcall, WINAPI, and __cdecl
> >>
> >> These have no effect on x86_64. Retain only a few occurrences of
> >> __cdecl in files imported from other sources.
> >
> > While you are correct that it has no effect on x86_64, I'd incline towards
> > retaining WINAPI on Windows API functions, because it's part of the function
> > signature. But other people might have other opinions on that...
>
> I ended up retaining all occurrences of WINAPI. Those that don't directly occur
> in Windows API functions are mostly used for thread functions passed to
> CreateThread, and the latter expects a WINAPI function.
_dll_crt0() is declared as
extern void __stdcall _dll_crt0 ()
__declspec (dllimport) __attribute__ ((noreturn));
in winsup/cygwin/lib/cygwin_crt0.c, however, this patch
removes __stdcall from winsup.h and dcrt0.cc as follows.
diff --git b/winsup/cygwin/dcrt0.cc a/winsup/cygwin/dcrt0.cc
index 0d6c1c3b9..71215ace6 100644
--- b/winsup/cygwin/dcrt0.cc
+++ a/winsup/cygwin/dcrt0.cc
@@ -1013,7 +1013,7 @@ __cygwin_exit_return: \n\
");
}
-extern "C" void __stdcall
+extern "C" void
_dll_crt0 ()
{
#ifdef __x86_64__
diff --git b/winsup/cygwin/winsup.h a/winsup/cygwin/winsup.h
index 9d204434b..8774f3bec 100644
--- b/winsup/cygwin/winsup.h
+++ a/winsup/cygwin/winsup.h
@@ -147,7 +147,7 @@ extern int cygserver_running;
class per_process;
/* cygwin .dll initialization */
void dll_crt0 (per_process *) __asm__ (_SYMSTR (dll_crt0__FP11per_process));
-extern "C" void __stdcall _dll_crt0 ();
+extern "C" void _dll_crt0 ();
void dll_crt0_1 (void *);
void dll_dllcrt0_1 (void *);
To be consistent these, shouldn't _dll_crt0() retain __stdcall?
Changing cygwin_crt0.c is a bit weird because it looks as if
it might affect binary compatibility, even if it really doesn't.
--
Takashi Yano <takashi.yano@nifty.ne.jp>
next prev parent reply other threads:[~2022-06-07 16:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-03 14:00 Ken Brown
2022-06-05 20:24 ` Jon Turney
2022-06-05 22:23 ` Ken Brown
2022-06-06 0:02 ` Takashi Yano
2022-06-06 16:24 ` Ken Brown
2022-06-06 23:21 ` Takashi Yano
2022-06-07 16:49 ` Takashi Yano [this message]
2022-06-07 18:00 ` Ken Brown
2022-06-06 10:41 ` Jon Turney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220608014916.df0275787115d55138757a3c@nifty.ne.jp \
--to=takashi.yano@nifty.ne.jp \
--cc=cygwin-patches@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).