Skip to content

Commit

Permalink
On 1.7.x-r1871447 branch:
Browse files Browse the repository at this point in the history
  Merge r1866562 from trunk.



git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x-r1871447@1916256 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Ivan Zhakov committed Mar 12, 2024
1 parent be4d9a3 commit 0fb0d30
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions include/arch/win32/apr_arch_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,18 @@ FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal);
#define APR_DECLARE_LATE_DLL_FUNC(lib, rettype, calltype, fn, ord, args, names) \
typedef rettype (calltype *apr_winapi_fpt_##fn) args; \
static apr_winapi_fpt_##fn apr_winapi_pfn_##fn = NULL; \
static int apr_winapi_chk_##fn = 0; \
static APR_INLINE int apr_winapi_ld_##fn(void) \
static INIT_ONCE apr_winapi_ctrl_##fn = {INIT_ONCE_STATIC_INIT}; \
static BOOL WINAPI apr_winapi_init_once_##fn(PINIT_ONCE init_once,\
PVOID baton, PVOID *context) \
{ \
apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \
apr_load_dll_func(lib, #fn, ord); \
return TRUE; \
} \
static APR_INLINE int apr_winapi_ld_##fn(void) \
{ if (apr_winapi_pfn_##fn) return 1; \
if (apr_winapi_chk_##fn ++) return 0; \
if (!apr_winapi_pfn_##fn) \
apr_winapi_pfn_##fn = (apr_winapi_fpt_##fn) \
apr_load_dll_func(lib, #fn, ord); \
InitOnceExecuteOnce(&apr_winapi_ctrl_##fn, apr_winapi_init_once_##fn, \
NULL, NULL); \
if (apr_winapi_pfn_##fn) return 1; else return 0; }; \
static APR_INLINE rettype apr_winapi_##fn args \
{ if (apr_winapi_ld_##fn()) \
Expand Down

0 comments on commit 0fb0d30

Please sign in to comment.