This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++, guile-snarf, and guile-1.3



I had to put a hack into guile-snarf in order to use guile-1.3 with
the Sparcworks C++ compiler.

Here is my hacked version, which relaxes the assumption that gcc is
being used, and that also adds a type cast to the last argument of
scm_make_gsubr to stop the C++ compiler from complaining.  I guess
this would be better done in the preprocessor macro, rather than with
sed (the sed clause I have added is a bit frightening).

It is not generally safe to assume that since gcc was used to build
guile, that only gcc will be used when building programs that use guile,
so I think that explicitly forcing gcc in guile-snarf is a bug.

-russ

#!/bin/sh

old_snarf()
{
  # Extract the initialization actions for builtin things.
  gcc -E -DSCM_MAGIC_SNARFER "$@" | grep "^ *% *% *%" | sed -e "s/^ *% *% *%//"
}

${CC:-gcc} -E -DSCM_MAGIC_SNARFER $@ | \
    grep "^ *% *% *%" | \
    sed -e "s/^ *% *% *%//" \
        -e 's#\(scm_make_gsubr.*,\) *\([a-zA-Z0-9_]*\) )#\1 (long(*)())\2 )#'


--
"Reality is what refuses to disappear when you stop believing in it."
             -- (VALIS, Philip K. Dick)