public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Ken Brown <kbrown@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: remove most occurrences of __stdcall and __cdecl
Date: Mon,  6 Jun 2022 16:06:01 +0000 (GMT)	[thread overview]
Message-ID: <20220606160601.18E523834E5A@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=30c5411d0717483a9ad892f6f0a2f92a1ffd7c84

commit 30c5411d0717483a9ad892f6f0a2f92a1ffd7c84
Author: Ken Brown <kbrown@cornell.edu>
Date:   Mon Jun 6 12:00:45 2022 -0400

    Cygwin: remove most occurrences of __stdcall and __cdecl
    
    These have no effect on x86_64.  Retain a few occurrences of __cdecl
    in files imported from other sources.
    
    Also retain all occurrences of WINAPI, even though the latter is
    simply a macro that expands to __stdcall.  Most of these occurrences
    are associated with Windows API functions, and removing them might
    make the code confusing instead of simpler.

Diff:
---
 winsup/cygwin/cygerrno.h                 |  2 +-
 winsup/cygwin/cygheap.cc                 |  8 ++---
 winsup/cygwin/cygheap.h                  |  4 +--
 winsup/cygwin/dcrt0.cc                   | 12 ++++----
 winsup/cygwin/debug.cc                   | 10 +++---
 winsup/cygwin/dll_init.cc                |  2 +-
 winsup/cygwin/dtable.cc                  |  2 +-
 winsup/cygwin/environ.cc                 |  6 ++--
 winsup/cygwin/exceptions.cc              |  6 ++--
 winsup/cygwin/fhandler.cc                | 10 +++---
 winsup/cygwin/fhandler.h                 | 52 ++++++++++++++++----------------
 winsup/cygwin/fhandler_clipboard.cc      |  2 +-
 winsup/cygwin/fhandler_console.cc        |  4 +--
 winsup/cygwin/fhandler_disk_file.cc      |  2 +-
 winsup/cygwin/fhandler_dsp.cc            |  4 +--
 winsup/cygwin/fhandler_procsys.cc        |  2 +-
 winsup/cygwin/fhandler_random.cc         |  2 +-
 winsup/cygwin/fhandler_signalfd.cc       |  2 +-
 winsup/cygwin/fhandler_socket_unix.cc    |  6 ++--
 winsup/cygwin/fhandler_timerfd.cc        |  2 +-
 winsup/cygwin/fhandler_tty.cc            |  4 +--
 winsup/cygwin/fhandler_virtual.cc        |  2 +-
 winsup/cygwin/fhandler_windows.cc        |  2 +-
 winsup/cygwin/fhandler_zero.cc           |  2 +-
 winsup/cygwin/fork.cc                    | 10 +++---
 winsup/cygwin/include/cygwin/time.h      |  6 ++--
 winsup/cygwin/include/sys/ioctl.h        |  2 +-
 winsup/cygwin/lib/_cygwin_crt0_common.cc |  2 +-
 winsup/cygwin/lib/crt0.h                 |  2 +-
 winsup/cygwin/mmap.cc                    |  2 +-
 winsup/cygwin/mount.cc                   |  4 +--
 winsup/cygwin/ntea.cc                    |  4 +--
 winsup/cygwin/pinfo.cc                   |  2 +-
 winsup/cygwin/pinfo.h                    | 10 +++---
 winsup/cygwin/resource.cc                |  4 +--
 winsup/cygwin/shared.cc                  | 10 +++---
 winsup/cygwin/shared_info.h              | 10 +++---
 winsup/cygwin/shm.cc                     |  2 +-
 winsup/cygwin/sigproc.h                  |  2 +-
 winsup/cygwin/strace.cc                  |  2 +-
 winsup/cygwin/strfuncs.cc                | 10 +++---
 winsup/cygwin/string.h                   |  8 ++---
 winsup/cygwin/times.cc                   | 16 +++++-----
 winsup/cygwin/tty.cc                     |  4 +--
 winsup/cygwin/tty.h                      |  6 ++--
 winsup/cygwin/winsup.h                   | 20 ++++++------
 winsup/utils/kill.cc                     |  2 +-
 winsup/utils/mingw/strace.cc             |  2 +-
 winsup/utils/ps.cc                       |  2 +-
 49 files changed, 147 insertions(+), 147 deletions(-)

diff --git a/winsup/cygwin/cygerrno.h b/winsup/cygwin/cygerrno.h
index b982bc27d..940bfa5e0 100644
--- a/winsup/cygwin/cygerrno.h
+++ b/winsup/cygwin/cygerrno.h
@@ -45,7 +45,7 @@ void __set_winsock_errno (const char *fn, int ln);
 #define set_winsock_errno() __set_winsock_errno (__FUNCTION__, __LINE__)
 
 #define get_errno()  (errno)
-extern "C" void __stdcall set_sig_errno (int e);
+extern "C" void set_sig_errno (int e);
 
 class save_errno
   {
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index e05bfbc48..65f95c924 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -69,11 +69,11 @@ static NO_COPY uint32_t nthreads;
 
 extern "C" {
 static void _cfree (void *);
-static void *__stdcall _csbrk (int);
+static void *_csbrk (int);
 }
 
 /* Called by fork or spawn to reallocate cygwin heap */
-void __stdcall
+void
 cygheap_fixup_in_child (bool execed)
 {
   cygheap_max = cygheap = (init_cygheap *) _cygheap_start;
@@ -239,7 +239,7 @@ init_cygheap::init_installation_root ()
     }
 }
 
-void __stdcall
+void
 cygheap_init ()
 {
   cygheap_protect.init ("cygheap_protect");
@@ -293,7 +293,7 @@ setup_cygheap ()
 #define somekinda_printf malloc_printf
 #endif
 
-static void *__stdcall
+static void *
 _csbrk (int sbs)
 {
   void *prebrk = cygheap_max;
diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h
index 528c61ed6..7f36c5837 100644
--- a/winsup/cygwin/cygheap.h
+++ b/winsup/cygwin/cygheap.h
@@ -719,7 +719,7 @@ class cygheap_fdenum : public cygheap_fdmanip
   }
 };
 
-void __stdcall cygheap_fixup_in_child (bool);
-void __stdcall cygheap_init ();
+void cygheap_fixup_in_child (bool);
+void cygheap_init ();
 void setup_cygheap ();
 extern char _cygheap_start[] __attribute__((section(".idata")));
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 9cc436cda..c460e15a0 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -61,7 +61,7 @@ do_global_dtors ()
     }
 }
 
-static void __stdcall
+static void
 do_global_ctors (void (**in_pfunc)(), int force)
 {
   if (!force && in_forkee)
@@ -84,7 +84,7 @@ do_global_ctors (void (**in_pfunc)(), int force)
  * A \@file is replaced with @file so that echo \@foo would print
  * @foo and not the contents of foo.
  */
-static bool __stdcall
+static bool
 insert_file (char *name, char *&cmd)
 {
   HANDLE f;
@@ -203,7 +203,7 @@ quoted (char *cmd, int winshell)
 			    && isalpha ((s)[2]) \
 			    && strchr ((s) + 3, '\\')))
 
-static int __stdcall
+static int
 globify (char *word, char **&argv, int &argc, int &argvlen)
 {
   if (*word != '~' && strpbrk (word, "?*[\"\'(){}") == NULL)
@@ -290,7 +290,7 @@ globify (char *word, char **&argv, int &argc, int &argvlen)
 
 /* Build argv, argc from string passed from Windows.  */
 
-static void __stdcall
+static void
 build_argv (char *cmd, char **&argv, int &argc, int winshell)
 {
   int argvlen = 0;
@@ -365,7 +365,7 @@ build_argv (char *cmd, char **&argv, int &argc, int winshell)
 }
 
 /* sanity and sync check */
-void __stdcall
+void
 check_sanity_and_sync (per_process *p)
 {
   /* Sanity check to make sure developers didn't change the per_process    */
@@ -1013,7 +1013,7 @@ __cygwin_exit_return:			\n\
 ");
 }
 
-extern "C" void __stdcall
+extern "C" void
 _dll_crt0 ()
 {
   /* Starting with Windows 10 rel 1511, the main stack of an application is
diff --git a/winsup/cygwin/debug.cc b/winsup/cygwin/debug.cc
index f21a8c518..efa101ba7 100644
--- a/winsup/cygwin/debug.cc
+++ b/winsup/cygwin/debug.cc
@@ -38,7 +38,7 @@ class lock_debug
 
 muto NO_COPY lock_debug::locker;
 
-static bool __stdcall mark_closed (const char *, int, HANDLE, const char *, bool);
+static bool mark_closed (const char *, int, HANDLE, const char *, bool);
 
 void
 debug_init ()
@@ -47,7 +47,7 @@ debug_init ()
 }
 
 /* Find a registered handle in the linked list of handles. */
-static handle_list * __stdcall
+static handle_list *
 find_handle (HANDLE h)
 {
   handle_list *hl;
@@ -87,7 +87,7 @@ setclexec (HANDLE oh, HANDLE nh, bool not_inheriting)
 }
 
 /* Create a new handle record */
-static handle_list * __stdcall
+static handle_list *
 newh ()
 {
   handle_list *hl;
@@ -155,7 +155,7 @@ add_handle (const char *func, int ln, HANDLE h, const char *name, bool inh)
   debug_printf ("protecting handle '%s'(%p), inherited flag %d", hl->name, hl->h, hl->inherited);
 }
 
-static void __stdcall
+static void
 delete_handle (handle_list *hl)
 {
   handle_list *hnuke = hl->next;
@@ -176,7 +176,7 @@ debug_fixup_after_fork_exec ()
       delete_handle (hl);	// removes hl->next
 }
 
-static bool __stdcall
+static bool
 mark_closed (const char *func, int ln, HANDLE h, const char *name, bool force)
 {
   handle_list *hl;
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc
index 649af1153..b486eaa1f 100644
--- a/winsup/cygwin/dll_init.cc
+++ b/winsup/cygwin/dll_init.cc
@@ -25,7 +25,7 @@ details. */
 #include <assert.h>
 #include <tls_pbuf.h>
 
-extern void __stdcall check_sanity_and_sync (per_process *);
+extern void check_sanity_and_sync (per_process *);
 
 #define fabort fork_info->abort
 
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 474c470a6..6b2394814 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -58,7 +58,7 @@ dtable_init ()
     cygheap->fdtab.extend (NOFILE_INCR, 0);
 }
 
-void __stdcall
+void
 set_std_handle (int fd)
 {
   fhandler_base *fh = cygheap->fdtab[fd];
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index ab593ab64..ca60bd8d4 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -169,7 +169,7 @@ strbrk(char *&buf)
 
 /* Parse a string of the form "something=stuff somethingelse=more-stuff",
    silently ignoring unknown "somethings".  */
-static void __stdcall
+static void
 parse_options (const char *inbuf)
 {
   int istrue;
@@ -562,7 +562,7 @@ secure_getenv (const char *name)
 }
 
 /* Return number of environment entries, including terminating NULL. */
-static int __stdcall
+static int
 envsize (const char * const *in_envp)
 {
   const char * const *envp;
@@ -578,7 +578,7 @@ envsize (const char * const *in_envp)
 /* Takes similar arguments to setenv except that overwrite is
    either -1, 0, or 1.  0 or 1 signify that the function should
    perform similarly to setenv.  Otherwise putenv is assumed. */
-static int __stdcall
+static int
 _addenv (const char *name, const char *value, int overwrite)
 {
   int issetenv = overwrite >= 0;
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index b8d46504d..dd4f0f075 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -756,7 +756,7 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in,
    attempts to block unblockable signals will be silently ignored.
    This is counter to what appears to be documented in some UNIX
    man pages, e.g. Linux.  */
-int __stdcall
+int
 handle_sigsuspend (sigset_t tempmask)
 {
   sigset_t oldmask = _my_tls.sigmask;	// Remember for restoration
@@ -868,7 +868,7 @@ _cygtls::interrupt_setup (siginfo_t& si, void *handler, struct sigaction& siga)
 		  signal_arrived, si.si_signo);
 }
 
-extern "C" void __stdcall
+extern "C" void
 set_sig_errno (int e)
 {
   *_my_tls.errno_addr = e;
@@ -1093,7 +1093,7 @@ ctrl_c_handler (DWORD type)
 }
 
 /* Function used by low level sig wrappers. */
-extern "C" void __stdcall
+extern "C" void
 set_process_mask (sigset_t newmask)
 {
   set_signal_mask (_my_tls.sigmask, newmask);
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 88507357b..5671fea3c 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -142,7 +142,7 @@ char *fhandler_base::get_proc_fd_name (char *buf)
 
 /* Detect if we are sitting at EOF for conditions where Windows
    returns an error but UNIX doesn't.  */
-int __stdcall
+int
 is_at_eof (HANDLE h)
 {
   IO_STATUS_BLOCK io;
@@ -871,7 +871,7 @@ out:
   debug_printf ("returning %d, %s mode", len, rbinary () ? "binary" : "text");
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_base::write (const void *ptr, size_t len)
 {
   ssize_t res;
@@ -967,7 +967,7 @@ fhandler_base::write (const void *ptr, size_t len)
   return res;
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_base::readv (const struct iovec *const iov, const int iovcnt,
 		      ssize_t tot)
 {
@@ -1024,7 +1024,7 @@ fhandler_base::readv (const struct iovec *const iov, const int iovcnt,
   return len;
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_base::writev (const struct iovec *const iov, const int iovcnt,
 		       ssize_t tot)
 {
@@ -1501,7 +1501,7 @@ fhandler_dev_null::fhandler_dev_null () :
 {
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_dev_null::write (const void *ptr, size_t len)
 {
   /* Shortcut.  This also fixes a problem with the NUL device on 64 bit:
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index a2a4ec150..dfad07f72 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -404,9 +404,9 @@ public:
   virtual int fcntl (int cmd, intptr_t);
   virtual char const *ttyname () { return get_name (); }
   virtual void read (void *ptr, size_t& len);
-  virtual ssize_t __stdcall write (const void *ptr, size_t len);
-  virtual ssize_t __stdcall readv (const struct iovec *, int iovcnt, ssize_t tot = -1);
-  virtual ssize_t __stdcall writev (const struct iovec *, int iovcnt, ssize_t tot = -1);
+  virtual ssize_t write (const void *ptr, size_t len);
+  virtual ssize_t readv (const struct iovec *, int iovcnt, ssize_t tot = -1);
+  virtual ssize_t writev (const struct iovec *, int iovcnt, ssize_t tot = -1);
   virtual ssize_t pread (void *, size_t, off_t, void *aio = NULL);
   virtual ssize_t pwrite (void *, size_t, off_t, void *aio = NULL);
   virtual off_t lseek (off_t offset, int whence);
@@ -593,14 +593,14 @@ class fhandler_socket: public fhandler_base
 			    struct sockaddr *from, int *fromlen) = 0;
   virtual ssize_t recvmsg (struct msghdr *msg, int flags) = 0;
   virtual void read (void *ptr, size_t& len) = 0;
-  virtual ssize_t __stdcall readv (const struct iovec *, int iovcnt,
+  virtual ssize_t readv (const struct iovec *, int iovcnt,
 				   ssize_t tot = -1) = 0;
 
   virtual ssize_t sendto (const void *ptr, size_t len, int flags,
 	      const struct sockaddr *to, int tolen) = 0;
   virtual ssize_t sendmsg (const struct msghdr *msg, int flags) = 0;
-  virtual ssize_t __stdcall write (const void *ptr, size_t len) = 0;
-  virtual ssize_t __stdcall writev (const struct iovec *, int iovcnt, ssize_t tot = -1) = 0;
+  virtual ssize_t write (const void *ptr, size_t len) = 0;
+  virtual ssize_t writev (const struct iovec *, int iovcnt, ssize_t tot = -1) = 0;
   virtual int setsockopt (int level, int optname, const void *optval,
 			  __socklen_t optlen) = 0;
   virtual int getsockopt (int level, int optname, const void *optval,
@@ -712,9 +712,9 @@ class fhandler_socket_wsock: public fhandler_socket
 		    struct sockaddr *from, int *fromlen);
   ssize_t recvmsg (struct msghdr *msg, int flags);
   void read (void *ptr, size_t& len);
-  ssize_t __stdcall readv (const struct iovec *, int iovcnt, ssize_t tot = -1);
-  ssize_t __stdcall write (const void *ptr, size_t len);
-  ssize_t __stdcall writev (const struct iovec *, int iovcnt, ssize_t tot = -1);
+  ssize_t readv (const struct iovec *, int iovcnt, ssize_t tot = -1);
+  ssize_t write (const void *ptr, size_t len);
+  ssize_t writev (const struct iovec *, int iovcnt, ssize_t tot = -1);
   int shutdown (int how);
   int close ();
 
@@ -1121,14 +1121,14 @@ class fhandler_socket_unix : public fhandler_socket
   ssize_t recvfrom (void *ptr, size_t len, int flags,
 		    struct sockaddr *from, int *fromlen);
   void read (void *ptr, size_t& len);
-  ssize_t __stdcall readv (const struct iovec *const iov, int iovcnt,
+  ssize_t readv (const struct iovec *const iov, int iovcnt,
 			   ssize_t tot = -1);
 
   ssize_t sendmsg (const struct msghdr *msg, int flags);
   ssize_t sendto (const void *ptr, size_t len, int flags,
 		  const struct sockaddr *to, int tolen);
-  ssize_t __stdcall write (const void *ptr, size_t len);
-  ssize_t __stdcall writev (const struct iovec *const iov, int iovcnt,
+  ssize_t write (const void *ptr, size_t len);
+  ssize_t writev (const struct iovec *const iov, int iovcnt,
 			    ssize_t tot = -1);
   int setsockopt (int level, int optname, const void *optval,
 		  __socklen_t optlen);
@@ -2202,7 +2202,7 @@ private:
   int dup (fhandler_base *, int);
 
   void read (void *ptr, size_t& len);
-  ssize_t __stdcall write (const void *ptr, size_t len);
+  ssize_t write (const void *ptr, size_t len);
   void doecho (const void *str, DWORD len);
   int close ();
   static bool exists ()
@@ -2386,7 +2386,7 @@ class fhandler_pty_slave: public fhandler_pty_common
 
   int open (int flags, mode_t mode = 0);
   bool open_setup (int flags);
-  ssize_t __stdcall write (const void *ptr, size_t len);
+  ssize_t write (const void *ptr, size_t len);
   void read (void *ptr, size_t& len);
   int init (HANDLE, DWORD, mode_t);
 
@@ -2501,7 +2501,7 @@ public:
   int accept_input ();
   int open (int flags, mode_t mode = 0);
   bool open_setup (int flags);
-  ssize_t __stdcall write (const void *ptr, size_t len);
+  ssize_t write (const void *ptr, size_t len);
   void read (void *ptr, size_t& len);
   int close ();
   void cleanup ();
@@ -2571,14 +2571,14 @@ class fhandler_dev_null: public fhandler_base
     return fh;
   }
 
-  ssize_t __stdcall write (const void *ptr, size_t len);
+  ssize_t write (const void *ptr, size_t len);
 };
 
 class fhandler_dev_zero: public fhandler_base
 {
  public:
   fhandler_dev_zero ();
-  ssize_t __stdcall write (const void *ptr, size_t len);
+  ssize_t write (const void *ptr, size_t len);
   void read (void *ptr, size_t& len);
   off_t lseek (off_t, int) { return 0; }
 
@@ -2617,7 +2617,7 @@ class fhandler_dev_random: public fhandler_base
   int pseudo_read (void *ptr, size_t len);
 
  public:
-  ssize_t __stdcall write (const void *ptr, size_t len);
+  ssize_t write (const void *ptr, size_t len);
   void read (void *ptr, size_t& len);
   off_t lseek (off_t, int) { return 0; }
 
@@ -2652,7 +2652,7 @@ class fhandler_dev_clipboard: public fhandler_base
   fhandler_dev_clipboard ();
   int is_windows () { return 1; }
   int fstat (struct stat *buf);
-  ssize_t __stdcall write (const void *ptr, size_t len);
+  ssize_t write (const void *ptr, size_t len);
   void read (void *ptr, size_t& len);
   off_t lseek (off_t offset, int whence);
   int close ();
@@ -2688,7 +2688,7 @@ class fhandler_windows: public fhandler_base
   int is_windows () { return 1; }
   HWND get_hwnd () { return hWnd_; }
   int open (int flags, mode_t mode = 0);
-  ssize_t __stdcall write (const void *ptr, size_t len);
+  ssize_t write (const void *ptr, size_t len);
   void read (void *ptr, size_t& len);
   int ioctl (unsigned int cmd, void *);
   off_t lseek (off_t, int) { return 0; }
@@ -2734,7 +2734,7 @@ class fhandler_dev_dsp: public fhandler_base
   fhandler_dev_dsp *base () const {return (fhandler_dev_dsp *)archetype;}
 
   int open (int, mode_t mode = 0);
-  ssize_t __stdcall write (const void *, size_t);
+  ssize_t write (const void *, size_t);
   void read (void *, size_t&);
   int ioctl (unsigned int, void *);
   int close ();
@@ -2742,7 +2742,7 @@ class fhandler_dev_dsp: public fhandler_base
   void fixup_after_exec ();
 
  private:
-  ssize_t __stdcall _write (const void *, size_t);
+  ssize_t _write (const void *, size_t);
   void _read (void *, size_t&);
   int _ioctl (unsigned int, void *);
   void _fixup_after_fork (HANDLE);
@@ -2789,7 +2789,7 @@ class fhandler_virtual : public fhandler_base
   void seekdir (DIR *, long);
   void rewinddir (DIR *);
   int closedir (DIR *);
-  ssize_t __stdcall write (const void *ptr, size_t len);
+  ssize_t write (const void *ptr, size_t len);
   void read (void *ptr, size_t& len);
   off_t lseek (off_t, int);
   int dup (fhandler_base *child, int);
@@ -2867,7 +2867,7 @@ class fhandler_procsys: public fhandler_virtual
   int open (int flags, mode_t mode = 0);
   int close ();
   void read (void *ptr, size_t& len);
-  ssize_t __stdcall write (const void *ptr, size_t len);
+  ssize_t write (const void *ptr, size_t len);
   int fstat (struct stat *buf);
   bool fill_filebuf ();
 
@@ -3122,7 +3122,7 @@ class fhandler_signalfd : public fhandler_base
   int signalfd (const sigset_t *mask, int flags);
   int fstat (struct stat *buf);
   void read (void *ptr, size_t& len);
-  ssize_t __stdcall write (const void *, size_t);
+  ssize_t write (const void *, size_t);
 
   int poll ();
   inline sigset_t get_sigset () const { return sigset; }
@@ -3167,7 +3167,7 @@ class fhandler_timerfd : public fhandler_base
 
   int fstat (struct stat *buf);
   void read (void *ptr, size_t& len);
-  ssize_t __stdcall write (const void *, size_t);
+  ssize_t write (const void *, size_t);
   int dup (fhandler_base *child, int);
   int ioctl (unsigned int, void *);
   int close ();
diff --git a/winsup/cygwin/fhandler_clipboard.cc b/winsup/cygwin/fhandler_clipboard.cc
index ae6de4551..4886968b2 100644
--- a/winsup/cygwin/fhandler_clipboard.cc
+++ b/winsup/cygwin/fhandler_clipboard.cc
@@ -121,7 +121,7 @@ fhandler_dev_clipboard::set_clipboard (const void *buf, size_t len)
 }
 
 /* FIXME: arbitrary seeking is not handled */
-ssize_t __stdcall
+ssize_t
 fhandler_dev_clipboard::write (const void *buf, size_t len)
 {
   /* write to our membuffer */
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 45b786dd5..52239c2f9 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -3311,7 +3311,7 @@ do_print:
   return found + trunc_buf.len;
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_console::write (const void *vsrc, size_t len)
 {
   bg_check_types bg = bg_check (SIGTTOU);
@@ -3778,7 +3778,7 @@ fhandler_console::set_close_on_exec (bool val)
   close_on_exec (val);
 }
 
-void __stdcall
+void
 set_console_title (char *title)
 {
   wchar_t buf[TITLESIZE + 1];
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index f7728e36e..22d8aba83 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -1578,7 +1578,7 @@ fhandler_disk_file::pread (void *buf, size_t count, off_t offset, void *aio)
      Windows mandatory locking semantics disallow to use another HANDLE. */
   if (rbinary () && !mandatory_locking ())
     {
-      extern int __stdcall is_at_eof (HANDLE h);
+      extern int is_at_eof (HANDLE h);
       NTSTATUS status;
       IO_STATUS_BLOCK io;
       LARGE_INTEGER off = { QuadPart:offset };
diff --git a/winsup/cygwin/fhandler_dsp.cc b/winsup/cygwin/fhandler_dsp.cc
index 4d4824b56..c37bedea5 100644
--- a/winsup/cygwin/fhandler_dsp.cc
+++ b/winsup/cygwin/fhandler_dsp.cc
@@ -1020,7 +1020,7 @@ fhandler_dev_dsp::fhandler_dev_dsp ():
   dev ().parse (FH_OSS_DSP);
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_dev_dsp::write (const void *ptr, size_t len)
 {
   return base ()->_write (ptr, len);
@@ -1093,7 +1093,7 @@ fhandler_dev_dsp::open (int flags, mode_t)
 #define IS_WRITE() ((get_flags() & O_ACCMODE) != O_RDONLY)
 #define IS_READ() ((get_flags() & O_ACCMODE) != O_WRONLY)
 
-ssize_t __stdcall
+ssize_t
 fhandler_dev_dsp::_write (const void *ptr, size_t len)
 {
   debug_printf ("ptr=%p len=%ld", ptr, len);
diff --git a/winsup/cygwin/fhandler_procsys.cc b/winsup/cygwin/fhandler_procsys.cc
index a5fd85f43..cd1d35984 100644
--- a/winsup/cygwin/fhandler_procsys.cc
+++ b/winsup/cygwin/fhandler_procsys.cc
@@ -432,7 +432,7 @@ fhandler_procsys::read (void *ptr, size_t& len)
   fhandler_base::raw_read (ptr, len);
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_procsys::write (const void *ptr, size_t len)
 {
   return fhandler_base::raw_write (ptr, len);
diff --git a/winsup/cygwin/fhandler_random.cc b/winsup/cygwin/fhandler_random.cc
index c0f37b55e..495e3a94b 100644
--- a/winsup/cygwin/fhandler_random.cc
+++ b/winsup/cygwin/fhandler_random.cc
@@ -36,7 +36,7 @@ fhandler_dev_random::pseudo_write (const void *ptr, size_t len)
   return len;
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_dev_random::write (const void *ptr, size_t len)
 {
   if (!len)
diff --git a/winsup/cygwin/fhandler_signalfd.cc b/winsup/cygwin/fhandler_signalfd.cc
index 97305515f..bdd8bc93e 100644
--- a/winsup/cygwin/fhandler_signalfd.cc
+++ b/winsup/cygwin/fhandler_signalfd.cc
@@ -140,7 +140,7 @@ fhandler_signalfd::read (void *ptr, size_t& len)
   return;
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_signalfd::write (const void *, size_t)
 {
   set_errno (EINVAL);
diff --git a/winsup/cygwin/fhandler_socket_unix.cc b/winsup/cygwin/fhandler_socket_unix.cc
index 55e0432b6..b63f50c64 100644
--- a/winsup/cygwin/fhandler_socket_unix.cc
+++ b/winsup/cygwin/fhandler_socket_unix.cc
@@ -1911,7 +1911,7 @@ fhandler_socket_unix::read (void *ptr, size_t& len)
   len = recvmsg (&msg, 0);
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_socket_unix::readv (const struct iovec *const iov, int iovcnt,
 			     ssize_t tot)
 {
@@ -1953,7 +1953,7 @@ fhandler_socket_unix::sendto (const void *in_ptr, size_t len, int flags,
   return sendmsg (&msg, flags);
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_socket_unix::write (const void *ptr, size_t len)
 {
   struct iovec iov;
@@ -1971,7 +1971,7 @@ fhandler_socket_unix::write (const void *ptr, size_t len)
   return sendmsg (&msg, 0);
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_socket_unix::writev (const struct iovec *const iov, int iovcnt,
 			      ssize_t tot)
 {
diff --git a/winsup/cygwin/fhandler_timerfd.cc b/winsup/cygwin/fhandler_timerfd.cc
index 6bc4e0d68..9269494db 100644
--- a/winsup/cygwin/fhandler_timerfd.cc
+++ b/winsup/cygwin/fhandler_timerfd.cc
@@ -143,7 +143,7 @@ fhandler_timerfd::read (void *ptr, size_t& len)
   return;
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_timerfd::write (const void *, size_t)
 {
   set_errno (EINVAL);
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index e3f774a6b..a7e25ba83 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -1241,7 +1241,7 @@ fhandler_pty_slave::reset_switch_to_nat_pipe (void)
   ReleaseMutex (pipe_sw_mutex);
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_pty_slave::write (const void *ptr, size_t len)
 {
   ssize_t towrite = len;
@@ -2171,7 +2171,7 @@ fhandler_pty_master::close ()
   return 0;
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_pty_master::write (const void *ptr, size_t len)
 {
   ssize_t ret;
diff --git a/winsup/cygwin/fhandler_virtual.cc b/winsup/cygwin/fhandler_virtual.cc
index bdd454d1c..21ff4f35e 100644
--- a/winsup/cygwin/fhandler_virtual.cc
+++ b/winsup/cygwin/fhandler_virtual.cc
@@ -202,7 +202,7 @@ fhandler_virtual::read (void *ptr, size_t& len)
   position += len;
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_virtual::write (const void *ptr, size_t len)
 {
   set_errno (EACCES);
diff --git a/winsup/cygwin/fhandler_windows.cc b/winsup/cygwin/fhandler_windows.cc
index 947cfd5a0..90ab48daa 100644
--- a/winsup/cygwin/fhandler_windows.cc
+++ b/winsup/cygwin/fhandler_windows.cc
@@ -54,7 +54,7 @@ fhandler_windows::open (int flags, mode_t mode)
   return fhandler_base::open ((flags & ~O_TEXT) | O_BINARY, mode);
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_windows::write (const void *buf, size_t)
 {
   MSG *ptr = (MSG *) buf;
diff --git a/winsup/cygwin/fhandler_zero.cc b/winsup/cygwin/fhandler_zero.cc
index 563768574..9d8fe004d 100644
--- a/winsup/cygwin/fhandler_zero.cc
+++ b/winsup/cygwin/fhandler_zero.cc
@@ -19,7 +19,7 @@ fhandler_dev_zero::fhandler_dev_zero ()
 {
 }
 
-ssize_t __stdcall
+ssize_t
 fhandler_dev_zero::write (const void *, size_t len)
 {
   if (get_device () == FH_FULL)
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index 65f3e051b..012819b61 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -44,8 +44,8 @@ class frok
   int child_pid;
   int this_errno;
   HANDLE hchild;
-  int __stdcall parent (volatile char * volatile here);
-  int __stdcall child (volatile char * volatile here);
+  int parent (volatile char * volatile here);
+  int child (volatile char * volatile here);
   bool error (const char *fmt, ...);
   friend int dofork (void **proc, bool *with_forkables);
 };
@@ -59,7 +59,7 @@ resume_child (HANDLE forker_finished)
 }
 
 /* Notify parent that it is time for the next step. */
-static void __stdcall
+static void
 sync_with_parent (const char *s, bool hang_self)
 {
   debug_printf ("signalling parent: %s", s);
@@ -131,7 +131,7 @@ child_info::prefork (bool detached)
     }
 }
 
-int __stdcall
+int
 frok::child (volatile char * volatile here)
 {
   HANDLE& hParent = ch.parent;
@@ -202,7 +202,7 @@ frok::child (volatile char * volatile here)
   return 0;
 }
 
-int __stdcall
+int
 frok::parent (volatile char * volatile stack_here)
 {
   HANDLE forker_finished;
diff --git a/winsup/cygwin/include/cygwin/time.h b/winsup/cygwin/include/cygwin/time.h
index a1080a1c0..d7f9d3f75 100644
--- a/winsup/cygwin/include/cygwin/time.h
+++ b/winsup/cygwin/include/cygwin/time.h
@@ -14,11 +14,11 @@ extern "C"
 #endif
 
 /* Not defined in main time.h */
-int __cdecl clock_setres (clockid_t, struct timespec *);
+int clock_setres (clockid_t, struct timespec *);
 
 /* GNU extensions. */
-time_t __cdecl timelocal (struct tm *);
-time_t __cdecl timegm (struct tm *);
+time_t timelocal (struct tm *);
+time_t timegm (struct tm *);
 
 #define TIMER_RELTIME  0 /* For compatibility with HP/UX, Solaris, others? */
 
diff --git a/winsup/cygwin/include/sys/ioctl.h b/winsup/cygwin/include/sys/ioctl.h
index 4c7121471..6289e7da7 100644
--- a/winsup/cygwin/include/sys/ioctl.h
+++ b/winsup/cygwin/include/sys/ioctl.h
@@ -61,7 +61,7 @@ __BEGIN_DECLS
 # define _IOWR	_LINUX_IOWR
 #endif /*__USE_LINUX_IOCTL_DEFS */
 
-int __cdecl ioctl (int __fd, int __cmd, ...);
+int ioctl (int __fd, int __cmd, ...);
 
 __END_DECLS
 #endif
diff --git a/winsup/cygwin/lib/_cygwin_crt0_common.cc b/winsup/cygwin/lib/_cygwin_crt0_common.cc
index 365015011..d356a50fb 100644
--- a/winsup/cygwin/lib/_cygwin_crt0_common.cc
+++ b/winsup/cygwin/lib/_cygwin_crt0_common.cc
@@ -72,7 +72,7 @@ struct per_process_cxx_malloc __cygwin_cxx_malloc =
 /* Set up pointers to various pieces so the dll can then use them,
    and then jump to the dll.  */
 
-int __stdcall
+int
 _cygwin_crt0_common (MainFunc f, per_process *u)
 {
   per_process *newu = (per_process *) cygwin_internal (CW_USER_DATA);
diff --git a/winsup/cygwin/lib/crt0.h b/winsup/cygwin/lib/crt0.h
index c551de78f..e599b4493 100644
--- a/winsup/cygwin/lib/crt0.h
+++ b/winsup/cygwin/lib/crt0.h
@@ -13,7 +13,7 @@ extern "C" {
 #include "winlean.h"
 struct per_process;
 typedef int (*MainFunc) (int argc, char *argv[], char **env);
-int __stdcall _cygwin_crt0_common (MainFunc, struct per_process *);
+int _cygwin_crt0_common (MainFunc, struct per_process *);
 PVOID dll_dllcrt0 (HMODULE, struct per_process *);
 
 #ifdef __cplusplus
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index 948eeec1f..0c70d66f0 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -1774,7 +1774,7 @@ fhandler_disk_file::fixup_mmap_after_fork (HANDLE h, int prot, int flags,
    none of the mapped areas are in our address space. We need to iterate
    through the map, doing the MapViewOfFile calls.  */
 
-int __stdcall
+int
 fixup_mmaps_after_fork (HANDLE parent)
 {
   /* Iterate over maps */
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index 5eb028980..389f62fad 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -47,7 +47,7 @@ int NO_COPY mount_info::root_idx = -1;
    This function is only used to test for valid input strings.
    The later normalization drops the native prefixes. */
 
-static inline bool __stdcall
+static inline bool
 is_native_path (const char *path)
 {
   return isdirsep (path[0])
@@ -57,7 +57,7 @@ is_native_path (const char *path)
 	 && isalpha (path[4]);
 }
 
-static inline bool __stdcall
+static inline bool
 is_unc_share (const char *path)
 {
   const char *p;
diff --git a/winsup/cygwin/ntea.cc b/winsup/cygwin/ntea.cc
index 5094cf324..a400fcb2b 100644
--- a/winsup/cygwin/ntea.cc
+++ b/winsup/cygwin/ntea.cc
@@ -364,7 +364,7 @@ write_ea (HANDLE hdl, path_conv &pc, const char *name, const char *value,
   return ret;
 }
 
-static ssize_t __stdcall
+static ssize_t
 getxattr_worker (path_conv &pc, const char *name, void *value, size_t size)
 {
   int res = -1;
@@ -468,7 +468,7 @@ flistxattr (int fd, char *list, size_t size)
   return res;
 }
 
-static int __stdcall
+static int
 setxattr_worker (path_conv &pc, const char *name, const void *value,
 		 size_t size, int flags)
 {
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index a54dac89b..832a3e6bc 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -82,7 +82,7 @@ pinfo::thisproc (HANDLE h)
 
 /* Initialize the process table entry for the current task.
    This is not called for forked tasks, only execed ones.  */
-void __stdcall
+void
 pinfo_init (char **envp, int envc)
 {
   if (envp)
diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h
index 86ba64bb6..7e4170341 100644
--- a/winsup/cygwin/pinfo.h
+++ b/winsup/cygwin/pinfo.h
@@ -254,7 +254,7 @@ public:
 pid_t create_cygwin_pid ();
 pid_t cygwin_pid (DWORD);
 
-void __stdcall pinfo_init (char **, int);
+void pinfo_init (char **, int);
 extern pinfo myself;
 
 /* Helper class to allow convenient setting and unsetting a process_state
@@ -291,9 +291,9 @@ public:
 #define myctty() myself->__ctty ()
 
 /* For mmaps across fork(). */
-int __stdcall fixup_mmaps_after_fork (HANDLE parent);
+int fixup_mmaps_after_fork (HANDLE parent);
 /* for shm areas across fork (). */
-int __stdcall fixup_shms_after_fork ();
+int fixup_shms_after_fork ();
 
-void __stdcall fill_rusage (struct rusage *, HANDLE);
-void __stdcall add_rusage (struct rusage *, struct rusage *);
+void fill_rusage (struct rusage *, HANDLE);
+void add_rusage (struct rusage *, struct rusage *);
diff --git a/winsup/cygwin/resource.cc b/winsup/cygwin/resource.cc
index 21e85bd18..aafc2b0b1 100644
--- a/winsup/cygwin/resource.cc
+++ b/winsup/cygwin/resource.cc
@@ -37,7 +37,7 @@ add_timeval (struct timeval *tv1, struct timeval *tv2)
 }
 
 /* add rusage values of r2 to r1 */
-void __stdcall
+void
 add_rusage (struct rusage *r1, struct rusage *r2)
 {
   add_timeval (&r1->ru_utime, &r2->ru_utime);
@@ -59,7 +59,7 @@ add_rusage (struct rusage *r1, struct rusage *r2)
 }
 
 /* FIXME: what about other fields? */
-void __stdcall
+void
 fill_rusage (struct rusage *r, HANDLE h)
 {
   KERNEL_USER_TIMES kut;
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
index c939e0d0f..c549f5e26 100644
--- a/winsup/cygwin/shared.cc
+++ b/winsup/cygwin/shared.cc
@@ -95,14 +95,14 @@ get_session_parent_dir ()
   return session_parent_dir;
 }
 
-char * __stdcall
+char *
 shared_name (char *ret_buf, const char *str, int num)
 {
   __small_sprintf (ret_buf, "%s.%d", str, num);
   return ret_buf;
 }
 
-WCHAR * __stdcall
+WCHAR *
 shared_name (WCHAR *ret_buf, const WCHAR *str, int num)
 {
   __small_swprintf (ret_buf, L"%W.%d", str, num);
@@ -135,14 +135,14 @@ static ptrdiff_t offsets[] =
 
 #define off_addr(x)	((void *)((caddr_t) cygwin_hmodule + offsets[x]))
 
-void * __stdcall
+void *
 open_shared (const WCHAR *name, int n, HANDLE& shared_h, DWORD size,
 	     shared_locations m, PSECURITY_ATTRIBUTES psa, DWORD access)
 {
   return open_shared (name, n, shared_h, size, &m, psa, access);
 }
 
-void * __stdcall
+void *
 open_shared (const WCHAR *name, int n, HANDLE& shared_h, DWORD size,
 	     shared_locations *m, PSECURITY_ATTRIBUTES psa, DWORD access)
 {
@@ -276,7 +276,7 @@ user_info::create (bool reinit)
     user_shared->initialize ();
 }
 
-void __stdcall
+void
 shared_destroy ()
 {
   ForceCloseHandle (cygwin_shared_h);
diff --git a/winsup/cygwin/shared_info.h b/winsup/cygwin/shared_info.h
index 83a1fd187..6c53ec0b8 100644
--- a/winsup/cygwin/shared_info.h
+++ b/winsup/cygwin/shared_info.h
@@ -77,7 +77,7 @@ enum shared_locations
 };
 
 void memory_init ();
-void __stdcall shared_destroy ();
+void shared_destroy ();
 
 #define shared_align_past(p) \
   ((char *) (system_info.dwAllocationGranularity * \
@@ -86,12 +86,12 @@ void __stdcall shared_destroy ();
 
 HANDLE get_shared_parent_dir ();
 HANDLE get_session_parent_dir ();
-char *__stdcall shared_name (char *, const char *, int);
-WCHAR *__stdcall shared_name (WCHAR *, const WCHAR *, int);
-void *__stdcall open_shared (const WCHAR *, int, HANDLE&, DWORD,
+char *shared_name (char *, const char *, int);
+WCHAR *shared_name (WCHAR *, const WCHAR *, int);
+void *open_shared (const WCHAR *, int, HANDLE&, DWORD,
 			     shared_locations, PSECURITY_ATTRIBUTES = &sec_all,
 			     DWORD = FILE_MAP_READ | FILE_MAP_WRITE);
-void *__stdcall open_shared (const WCHAR *, int, HANDLE&, DWORD,
+void *open_shared (const WCHAR *, int, HANDLE&, DWORD,
 			     shared_locations *, PSECURITY_ATTRIBUTES = &sec_all,
 			     DWORD = FILE_MAP_READ | FILE_MAP_WRITE);
 extern void user_shared_create (bool reinit);
diff --git a/winsup/cygwin/shm.cc b/winsup/cygwin/shm.cc
index af079ad86..88d3c0a48 100644
--- a/winsup/cygwin/shm.cc
+++ b/winsup/cygwin/shm.cc
@@ -117,7 +117,7 @@ static NO_COPY muto shm_guard;
 #define SLIST_LOCK()	(shm_guard.init ("shm_guard")->acquire ())
 #define SLIST_UNLOCK()	(shm_guard.release ())
 
-int __stdcall
+int
 fixup_shms_after_fork ()
 {
   if (!SLIST_FIRST (&sph_list))
diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h
index f2d7e3168..7aca80595 100644
--- a/winsup/cygwin/sigproc.h
+++ b/winsup/cygwin/sigproc.h
@@ -64,7 +64,7 @@ int handle_sigprocmask (int sig, const sigset_t *set,
 
 void sig_clear (int);
 void sig_set_pending (int);
-int __stdcall handle_sigsuspend (sigset_t);
+int handle_sigsuspend (sigset_t);
 
 int proc_subproc (DWORD, uintptr_t);
 
diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc
index 35f8a59ae..a1a55d1ec 100644
--- a/winsup/cygwin/strace.cc
+++ b/winsup/cygwin/strace.cc
@@ -90,7 +90,7 @@ strace::microseconds ()
   return (int) (clk->strace_usecs () - process_start);
 }
 
-static int __stdcall
+static int
 getfunc (char *in_dst, const char *func)
 {
   const char *p;
diff --git a/winsup/cygwin/strfuncs.cc b/winsup/cygwin/strfuncs.cc
index f68fcb76f..9a97b3a24 100644
--- a/winsup/cygwin/strfuncs.cc
+++ b/winsup/cygwin/strfuncs.cc
@@ -671,7 +671,7 @@ sys_mbstowcs_alloc (wchar_t **dst_p, int type, const char *src, size_t nms)
 /* Copy string, until c or <nul> is encountered.
    NUL-terminate the destination string (s1).
    Return pointer to terminating byte in dst string.  */
-char * __stdcall
+char *
 strccpy (char *__restrict s1, const char **__restrict s2, char c)
 {
   while (**s2 && **s2 != c)
@@ -738,7 +738,7 @@ const char isalpha_array[] = {
    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0
 };
 
-extern "C" int __stdcall
+extern "C" int
 cygwin_wcscasecmp (const wchar_t *ws, const wchar_t *wt)
 {
   UNICODE_STRING us, ut;
@@ -748,7 +748,7 @@ cygwin_wcscasecmp (const wchar_t *ws, const wchar_t *wt)
   return RtlCompareUnicodeString (&us, &ut, TRUE);
 }
 
-extern "C" int __stdcall
+extern "C" int
 cygwin_wcsncasecmp (const wchar_t  *ws, const wchar_t *wt, size_t n)
 {
   UNICODE_STRING us, ut;
@@ -763,7 +763,7 @@ cygwin_wcsncasecmp (const wchar_t  *ws, const wchar_t *wt, size_t n)
   return RtlCompareUnicodeString (&us, &ut, TRUE);
 }
 
-extern "C" int __stdcall
+extern "C" int
 cygwin_strcasecmp (const char *cs, const char *ct)
 {
   UNICODE_STRING us, ut;
@@ -782,7 +782,7 @@ cygwin_strcasecmp (const char *cs, const char *ct)
   return RtlCompareUnicodeString (&us, &ut, TRUE);
 }
 
-extern "C" int __stdcall
+extern "C" int
 cygwin_strncasecmp (const char *cs, const char *ct, size_t n)
 {
   UNICODE_STRING us, ut;
diff --git a/winsup/cygwin/string.h b/winsup/cygwin/string.h
index 384314442..ec9a030a0 100644
--- a/winsup/cygwin/string.h
+++ b/winsup/cygwin/string.h
@@ -17,7 +17,7 @@ extern "C" {
 
 #undef strchrnul
 #define strchrnul cygwin_strchrnul
-static inline __stdcall char *
+static inline char *
 strchrnul (const char *s, int c)
 {
   while (*s != (char) c && *s != 0)
@@ -68,11 +68,11 @@ ascii_strncasematch (const char *cs, const char *ct, size_t n)
 
 #undef strcasecmp
 #define strcasecmp cygwin_strcasecmp
-int __stdcall cygwin_strcasecmp (const char *, const char *);
+int cygwin_strcasecmp (const char *, const char *);
 
 #undef strncasecmp
 #define strncasecmp cygwin_strncasecmp
-int __stdcall cygwin_strncasecmp (const char *, const char *, size_t);
+int cygwin_strncasecmp (const char *, const char *, size_t);
 
 #define strcasematch(s1,s2)	(!cygwin_strcasecmp ((s1),(s2)))
 #define strncasematch(s1,s2,n)	(!cygwin_strncasecmp ((s1),(s2),(n)))
@@ -82,7 +82,7 @@ char *strupr (char *);
 
 #endif /* __INSIDE_CYGWIN__ */
 
-char *__stdcall strccpy (char *__restrict s1, const char **__restrict s2,
+char *strccpy (char *__restrict s1, const char **__restrict s2,
 			 char c);
 
 #ifdef __cplusplus
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index 60b29b323..4ab432925 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -35,7 +35,7 @@ get_system_time (PLARGE_INTEGER systime)
 }
 
 /* Cygwin internal */
-static uint64_t __stdcall
+static uint64_t
 __to_clock_t (PLARGE_INTEGER src, int flag)
 {
   uint64_t total = src->QuadPart;
@@ -154,7 +154,7 @@ timezone (void)
 }
 
 /* Cygwin internal */
-void __stdcall
+void
 totimeval (struct timeval *dst, PLARGE_INTEGER src, int sub, int flag)
 {
   int64_t x = __to_clock_t (src, flag);
@@ -194,7 +194,7 @@ gettimeofday (struct timeval *__restrict tv, void *__restrict tzvp)
 EXPORT_ALIAS (gettimeofday, _gettimeofday)
 
 /* Cygwin internal */
-void __stdcall
+void
 timespec_to_filetime (const struct timespec *time_in, PLARGE_INTEGER out)
 {
   if (time_in->tv_nsec == UTIME_OMIT)
@@ -205,7 +205,7 @@ timespec_to_filetime (const struct timespec *time_in, PLARGE_INTEGER out)
 }
 
 /* Cygwin internal */
-void __stdcall
+void
 timeval_to_filetime (const struct timeval *time_in, PLARGE_INTEGER out)
 {
   out->QuadPart = time_in->tv_sec * NS100PERSEC
@@ -230,7 +230,7 @@ timeval_to_ms (const struct timeval *time_in, DWORD &ms)
 }
 
 /* Cygwin internal */
-static timeval __stdcall
+static timeval
 time_t_to_timeval (time_t in)
 {
   timeval res;
@@ -265,7 +265,7 @@ timeval_to_timespec (const struct timeval *tvp, struct timespec *tmp)
 
 /* Cygwin internal */
 /* Convert a Win32 time to "UNIX" format. */
-time_t __stdcall
+time_t
 to_time_t (PLARGE_INTEGER ptr)
 {
   /* A file time is the number of 100ns since jan 1 1601
@@ -285,7 +285,7 @@ to_time_t (PLARGE_INTEGER ptr)
 
 /* Cygwin internal */
 /* Convert a Win32 time to "UNIX" timestruc_t format. */
-void __stdcall
+void
 to_timestruc_t (PLARGE_INTEGER ptr, timestruc_t *out)
 {
   /* A file time is the number of 100ns since jan 1 1601
@@ -309,7 +309,7 @@ to_timestruc_t (PLARGE_INTEGER ptr, timestruc_t *out)
 
 /* Cygwin internal */
 /* Get the current time as a "UNIX" timestruc_t format. */
-void __stdcall
+void
 time_as_timestruc_t (timestruc_t * out)
 {
   LARGE_INTEGER systime;
diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc
index 2959fe2ab..a862a444e 100644
--- a/winsup/cygwin/tty.cc
+++ b/winsup/cygwin/tty.cc
@@ -63,7 +63,7 @@ ttyslot (void)
   return device::minor (myself->ctty);
 }
 
-void __stdcall
+void
 tty_list::init_session ()
 {
   char mutex_name[MAX_PATH];
@@ -75,7 +75,7 @@ tty_list::init_session ()
   ProtectHandle (mutex);
 }
 
-void __stdcall
+void
 tty::init_session ()
 {
   if (!myself->cygstarted && NOTSTATE (myself, PID_CYGPARENT))
diff --git a/winsup/cygwin/tty.h b/winsup/cygwin/tty.h
index c4f2b5dd7..3d0ea0c68 100644
--- a/winsup/cygwin/tty.h
+++ b/winsup/cygwin/tty.h
@@ -169,8 +169,8 @@ public:
   bool exists ();
   bool not_allocated (HANDLE&, HANDLE&);
   void set_master_ctl_closed () {master_pid = -1;}
-  static void __stdcall create_master (int);
-  static void __stdcall init_session ();
+  static void create_master (int);
+  static void init_session ();
   void wait_fwd ();
   bool pty_input_state_eq (xfer_dir x) { return pty_input_state == x; }
   bool nat_fg (pid_t pgid);
@@ -192,7 +192,7 @@ public:
   void init ();
   tty_min *get_cttyp ();
   int attach (int n);
-  static void __stdcall init_session ();
+  static void init_session ();
   friend class lock_ttys;
 };
 
diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h
index 4147dcebf..43dfbf46f 100644
--- a/winsup/cygwin/winsup.h
+++ b/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 *);
 
@@ -182,8 +182,8 @@ const char *find_first_notloaded_dll (class path_conv &);
 
 /**************************** Miscellaneous ******************************/
 
-void __stdcall set_std_handle (int);
-int __stdcall stat_dev (DWORD, int, unsigned long, struct stat *);
+void set_std_handle (int);
+int stat_dev (DWORD, int, unsigned long, struct stat *);
 
 ino_t hash_path_name (ino_t hash, PUNICODE_STRING name);
 ino_t hash_path_name (ino_t hash, PCWSTR name);
@@ -194,16 +194,16 @@ void *hook_or_detect_cygwin (const char *, const void *, WORD&, HANDLE h = NULL)
 void *hook_api (const char *mname, const char *name, const void *fn);
 
 /* Time related */
-void __stdcall totimeval (struct timeval *, PLARGE_INTEGER, int, int);
-time_t __stdcall to_time_t (PLARGE_INTEGER);
-void __stdcall to_timestruc_t (PLARGE_INTEGER, timestruc_t *);
-void __stdcall time_as_timestruc_t (timestruc_t *);
-void __stdcall timeval_to_filetime (const struct timeval *, PLARGE_INTEGER);
-void __stdcall timespec_to_filetime (const struct timespec *, PLARGE_INTEGER);
+void totimeval (struct timeval *, PLARGE_INTEGER, int, int);
+time_t to_time_t (PLARGE_INTEGER);
+void to_timestruc_t (PLARGE_INTEGER, timestruc_t *);
+void time_as_timestruc_t (timestruc_t *);
+void timeval_to_filetime (const struct timeval *, PLARGE_INTEGER);
+void timespec_to_filetime (const struct timespec *, PLARGE_INTEGER);
 bool timeval_to_ms (const struct timeval *, DWORD &);
 
 /* Console related */
-void __stdcall set_console_title (char *);
+void set_console_title (char *);
 void init_console_handler (bool);
 
 extern bool wsock_started;
diff --git a/winsup/utils/kill.cc b/winsup/utils/kill.cc
index d0fb54737..04c9774eb 100644
--- a/winsup/utils/kill.cc
+++ b/winsup/utils/kill.cc
@@ -154,7 +154,7 @@ get_debug_priv (void)
   CloseHandle (tok);
 }
 
-static void __stdcall
+static void
 forcekill (pid_t pid, DWORD winpid, int sig, int wait)
 {
   DWORD dwpid;
diff --git a/winsup/utils/mingw/strace.cc b/winsup/utils/mingw/strace.cc
index 2731fd391..f7e7b8fd0 100644
--- a/winsup/utils/mingw/strace.cc
+++ b/winsup/utils/mingw/strace.cc
@@ -437,7 +437,7 @@ syst (long long t)
   return &st;
 }
 
-static void __stdcall
+static void
 handle_output_debug_string (DWORD id, LPVOID p, unsigned mask, FILE *ofile)
 {
   int len;
diff --git a/winsup/utils/ps.cc b/winsup/utils/ps.cc
index dbcacbab4..982183c5d 100644
--- a/winsup/utils/ps.cc
+++ b/winsup/utils/ps.cc
@@ -68,7 +68,7 @@ start_time (external_pinfo *child)
 #define NSPERSEC 10000000LL
 
 /* Convert a Win32 time to "UNIX" format. */
-long __stdcall
+long
 to_time_t (FILETIME *ptr)
 {
   /* A file time is the number of 100ns since jan 1 1601


                 reply	other threads:[~2022-06-06 16:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220606160601.18E523834E5A@sourceware.org \
    --to=kbrown@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /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).