In case someone has trouble including export.h [message #29047] |
Tue, 29 January 2002 07:16 |
Ruediger Kupper
Messages: 7 Registered: February 1999
|
Junior Member |
|
|
Hi!
We just ran into a problem with IDL5.5's export.h file, when
including it from a c++ source file:
I tested g++-2.95 and g++-3.0, and both (most annoyingly)
choked on it, due to the following reason:
The original export.h shipping with IDL 5.5 featured a
prototype declaration with a variable named "template". This
choice of name effectively prevents the code from compiling,
when included from C++ code (even when included 'extern "C"
{}').
Solution:
With variable names being arbitrary (all that matters is the
type and order of arguments for defining a proper
prototype), you may feel free to rename it, so as not to
interfere with the C++ compiling process.
The original call was:
extern char *IDL_CDECL IDL_VarMakeTempFromTemplate
IDL_ARG_PROTO((IDL_VPTR template, int type, IDL_StructDefPtr
sdef, IDL_VPTR *res, int zero));
P.S.:
The IDL_ARG_PROTO(...) macro is defined near the beginning
of the file. It acts as a null-filter, reproducing it's
argument. It can be used to completely turn off prototypes
in this file, for compatibility to non-ANSI-compilers. We
could have utilised this by #define-ing IDL_CC_NOT_ANSI,
which also seemed to fix the above mentioned problem. But I
felt this being much more interfering than simply respelling
the name.
Hope that this may be helpful,
regards,
Ruediger.
|
|
|