Re: [AD] mzscheme bindings in svn

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




Jon Rafkind wrote:
I don't think the additional copy of Allegro is acceptable.  What
changes are necessary?  Maybe we can incorporate some of them.

My version includes loadpng
Can't the loadpng bindings be separated out?

and a separate set of update functions for the cocoa api on osx that can be executed from a host language( not a C thread ).
Can this be compiled separately from Allegro?  Or does it require
changes?  We can add hooks or make some variables non-static in Allegro
if that would help.

I suppose the only real reason I included loadpng and mzscheme.m into the Allegro package was to make building easier and then I would only have to load one .so at runtime, but its probably not a big deal to just separate out loadpng and mzscheme.m into a different .so from allegro.

I think I can do this without any changes to Allegro. The only global variables I use in mzscheme.m are:
extern int    __crt0_argc;
extern char **__crt0_argv;
extern NSBundle *osx_bundle;
extern void* osx_event_mutex;
extern NSCursor *osx_cursor;
extern NSCursor *osx_blank_cursor;
extern AllegroWindow *osx_window;
extern void (*osx_window_close_hook)(void);
extern int osx_gfx_mode;
extern int osx_emulate_mouse_buttons;
extern int osx_window_first_expose;

Oh wait I forgot. I did change one fundamental thing about Allegro. In src/x/xsystem.c I had to comment out the signal stuff because mzscheme uses signals for write-barriers with the garbage collector:

static int _xwin_sysdrv_init(void)
{
  char tmp[256];

  _unix_read_os_type();
  /*
  old_sig_abrt = signal(SIGABRT, _xwin_signal_handler);
  old_sig_fpe  = signal(SIGFPE,  _xwin_signal_handler);
  old_sig_ill  = signal(SIGILL,  _xwin_signal_handler);
  old_sig_segv = signal(SIGSEGV, _xwin_signal_handler);
  old_sig_term = signal(SIGTERM, _xwin_signal_handler);
  old_sig_int  = signal(SIGINT,  _xwin_signal_handler);

#ifdef SIGQUIT
  old_sig_quit = signal(SIGQUIT, _xwin_signal_handler);
#endif
*/

Maybe we can wrap those with a
if ( global_use_signals ){
 ...
}
or something?




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