1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-18 19:41:01 -05:00

Stop using GLOBAL Windows API function pointers.

The declarations in header files now use ordinary 'extern'. That means
I have to arrange to put definitions matching those declarations in
the appropriate modules; so I've made a macro DEFINE_WINDOWS_FUNCTION
which performs a definition matching a prior DECLARE_WINDOWS_FUNCTION
(and reusing the typedef made by the latter).

This applies not only to the batch of functions that were marked
GLOBAL in winstuff.h, but also the auxiliary sets marked
WINCAPI_GLOBAL and WINSECUR_GLOBAL in wincapi.h and winsecur.h
respectively.
This commit is contained in:
Simon Tatham
2020-02-02 10:00:43 +00:00
parent 3bbbdaad60
commit 25f7f8c025
6 changed files with 30 additions and 30 deletions

View File

@ -224,12 +224,11 @@ static bool sk_startup(int hi, int lo)
return true;
}
/* Actually define this function pointer, which won't have been
* defined alongside all the others by PUTTY_DO_GLOBALS because of the
* annoying winelib header-ordering issue. (See comment in winstuff.h.) */
DECL_WINDOWS_FUNCTION(/* empty */, int, select,
(int, fd_set FAR *, fd_set FAR *,
fd_set FAR *, const struct timeval FAR *));
DEF_WINDOWS_FUNCTION(WSAAsyncSelect);
DEF_WINDOWS_FUNCTION(WSAEventSelect);
DEF_WINDOWS_FUNCTION(WSAGetLastError);
DEF_WINDOWS_FUNCTION(WSAEnumNetworkEvents);
DEF_WINDOWS_FUNCTION(select);
void sk_init(void)
{