[omniORB] Identifier `ValueType' clashes with keyword `valuetype'

Duncan Grisby dgrisby@uk.research.att.com
Fri, 23 Feb 2001 15:27:40 +0000


On Friday 23 February, "Michael J. Davis Jr." wrote:

> However, the spec ALSO says that you can prepend an _ to a name that you 
> need/want to use that happens to clash with a keyword.  According to the 
> spec, you could use _ValueType as the name, and when the CORBA 2.3 compliant 
> idl compiler sees that, it generates code for 'ValueType' (without the 
> leading _).

omniidl supports that. If you need to keep your IDL compatible with an
ORB which doesn't understand the _ escapes, put something at the
beginning of the offending IDL file like

  #ifdef __OMNIIDL__
  #define ValueType _ValueType
  #endif

omniidl automatically sets the __OMNIIDL__ define, so you don't need
to do anything else.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --