[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

XS pollution - one less please



Unfortunately current perl (_64 to be) has still

#define bool char

in handy.h which gets included by perl.h

When interfacing to a C++ library,

a function with signature 
void foo(bool)

will be redefined to
void foo(char)

and therefore gets a different (mangled) external name then the
function in the C++ libarary actually meant.

Then either the dynamic load fails because there is no such function
or even worth, the wrong function silently gets called.

There is a workaround 

#ifdef bool
  #define PL_bool bool
  #undef bool
#endif

and then add PL_bool to your (private) typemap
but it's ugly.

Thanks for listening,
Helmut.


-- 
Helmut Jarausch
Lehrstuhl fuer Numerische Mathematik
Institute of Technology, RWTH Aachen
D 52056 Aachen, Germany


[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]