Mail Archives: djgpp/1998/04/12/05:16:54
On Sat, 11 Apr 1998, Conrad Wei-Li Song wrote:
> How to I define functions to be called on program startup before main is
> called?
Declare these functions with the ``constructor'' attribute, like this:
static void __attribure__((constructor)) my_startup (void)
{
....
}
Note that these functions are called in the order they are seen by the
linker when it links the program. (This is only important if you have
several such functions which depend on each other.)
- Raw text -