[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

foreign loading C++ code



Allegro currently is set up for foreign loading of C or Fortran.  I would
like to foreign load C++ code.  Some questions:

1. Has anybody done this?  If so, what problems occured?  Was the effort
   successful?

2. Does Franz plan to suport foreign loading of C++?  If so, when?

3. One problem that I can think of is static initialization and destruction.
   The Cfront C++ compiler handles static initialization by generating a
   function with a name like _sti_xxxx for each file that is compiled.
   Ordinarily, the C++ linker arranges for the static init functions that are
   in a particular executable to be called at startup.  Obviously when foreign
   loading into lisp this does not happen.

   It is easy enough to call the static initialization functions from lisp.
   The problem is knowing what their names are.  I have been working around the
   problem by building a dummy executable and then doing something like

      nm dummy | grep _sti_

   to find the names.  This technique is rather clumsy.  One step towards a
   solution would be a lisp function that lets me map through the entry points
   in a lisp so as to find the ones that correspond to static initializers.
   Any suggestions on how to do this?

-bill-

William Brew
Reasoning Systems Inc.