c++ patch
Torbjorn Granlund
tege at swox.com
Fri Nov 10 16:50:47 CET 2006
Back in May, Marc Glisse <marc.glisse at normalesup.org> writes:
I attach a patch that I am using. It in particular helps me on
solaris, where I use:
CC=cc
CXX=CC
ABI=32
CXXFLAGS=-library=stlport4
Some cxx tests (t-binary t-ops t-prec t-ternary t-unary) still fail to
compile, but I believe it is because of bugs in the compiler (whereas
what I patched looks like bugs in the code).
A bit more details:
there are a number of missing std:: for c++ use. Since gmp-impl.h is
not installed, it can just use the easy "using namespace std;". For
gmp.h, I did something cleaner (It is better for standard conformance,
but I am not sure it may not hurt some broken c++ compiler).
The typedef in gmpxx.h is because a C linkage function and a C++
linkage function need not look the same I think.
[long patch snipped]
I wonder if we need to support every C++ compiler with gmp.h. If C++
doesn't provide the size_t type, I think we will re-introduce
incompatibilities with those compilers, whenever we hack gmp.h.
Perhaps we should instead declare exactly what gmpxx.h needs from
gmp.h, in gmpxx.h, in a syntax every C++ compiler might understand?
The only thing we need, are prototypes for the C functions used from
gmpxx.h, right?
--
Torbjörn
More information about the gmp-bugs
mailing list