Mail Archives: djgpp/1994/06/22/11:01:20
>
> It seems to me there should be a way to call user-defined function BEFORE
> main() gets called. The above is one example of the need. Another one is
>
> Opinions, anyone?
Use C++. That's what conio does. Consider these C++ examples:
-----------------------------------------------------------
static void
_dj_user_init_function()
{
// do startup stuff
}
class _dj_user_init_class {
_dj_user_init_class() { _dj_user_init_function() };
};
static _dj_user_init_class _dj_user_init_object;
-----------------------------------------------------------
static int
_dj_user_init_function()
{
// do startup stuff
return 0;
}
static int i = _dj_user_init_function();
-----------------------------------------------------------
While this won't give you access to main's arguments, it is completely
independent of djgpp's internals.
- Raw text -