I cannot compile with C++ and get bignum support. The build
ends abruptly like this:
In file included from
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3
.4.2/iosfwd:50,
from /usr/include/gmp.h:26,
from /usr/src/xemacs/xemacs-21.5/src/number-gmp.h:38,
from /usr/src/xemacs/xemacs-21.5/src/number.h:62,
from /usr/src/xemacs/xemacs-21.5/src/lisp.h:3529,
from /usr/src/xemacs/xemacs-21.5/src/abbrev.c:36:
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3
.4.2/bits/postypes.h: In member function `std::fpos<_StateT>&
std::fpos<_StateT>::operator+=(std::streamoff)':
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3
.4.2/bits/postypes.h:154: error: `c_this' undeclared (first
use this function)
The problem is that we define "this" to be "c_this" in both
lisp.h and config.h.in (why both places?)
Actually, in lisp.h we #undef this and then define it again; that's because
there's some C++-specific code in there.
in order to map
valid C identifiers to valid C++ identifiers. However, the
latest gmp headers are C++ aware, and we wind up mapping this
to c_this in C++ code. How should we handle this? Off the
top of my head:
- #undef __cplusplus before #include <gmp.h>
- Remove the #define this c_this, compile with C++ and see what
breaks. Use that information to change all actual instances of
"this" in the XEmacs code to some other name.
Choice #3 is to do what we do in lisp.h.
I'd suggest removing the `#define this c_this' and fixing the problems.
However, I'm pretty sure I tried this before and decided it wouldn't quite
work; maybe the problem is/was that some x11 headers [or something of the
like] have a field called `this'. But I think we should try it again; maybe
we can just put the `this' hackery around the places that need it.