public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: drop all usages of WINAPI
@ 2022-08-04 20:14 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2022-08-04 20:14 UTC (permalink / raw)
  To: cygwin-cvs

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

commit b28edc7b86c0b031c92ae9cd98c0c058f0b8aff3
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Thu Aug 4 21:16:32 2022 +0200

    Cygwin: drop all usages of WINAPI
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/advapi32.cc                 |  8 +++----
 winsup/cygwin/aio.cc                      |  6 +++---
 winsup/cygwin/cygthread.cc                |  4 ++--
 winsup/cygwin/cygthread.h                 |  6 +++---
 winsup/cygwin/exceptions.cc               |  8 +++----
 winsup/cygwin/fhandler_console.cc         | 10 ++++-----
 winsup/cygwin/fhandler_fifo.cc            |  2 +-
 winsup/cygwin/fhandler_netdrive.cc        |  2 +-
 winsup/cygwin/fhandler_socket_unix.cc     |  2 +-
 winsup/cygwin/fhandler_tty.cc             |  8 +++----
 winsup/cygwin/flock.cc                    |  6 +++---
 winsup/cygwin/include/cygwin/cygwin_dll.h |  4 ++--
 winsup/cygwin/init.cc                     |  4 ++--
 winsup/cygwin/kernel32.cc                 | 36 +++++++++++++++----------------
 winsup/cygwin/ldap.cc                     |  6 +++---
 winsup/cygwin/miscfuncs.cc                | 12 +++++------
 winsup/cygwin/miscfuncs.h                 | 23 ++++++++++----------
 winsup/cygwin/ntdll.h                     |  2 +-
 winsup/cygwin/pinfo.cc                    |  4 ++--
 winsup/cygwin/pinfo.h                     |  2 +-
 winsup/cygwin/posix_timer.cc              |  2 +-
 winsup/cygwin/profil.c                    |  2 +-
 winsup/cygwin/select.cc                   | 10 ++++-----
 winsup/cygwin/sigproc.cc                  |  6 +++---
 winsup/cygwin/thread.cc                   |  2 +-
 winsup/cygwin/thread.h                    |  2 +-
 winsup/cygwin/timerfd.cc                  |  2 +-
 winsup/cygwin/window.cc                   |  4 ++--
 winsup/cygwin/wininfo.h                   |  2 +-
 29 files changed, 93 insertions(+), 94 deletions(-)

diff --git a/winsup/cygwin/advapi32.cc b/winsup/cygwin/advapi32.cc
index 56c96c915..3769f2782 100644
--- a/winsup/cygwin/advapi32.cc
+++ b/winsup/cygwin/advapi32.cc
@@ -21,7 +21,7 @@ details. */
    is not easy to understand.  In all other case, use the ntdll.dll
    equivalent. */
 
-BOOL WINAPI
+BOOL
 RevertToSelf ()
 {
   HANDLE tok = NULL;
@@ -31,7 +31,7 @@ RevertToSelf ()
   DEFAULT_NTSTATUS_TO_BOOL_RETURN
 }
 
-BOOL WINAPI
+BOOL
 DuplicateTokenEx (HANDLE tok, DWORD access, LPSECURITY_ATTRIBUTES sec_attr,
 		  SECURITY_IMPERSONATION_LEVEL level, TOKEN_TYPE type,
 		  PHANDLE new_tok)
@@ -46,7 +46,7 @@ DuplicateTokenEx (HANDLE tok, DWORD access, LPSECURITY_ATTRIBUTES sec_attr,
   DEFAULT_NTSTATUS_TO_BOOL_RETURN
 }
 
-BOOL WINAPI
+BOOL
 ImpersonateLoggedOnUser (HANDLE tok)
 {
   NTSTATUS status;
@@ -86,7 +86,7 @@ ImpersonateLoggedOnUser (HANDLE tok)
   DEFAULT_NTSTATUS_TO_BOOL_RETURN
 }
 
-BOOL WINAPI
+BOOL
 ImpersonateNamedPipeClient (HANDLE pipe)
 {
   IO_STATUS_BLOCK io;
diff --git a/winsup/cygwin/aio.cc b/winsup/cygwin/aio.cc
index 4d1c2ee45..1c17aa7f6 100644
--- a/winsup/cygwin/aio.cc
+++ b/winsup/cygwin/aio.cc
@@ -200,7 +200,7 @@ aionotify (struct aiocb *aio)
     }
 }
 
-static DWORD WINAPI __attribute__ ((noreturn))
+static DWORD __attribute__ ((noreturn))
 aiowaiter (void *unused)
 { /* One instance, called on its own cygthread; runs until program exits */
   struct aiocb *aio;
@@ -327,7 +327,7 @@ asyncwrite (struct aiocb *aio)
 }
 
 /* Have to forward ref because of chicken v. egg situation */
-static DWORD WINAPI __attribute__ ((noreturn)) aioworker (void *);
+static DWORD __attribute__ ((noreturn)) aioworker (void *);
 
 static void
 aioinit (void)
@@ -400,7 +400,7 @@ aioqueue (struct aiocb *aio)
   return 0;
 }
 
-static DWORD WINAPI __attribute__ ((noreturn))
+static DWORD __attribute__ ((noreturn))
 aioworker (void *unused)
 { /* Multiple instances; called on own cygthreads; runs 'til program exits */
   struct aiocb *aio;
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc
index 66a317934..54918e767 100644
--- a/winsup/cygwin/cygthread.cc
+++ b/winsup/cygwin/cygthread.cc
@@ -52,7 +52,7 @@ cygthread::callfunc (bool issimplestub)
 /* Initial stub called by cygthread constructor. Performs initial
    per-thread initialization and loops waiting for another thread function
    to execute.  */
-DWORD WINAPI
+DWORD
 cygthread::stub (VOID *arg)
 {
   cygthread *info = (cygthread *) arg;
@@ -122,7 +122,7 @@ cygthread::stub (VOID *arg)
 
 /* Overflow stub called by cygthread constructor. Calls specified function
    and then exits the thread.  */
-DWORD WINAPI
+DWORD
 cygthread::simplestub (VOID *arg)
 {
   cygthread *info = (cygthread *) arg;
diff --git a/winsup/cygwin/cygthread.h b/winsup/cygwin/cygthread.h
index ed57c9301..241180f2b 100644
--- a/winsup/cygwin/cygthread.h
+++ b/winsup/cygwin/cygthread.h
@@ -7,7 +7,7 @@ details. */
 #ifndef _CYGTHREAD_H
 #define _CYGTHREAD_H
 
-typedef void WINAPI (*LPVOID_THREAD_START_ROUTINE) (void *) __attribute__((noreturn));		// Input queue thread
+typedef void (*LPVOID_THREAD_START_ROUTINE) (void *) __attribute__((noreturn));		// Input queue thread
 
 class cygthread
 {
@@ -32,8 +32,8 @@ class cygthread
   static void CALLBACK async_create (ULONG_PTR);
  public:
   bool terminate_thread ();
-  static DWORD WINAPI stub (VOID *);
-  static DWORD WINAPI simplestub (VOID *);
+  static DWORD stub (VOID *);
+  static DWORD simplestub (VOID *);
   static DWORD main_thread_id;
   static const char *name (DWORD = 0);
   void callfunc (bool) __attribute__ ((noinline, ));
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 5a154c35b..1c59b1597 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -55,7 +55,7 @@ PWCHAR debugger_command;
 extern uint8_t _sigbe;
 extern uint8_t _sigdelayed_end;
 
-static BOOL WINAPI ctrl_c_handler (DWORD);
+static BOOL ctrl_c_handler (DWORD);
 
 static const struct
 {
@@ -528,7 +528,7 @@ exception::myfault (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in,
    TODO: What we do here is to handle only __try/__except blocks in Cygwin.
          "Normal" exceptions will simply exit the process.  Still, better
 	 than nothing... */
-LONG WINAPI
+LONG
 myfault_altstack_handler (EXCEPTION_POINTERS *exc)
 {
   _cygtls& me = _my_tls;
@@ -976,7 +976,7 @@ has_visible_window_station ()
 }
 
 /* Keyboard interrupt handler.  */
-static BOOL WINAPI
+static BOOL
 ctrl_c_handler (DWORD type)
 {
   static bool saw_close;
@@ -1207,7 +1207,7 @@ set_signal_mask (sigset_t& setmask, sigset_t newmask)
 }
 
 
-DWORD WINAPI
+DWORD
 dumpstack_overflow_wrapper (PVOID arg)
 {
   cygwin_exception *exc = (cygwin_exception *) arg;
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index e3d87331f..a4a367005 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -198,7 +198,7 @@ console_unit::console_unit (HWND me0):
     api_fatal ("console device allocation failure - too many consoles in use, max consoles is 32");
 }
 
-static DWORD WINAPI
+static DWORD
 cons_master_thread (VOID *arg)
 {
   fhandler_console *fh = (fhandler_console *) arg;
@@ -3988,7 +3988,7 @@ DEF_HOOK (CreateProcessW);
 DEF_HOOK (ContinueDebugEvent);
 DEF_HOOK (GetProcAddress); /* Hooked for ConEmu cygwin connector */
 
-static BOOL WINAPI
+static BOOL
 CreateProcessA_Hooked
      (LPCSTR n, LPSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES ta,
       BOOL inh, DWORD f, LPVOID e, LPCSTR d,
@@ -4003,7 +4003,7 @@ CreateProcessA_Hooked
   return CreateProcessA_Orig (n, c, pa, ta, inh, f, e, d, si, pi);
 }
 
-static BOOL WINAPI
+static BOOL
 CreateProcessW_Hooked
      (LPCWSTR n, LPWSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES ta,
       BOOL inh, DWORD f, LPVOID e, LPCWSTR d,
@@ -4018,7 +4018,7 @@ CreateProcessW_Hooked
   return CreateProcessW_Orig (n, c, pa, ta, inh, f, e, d, si, pi);
 }
 
-static BOOL WINAPI
+static BOOL
 ContinueDebugEvent_Hooked
      (DWORD p, DWORD t, DWORD s)
 {
@@ -4029,7 +4029,7 @@ ContinueDebugEvent_Hooked
 }
 
 /* Hooked for ConEmu cygwin connector */
-static FARPROC WINAPI
+static FARPROC
 GetProcAddress_Hooked (HMODULE h, LPCSTR n)
 {
   if (strcmp(n, "RequestTermConnector") == 0)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index fa4ac7890..1d3e42908 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -446,7 +446,7 @@ fhandler_fifo::update_shared_handlers ()
   return 0;
 }
 
-static DWORD WINAPI
+static DWORD
 fifo_reader_thread (LPVOID param)
 {
   fhandler_fifo *fh = (fhandler_fifo *) param;
diff --git a/winsup/cygwin/fhandler_netdrive.cc b/winsup/cygwin/fhandler_netdrive.cc
index 306d77dd2..58ab8811b 100644
--- a/winsup/cygwin/fhandler_netdrive.cc
+++ b/winsup/cygwin/fhandler_netdrive.cc
@@ -63,7 +63,7 @@ wnet_dbg_out (const char *func, DWORD ndi_ret)
     debug_printf ("WNetGetLastError failed: %u", gle_ret);
 }
 
-static DWORD WINAPI
+static DWORD
 thread_netdrive (void *arg)
 {
   netdriveinf *ndi = (netdriveinf *) arg;
diff --git a/winsup/cygwin/fhandler_socket_unix.cc b/winsup/cygwin/fhandler_socket_unix.cc
index 524f18d81..0cd97f625 100644
--- a/winsup/cygwin/fhandler_socket_unix.cc
+++ b/winsup/cygwin/fhandler_socket_unix.cc
@@ -928,7 +928,7 @@ struct conn_wait_info_t
 };
 
 /* Just hop to the wait_pipe_thread method. */
-DWORD WINAPI
+DWORD
 connect_wait_func (LPVOID param)
 {
   conn_wait_info_t *wait_info = (conn_wait_info_t *) param;
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index a7e25ba83..0f9dec570 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -268,7 +268,7 @@ atexit_func (void)
 DEF_HOOK (CreateProcessA);
 DEF_HOOK (CreateProcessW);
 
-static BOOL WINAPI
+static BOOL
 CreateProcessA_Hooked
      (LPCSTR n, LPSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES ta,
       BOOL inh, DWORD f, LPVOID e, LPCSTR d,
@@ -307,7 +307,7 @@ CreateProcessA_Hooked
   return ret;
 }
 
-static BOOL WINAPI
+static BOOL
 CreateProcessW_Hooked
      (LPCWSTR n, LPWSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES ta,
       BOOL inh, DWORD f, LPVOID e, LPCWSTR d,
@@ -2666,7 +2666,7 @@ reply:
   return 0;
 }
 
-static DWORD WINAPI
+static DWORD
 pty_master_thread (VOID *arg)
 {
   fhandler_pty_master::master_thread_param_t p;
@@ -2873,7 +2873,7 @@ fhandler_pty_master::pty_master_fwd_thread (const master_fwd_thread_param_t *p)
   return 0;
 }
 
-static DWORD WINAPI
+static DWORD
 pty_master_fwd_thread (VOID *arg)
 {
   fhandler_pty_master::master_fwd_thread_param_t p;
diff --git a/winsup/cygwin/flock.cc b/winsup/cygwin/flock.cc
index 2f12fc07e..50db7fe28 100644
--- a/winsup/cygwin/flock.cc
+++ b/winsup/cygwin/flock.cc
@@ -642,7 +642,7 @@ lockf_t::create_lock_obj_attr (lockfattr_t *attr, ULONG flags, void *sd_buf)
   return &attr->attr;
 }
 
-DWORD WINAPI
+DWORD
 create_lock_in_parent (PVOID param)
 {
   HANDLE lf_obj;
@@ -721,7 +721,7 @@ err:
   return 1;
 }
 
-DWORD WINAPI
+DWORD
 delete_lock_in_parent (PVOID param)
 {
   inode_t *node, *next_node;
@@ -1870,7 +1870,7 @@ struct lock_parms {
   NTSTATUS	   status;
 };
 
-static DWORD WINAPI
+static DWORD
 blocking_lock_thr (LPVOID param)
 {
   struct lock_parms *lp = (struct lock_parms *) param;
diff --git a/winsup/cygwin/include/cygwin/cygwin_dll.h b/winsup/cygwin/include/cygwin/cygwin_dll.h
index 10a8bc7ed..1e4cf98ba 100644
--- a/winsup/cygwin/include/cygwin/cygwin_dll.h
+++ b/winsup/cygwin/include/cygwin/cygwin_dll.h
@@ -22,7 +22,7 @@ details. */
 #define DECLARE_CYGWIN_DLL(Entry)					      \
 									      \
 CDECL_BEGIN								      \
-  int WINAPI Entry (HINSTANCE h, DWORD reason, void *ptr);	              \
+  int Entry (HINSTANCE h, DWORD reason, void *ptr);	              \
   typedef int (*mainfunc) (int, char **, char **);			      \
   extern PVOID cygwin_attach_dll (HMODULE, mainfunc);			      \
   extern void cygwin_detach_dll (PVOID);				      \
@@ -42,7 +42,7 @@ static int __dllMain (int a __attribute__ ((__unused__)),		      \
 									      \
 static PVOID dll_index;							      \
 									      \
-int WINAPI _cygwin_dll_entry (HINSTANCE h, DWORD reason, void *ptr)	      \
+int _cygwin_dll_entry (HINSTANCE h, DWORD reason, void *ptr)	      \
 {									      \
   int ret;								      \
   ret = 1;								      \
diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc
index d822a3851..ce6484aff 100644
--- a/winsup/cygwin/init.cc
+++ b/winsup/cygwin/init.cc
@@ -19,7 +19,7 @@ unsigned threadfunc_ix[8];
 static bool dll_finished_loading;
 #define OLDFUNC_OFFSET -1
 
-static void WINAPI
+static void
 threadfunc_fe (VOID *arg)
 {
   _cygtls::call ((DWORD (*)  (void *, void *)) TlsGetValue (_my_oldfunc), arg);
@@ -70,7 +70,7 @@ void dll_crt0_0 ();
    need the alloca'd space in the DLL_PROCESS_ATTACH case below... */
 void *alloca_dummy;
 
-extern "C" BOOL WINAPI
+extern "C" BOOL
 dll_entry (HANDLE h, DWORD reason, void *static_load)
 {
   BOOL test_stack_marker;
diff --git a/winsup/cygwin/kernel32.cc b/winsup/cygwin/kernel32.cc
index 05c5d4d70..6248aefd5 100644
--- a/winsup/cygwin/kernel32.cc
+++ b/winsup/cygwin/kernel32.cc
@@ -22,7 +22,7 @@ details. */
 /* Implement CreateEvent/OpenEvent so that named objects are always created in
    Cygwin shared object namespace. */
 
-HANDLE WINAPI
+HANDLE
 CreateEventW (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset,
 	      BOOL bInitialState, LPCWSTR lpName)
 {
@@ -57,7 +57,7 @@ CreateEventW (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset,
   return evt;
 }
 
-HANDLE WINAPI
+HANDLE
 CreateEventA (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset,
 	      BOOL bInitialState, LPCSTR lpName)
 {
@@ -72,7 +72,7 @@ CreateEventA (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset,
 		       lpName ? name : NULL);
 }
 
-HANDLE WINAPI
+HANDLE
 OpenEventW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
 {
   HANDLE evt;
@@ -100,7 +100,7 @@ OpenEventW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
   return evt;
 }
 
-HANDLE WINAPI
+HANDLE
 OpenEventA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
 {
   WCHAR name[MAX_PATH];
@@ -116,7 +116,7 @@ OpenEventA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
 /* Implement CreateMutex/OpenMutex so that named objects are always created in
    Cygwin shared object namespace. */
 
-HANDLE WINAPI
+HANDLE
 CreateMutexW (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner,
 	      LPCWSTR lpName)
 {
@@ -148,7 +148,7 @@ CreateMutexW (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner,
   return mtx;
 }
 
-HANDLE WINAPI
+HANDLE
 CreateMutexA (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner,
 	      LPCSTR lpName)
 {
@@ -162,7 +162,7 @@ CreateMutexA (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner,
   return CreateMutexW (lpMutexAttributes, bInitialOwner, lpName ? name : NULL);
 }
 
-HANDLE WINAPI
+HANDLE
 OpenMutexW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
 {
   HANDLE mtx;
@@ -190,7 +190,7 @@ OpenMutexW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
   return mtx;
 }
 
-HANDLE WINAPI
+HANDLE
 OpenMutexA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
 {
   WCHAR name[MAX_PATH];
@@ -206,7 +206,7 @@ OpenMutexA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
 /* Implement CreateSemaphore/OpenSemaphore so that named objects are always
    created in Cygwin shared object namespace. */
 
-HANDLE WINAPI
+HANDLE
 CreateSemaphoreW (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
 		  LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName)
 {
@@ -240,7 +240,7 @@ CreateSemaphoreW (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
   return sem;
 }
 
-HANDLE WINAPI
+HANDLE
 CreateSemaphoreA (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
 		  LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName)
 {
@@ -255,7 +255,7 @@ CreateSemaphoreA (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
 			   lpName ? name : NULL);
 }
 
-HANDLE WINAPI
+HANDLE
 OpenSemaphoreW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
 {
   HANDLE sem;
@@ -283,7 +283,7 @@ OpenSemaphoreW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
   return sem;
 }
 
-HANDLE WINAPI
+HANDLE
 OpenSemaphoreA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
 {
   WCHAR name[MAX_PATH];
@@ -299,7 +299,7 @@ OpenSemaphoreA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
 /* Implement CreateFileMapping/OpenFileMapping so that named objects are always
    created in Cygwin shared object namespace. */
 
-HANDLE WINAPI
+HANDLE
 CreateFileMappingW (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
 		    DWORD flProtect, DWORD dwMaximumSizeHigh,
 		    DWORD dwMaximumSizeLow, LPCWSTR lpName)
@@ -354,7 +354,7 @@ CreateFileMappingW (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
   return sect;
 }
 
-HANDLE WINAPI
+HANDLE
 CreateFileMappingA (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
 		    DWORD flProtect, DWORD dwMaximumSizeHigh,
 		    DWORD dwMaximumSizeLow, LPCSTR lpName)
@@ -370,7 +370,7 @@ CreateFileMappingA (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
 			     dwMaximumSizeLow, lpName ? name : NULL);
 }
 
-HANDLE WINAPI
+HANDLE
 OpenFileMappingW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
 {
   HANDLE sect;
@@ -398,7 +398,7 @@ OpenFileMappingW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
   return sect;
 }
 
-HANDLE WINAPI
+HANDLE
 OpenFileMappingA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
 {
   WCHAR name[MAX_PATH];
@@ -433,7 +433,7 @@ ucmd ()
 /* Cygwin replacement for GetCommandLineW.  Returns a concatenated wide string
    representing the argv list, constructed using roughly the same mechanism as
    child_info_spawn::worker */
-extern "C" LPWSTR WINAPI
+extern "C" LPWSTR
 cygwin_GetCommandLineW (void)
 {
   return ucmd ()->Buffer;
@@ -442,7 +442,7 @@ cygwin_GetCommandLineW (void)
 /* Cygwin replacement for GetCommandLineA.  Returns a concatenated string
    representing the argv list, constructed using roughly the same mechanism
    as child_info_spawn::worker */
-extern "C" LPSTR WINAPI
+extern "C" LPSTR
 cygwin_GetCommandLineA (void)
 {
   static ANSI_STRING cmd;
diff --git a/winsup/cygwin/ldap.cc b/winsup/cygwin/ldap.cc
index 3c9fd13a1..ed2fa3f7f 100644
--- a/winsup/cygwin/ldap.cc
+++ b/winsup/cygwin/ldap.cc
@@ -208,7 +208,7 @@ cyg_ldap::connect_non_ssl (PCWSTR domain)
   return ret;
 }
 
-static DWORD WINAPI
+static DWORD
 ldap_init_thr (LPVOID param)
 {
   cyg_ldap_init *cl = (cyg_ldap_init *) param;
@@ -251,7 +251,7 @@ cyg_ldap::search_s (PWCHAR base, ULONG scope, PWCHAR filter, PWCHAR *attrs)
   return ret;
 }
 
-static DWORD WINAPI
+static DWORD
 ldap_search_thr (LPVOID param)
 {
   cyg_ldap_search *cl = (cyg_ldap_search *) param;
@@ -293,7 +293,7 @@ cyg_ldap::next_page_s ()
   return ret;
 }
 
-static DWORD WINAPI
+static DWORD
 ldap_next_page_thr (LPVOID param)
 {
   cyg_ldap_next_page *cl = (cyg_ldap_next_page *) param;
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index a5e381dad..bc362e331 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -19,7 +19,7 @@ details. */
 #include "mmap_alloc.h"
 
 /* not yet prototyped in w32api */
-extern "C" HRESULT WINAPI SetThreadDescription (HANDLE hThread, PCWSTR lpThreadDescription);
+extern "C" HRESULT SetThreadDescription (HANDLE hThread, PCWSTR lpThreadDescription);
 
 /* Get handle count of an object. */
 ULONG
@@ -202,7 +202,7 @@ nice_to_winprio (int &nice)
 
 /* Minimal overlapped pipe I/O implementation for signal and commune stuff. */
 
-BOOL WINAPI
+BOOL
 CreatePipeOverlapped (PHANDLE hr, PHANDLE hw, LPSECURITY_ATTRIBUTES sa)
 {
   int ret = fhandler_pipe::create (sa, hr, hw, 0, NULL,
@@ -212,7 +212,7 @@ CreatePipeOverlapped (PHANDLE hr, PHANDLE hw, LPSECURITY_ATTRIBUTES sa)
   return ret == 0;
 }
 
-BOOL WINAPI
+BOOL
 ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len, LPDWORD ret_len,
 		    DWORD timeout)
 {
@@ -232,7 +232,7 @@ ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len, LPDWORD ret_len,
   return ret;
 }
 
-BOOL WINAPI
+BOOL
 WritePipeOverlapped (HANDLE h, LPCVOID buf, DWORD len, LPDWORD ret_len,
 		     DWORD timeout)
 {
@@ -376,7 +376,7 @@ struct pthread_wrapper_arg
   ULONG guardsize;
 };
 
-DWORD WINAPI
+DWORD
 pthread_wrapper (PVOID arg)
 {
   /* Just plain paranoia. */
@@ -601,7 +601,7 @@ create_new_main_thread_stack (PVOID &allocationbase)
   return ((PBYTE) allocationbase + stacksize - 16);
 }
 
-HANDLE WINAPI
+HANDLE
 CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func, PVOID thread_arg,
 		    PVOID stackaddr, ULONG stacksize, ULONG guardsize,
 		    DWORD creation_flags, LPDWORD thread_id)
diff --git a/winsup/cygwin/miscfuncs.h b/winsup/cygwin/miscfuncs.h
index 565029561..fc791c2aa 100644
--- a/winsup/cygwin/miscfuncs.h
+++ b/winsup/cygwin/miscfuncs.h
@@ -49,12 +49,12 @@ DWORD nice_to_winprio (int &);
 
 bool create_pipe (PHANDLE, PHANDLE, LPSECURITY_ATTRIBUTES, DWORD);
 
-BOOL WINAPI CreatePipeOverlapped (PHANDLE read_handle, PHANDLE write_handle,
-				  LPSECURITY_ATTRIBUTES sa);
-BOOL WINAPI ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len,
-				LPDWORD ret_len, DWORD timeout);
-BOOL WINAPI WritePipeOverlapped (HANDLE h, LPCVOID buf, DWORD len,
-				 LPDWORD ret_len, DWORD timeout);
+BOOL CreatePipeOverlapped (PHANDLE read_handle, PHANDLE write_handle,
+			   LPSECURITY_ATTRIBUTES sa);
+BOOL ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len,
+			 LPDWORD ret_len, DWORD timeout);
+BOOL WritePipeOverlapped (HANDLE h, LPCVOID buf, DWORD len,
+			  LPDWORD ret_len, DWORD timeout);
 
 /* class for per-line reading using native functions.  The caller provides
    the file as an POBJECT_ATTRIBUTES, and the buffer space. */
@@ -110,12 +110,11 @@ ssize_t check_iovec (const struct iovec *, int, bool);
 
 extern PVOID create_new_main_thread_stack (PVOID &allocationbase);
 
-extern "C" DWORD WINAPI pthread_wrapper (PVOID arg);
-extern "C" HANDLE WINAPI CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func,
-					     PVOID thread_arg, PVOID stackaddr,
-					     ULONG stacksize, ULONG guardsize,
-					     DWORD creation_flags,
-					     LPDWORD thread_id);
+extern "C" DWORD pthread_wrapper (PVOID arg);
+extern "C" HANDLE CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func,
+				      PVOID thread_arg, PVOID stackaddr,
+				      ULONG stacksize, ULONG guardsize,
+				      DWORD creation_flags, LPDWORD thread_id);
 
 void SetThreadName (DWORD dwThreadID, const char* threadName);
 
diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h
index ad9c2e0c6..70d463d81 100644
--- a/winsup/cygwin/ntdll.h
+++ b/winsup/cygwin/ntdll.h
@@ -1522,7 +1522,7 @@ extern "C"
 				   PVOID, ULONG, PULONG);
   NTSTATUS NTAPI NtQuerySystemInformation (SYSTEM_INFORMATION_CLASS,
 					   PVOID, ULONG, PULONG);
-  NTSTATUS WINAPI NtQuerySystemTime (PLARGE_INTEGER);
+  NTSTATUS NTAPI NtQuerySystemTime (PLARGE_INTEGER);
   NTSTATUS NTAPI NtQuerySecurityObject (HANDLE, SECURITY_INFORMATION,
 					PSECURITY_DESCRIPTOR, ULONG, PULONG);
   NTSTATUS NTAPI NtQuerySymbolicLinkObject (HANDLE, PUNICODE_STRING, PULONG);
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 2e336c1a3..e086ab9a8 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -597,7 +597,7 @@ _pinfo::alive ()
   return !!h;
 }
 
-DWORD WINAPI
+DWORD
 commune_process (void *arg)
 {
   siginfo_t& si = *((siginfo_t *) arg);
@@ -1234,7 +1234,7 @@ _pinfo::environ (size_t& n)
    is received on the pipe, it is assumed that the cygwin pid has exited.
    Otherwise, various "signals" can be sent to the parent to inform the
    parent to perform a certain action. */
-static DWORD WINAPI
+static DWORD
 proc_waiter (void *arg)
 {
   pinfo vchild = *(pinfo *) arg;
diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h
index 7e4170341..463f0e851 100644
--- a/winsup/cygwin/pinfo.h
+++ b/winsup/cygwin/pinfo.h
@@ -131,7 +131,7 @@ public:
   friend class pinfo_minimal;
 };
 
-DWORD WINAPI commune_process (void *);
+DWORD commune_process (void *);
 
 enum parent_alerter
 {
diff --git a/winsup/cygwin/posix_timer.cc b/winsup/cygwin/posix_timer.cc
index 75cd4fa60..69c758aa7 100644
--- a/winsup/cygwin/posix_timer.cc
+++ b/winsup/cygwin/posix_timer.cc
@@ -228,7 +228,7 @@ out:
   return 0;
 }
 
-static DWORD WINAPI
+static DWORD
 timer_thread (VOID *x)
 {
   timer_tracker *tt = ((timer_tracker *) x);
diff --git a/winsup/cygwin/profil.c b/winsup/cygwin/profil.c
index 2c3a7a5eb..30b37244a 100644
--- a/winsup/cygwin/profil.c
+++ b/winsup/cygwin/profil.c
@@ -153,7 +153,7 @@ profile_on (struct profinfo *p)
       return -1;
     }
 
-  p->profthr = CreateThread (0, 0, (DWORD (WINAPI *)(LPVOID)) profthr_func,
+  p->profthr = CreateThread (0, 0, (DWORD (*)(LPVOID)) profthr_func,
                              (void *) p, 0, &thrid);
 
   if (!p->profthr)
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 0fa60bcdb..76ab91bbb 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -770,7 +770,7 @@ out:
 
 static int start_thread_pipe (select_record *me, select_stuff *stuff);
 
-static DWORD WINAPI
+static DWORD
 thread_pipe (void *arg)
 {
   select_pipe_info *pi = (select_pipe_info *) arg;
@@ -973,7 +973,7 @@ out:
 
 static int start_thread_fifo (select_record *me, select_stuff *stuff);
 
-static DWORD WINAPI
+static DWORD
 thread_fifo (void *arg)
 {
   select_fifo_info *pi = (select_fifo_info *) arg;
@@ -1161,7 +1161,7 @@ verify_console (select_record *me, fd_set *rfds, fd_set *wfds,
 
 static int console_startup (select_record *me, select_stuff *stuff);
 
-static DWORD WINAPI
+static DWORD
 thread_console (void *arg)
 {
   select_console_info *ci = (select_console_info *) arg;
@@ -1397,7 +1397,7 @@ out:
 
 static int pty_slave_startup (select_record *me, select_stuff *stuff);
 
-static DWORD WINAPI
+static DWORD
 thread_pty_slave (void *arg)
 {
   select_pipe_info *pi = (select_pipe_info *) arg;
@@ -1773,7 +1773,7 @@ peek_socket (select_record *me, bool)
 
 static int start_thread_socket (select_record *, select_stuff *);
 
-static DWORD WINAPI
+static DWORD
 thread_socket (void *arg)
 {
   select_socket_info *si = (select_socket_info *) arg;
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 0ccbc5046..6b1a4137d 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -100,7 +100,7 @@ static int checkstate (waitq *);
 static __inline__ bool get_proc_lock (DWORD, DWORD);
 static int remove_proc (int);
 static bool stopped_or_terminated (waitq *, _pinfo *);
-static void WINAPI wait_sig (VOID *arg);
+static void wait_sig (VOID *arg);
 
 /* wait_sig bookkeeping */
 
@@ -116,7 +116,7 @@ public:
   void clear (int sig) {sigs[sig].si.si_signo = 0;}
   void clear (_cygtls *tls);
   friend void sig_dispatch_pending (bool);
-  friend void WINAPI wait_sig (VOID *arg);
+  friend void wait_sig (VOID *arg);
 };
 
 Static pending_signals sigq;
@@ -1313,7 +1313,7 @@ pending_signals::add (sigpacket& pack)
 
 /* Process signals by waiting for signal data to arrive in a pipe.
    Set a completion event if one was specified. */
-static void WINAPI
+static void
 wait_sig (VOID *)
 {
   _sig_tls = &_my_tls;
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index 72c04dbda..dc59294e7 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -1989,7 +1989,7 @@ pthread_spinlock::unlock ()
   return result;
 }
 
-DWORD WINAPI
+DWORD
 pthread::thread_init_wrapper (void *arg)
 {
   exception protect;
diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h
index ddb2d7dbf..9939c4224 100644
--- a/winsup/cygwin/thread.h
+++ b/winsup/cygwin/thread.h
@@ -430,7 +430,7 @@ public:
   virtual void pop_cleanup_handler (int const execute);
 
   static pthread* self ();
-  static DWORD WINAPI thread_init_wrapper (void *);
+  static DWORD thread_init_wrapper (void *);
 
   virtual unsigned long getsequence_np();
 
diff --git a/winsup/cygwin/timerfd.cc b/winsup/cygwin/timerfd.cc
index f1a4c2804..c692e1bd1 100644
--- a/winsup/cygwin/timerfd.cc
+++ b/winsup/cygwin/timerfd.cc
@@ -225,7 +225,7 @@ canceled:
   return 0;
 }
 
-static DWORD WINAPI
+static DWORD
 timerfd_thread (VOID *arg)
 {
   timerfd_tracker *tt = ((timerfd_tracker *) arg);
diff --git a/winsup/cygwin/window.cc b/winsup/cygwin/window.cc
index 002053869..69430326a 100644
--- a/winsup/cygwin/window.cc
+++ b/winsup/cygwin/window.cc
@@ -52,7 +52,7 @@ process_window_events (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 }
 
 /* Handle windows events.  Inherits ownership of the wininfo lock */
-DWORD WINAPI
+DWORD
 wininfo::winthread ()
 {
   MSG msg;
@@ -92,7 +92,7 @@ wininfo::winthread ()
   return 0;
 }
 
-static DWORD WINAPI
+static DWORD
 winthread (VOID *arg)
 {
   return  ((wininfo *) arg)->winthread ();
diff --git a/winsup/cygwin/wininfo.h b/winsup/cygwin/wininfo.h
index 9dfba1a8c..323d272a5 100644
--- a/winsup/cygwin/wininfo.h
+++ b/winsup/cygwin/wininfo.h
@@ -16,7 +16,7 @@ public:
   int process (HWND, UINT, WPARAM, LPARAM);
   void lock ();
   void release ();
-  DWORD WINAPI winthread ();
+  DWORD winthread ();
 };
 
 extern wininfo winmsg;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-04 20:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04 20:14 [newlib-cygwin] Cygwin: drop all usages of WINAPI Corinna Vinschen

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).