[omniORB] Conflict reserved IDL words and CosLifeCycle.idl
Duncan Grisby
dgrisby@uk.research.att.com
Thu, 27 Apr 2000 09:43:11 +0100
On Thursday 27 April, Lars von Wedel wrote:
> yesterday I started an attempt to compile omniEvents using omniORB3,
> pre-release 2. After telling the makefiles about the different
> IDL compiler (and using -WbBOA), I got 2 error messages in
> CosLifeCycle.idl, complaining about the usage of the tokens 'Factory'
> and 'supports'.
Unfortunately, CORBA 2.3 added a number of new keywords to IDL,
including "factory" and "supports". These additions clash with some
existing IDL, including the CosLifeCycle service. To solve the
problem, IDL now has an escape mechanism which uses _ characters.
Where before you had
boolean supports(in Key k);
you should now put
boolean _supports(in Key k);
This prevents supports() clashing with the keyword. As far as C++ (and
Python) is concerned, the operation is still called "supports", so you
don't need to change any client or server code.
If you need to use the same IDL file with both omniORB 3 and omniORB
2, you can use the fact that the new omniidl defines the pre-processor
symbol __OMNIIDL__:
interface GenericFactory {
#ifdef __OMNIIDL__
boolean _supports(in Key k);
#else
boolean supports(in Key k);
#endif
...
};
You should make the similar change to the definition of Factory.
It's ugly, but that's what the CORBA 2.3 spec says.
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --