Date: Wed, 22 Jun 94 10:37:39 -0400 From: dj AT ctron DOT com (DJ Delorie) To: eliz AT is DOT elta DOT co DOT il Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: Start-up calls; was: MORE on O_TEXT/O_BINARY > > 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.