On Mon, 2005-10-24 at 23:48 -0400, Jon Rafkind wrote:
Im using Allegro with bindings written in Scheme( MzScheme ) but am
running into problems on OS X. This works fine on Linux, though.
Basically how its set up is I load allegro.so( or in this case
allegro.dylib ) and extract functions from it which I can then call just
like I would from C. In this way the "magic main" in OS X isnt run and
things dont seem to work right when this is the case. Im not very
familiar with the OS X internals and KittyCat was telling me it wasnt
really possible to run Allegro on OS X without the magic main but Im
hoping this can be changed so it works the same on Linux.
I did a bunch of debugging by adding printf's into the Allegro internals
but couldnt really come up with anything since I think two or more
threads are doing stuff once I activate allegro via install_allegro. One
thing I did come up with is that if I dont have a main then __crt0_argv
isnt set and in system.m line 489 will crash. This should read
else if ( __crt0_argv != NULL ){
do_uconvert(__crt0_argv[0], U_ASCII, output, U_CURRENT, size);
}
instead.
Any OS X have any insight into this problem?
Basically, you must give control of the main thread to Allegro. You can
see what Allegro does at startup in src/macosx/main.m. The main()
function in there is the main function of any standalone Allegro
program, the main() in your code gets basically renamed to something
else with END_OF_MAIN.