RE: Patch for premain() function
"Ralf Habacker" <[email protected]>
| Newsgroups | gmane.comp.gnu.mingw.patches |
|---|---|
| Message-ID | <003501c26ca9$e3837030$686607d5@BRAMSCHE> |
> On Sat, Oct 05, 2002 at 05:14:36PM +0200, Ralf Habacker wrote: > >this patches implements a user callable function before main() for > >general initialisation purpose without needs for patching the mingw > >runtime on user level. > > Why not just use the __attribute__((constructor)) for your function? Can you make sure, that a specific constructor is been called first regardless of the position in the list of the used objectfiles ? As I know one of the possible link lines looks like this : gcc options ... <objectfiles> ... options ... <libraries> ... options and so one So if a constructor in <library> must be called at first and there are ones in <objectfiles>, it seems there is no change or are I'm wrong ? An additional premain() call makes sure that this is guaranteed like the premain() functions in the cygwin library. Ralf ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf