forked from 0ad/0ad
janwas
b879e344f1
revamp module init: no more atexit and "premain" init => no longer need to call any wstartup init function. winit section names now use group numbers instead of letters. delay_load -> wdll_delay_load dll_ver -> wdll_ver add aken build environment cleanup wsock.cpp, have it import its functions properly wsdl: defend against GameSetup calling SDL_Quit twice. This was SVN commit r5108.
33 lines
901 B
C
33 lines
901 B
C
/**
|
|
* =========================================================================
|
|
* File : wdll_delay_load.h
|
|
* Project : 0 A.D.
|
|
* Description : DLL delay loading and notification
|
|
* =========================================================================
|
|
*/
|
|
|
|
// license: GPL; see lib/license.txt
|
|
|
|
#ifndef INCLUDED_WDLL_DELAY_LOAD
|
|
#define INCLUDED_WDLL_DELAY_LOAD
|
|
|
|
// must be POD because it is used before static ctors run.
|
|
struct WdllLoadNotify
|
|
{
|
|
const char* dll_name;
|
|
LibError (*func)(void);
|
|
WdllLoadNotify* next;
|
|
};
|
|
|
|
extern void wdll_add_notify(WdllLoadNotify*);
|
|
|
|
// request that func be called if and when dll_name is ever delay-loaded.
|
|
// must be invoked at function scope.
|
|
#define WDLL_ADD_NOTIFY(dll_name, func)\
|
|
STMT(\
|
|
static WdllLoadNotify UID__ = { dll_name, func };\
|
|
wdll_add_notify(&UID__);\
|
|
)
|
|
|
|
#endif // #ifndef INCLUDED_WDLL_DELAY_LOAD
|