Re: [AD] alternate entry point for allegro programs

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Evert Glebbeek wrote:

Apart from providing a bit of djgpp emulation,

Could you be more specific? Are the __crt0_argc and __crt0_argv variables used for anything else?

No, they're not. My guess is that Michael just needed to name those variable somehow, so he thought "Some compatibility with DJGPP wouldn't hurt." (see udjgpp.c).

Considering that using argv[0] can be unreliable at any rate, using this if proc fs is available may not be a bad idea anyway (this can be done using a configure check at compile time, I guess...).
I think I'll go ahead and prepare a patch for that regardless.

Great!

The question arises what to do when proc fs is not available though. Generally, programs in a UNIX environment should not care from where they are executed. Considering that there is no portable reliable way to get the name of the executable, I'd vote to leave the return value blank for such systems, or return the current working directory instead.

I agree. The documentation would then contain a disclaimer saying that the results might not be reliable.

Oh, and if we can get of END_OF_MAIN, then yes, by all means, let's do it!

Well, I don't think we'll be getting rid of END_OF_MAIN itself, but some of the related hacks (notably #define main _mangled_main).

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/