[omniORB] Date: Wed, 25 Mar 1998 10:11:19 -0500

Sai-Lai Lo S.Lo@orl.co.uk
Wed, 25 Mar 1998 17:15:26 GMT


Are you confusing a static within a C++ class with a static in C???

I do not see what is wrong with the stub. By the way, this is done exactly
as specified in the CORBA C++ mapping.



>>>>> Dietmar May writes:

> I am having problems with omniORB 2.5 and "const" declarations.
> This IDL code:

> typedef unsigned long ulong;
> module Dme
> {
> const ulong eEXEC_MODE_ALL  = 7;
> const ulong eEXEC_MODE_AUTO = 4;
> const ulong eEXEC_MODE_PROG = 2;
> const ulong eEXEC_MODE_MAN  = 1;
> };

> generates this in the header:

>   static const CORBA::ULong eEXEC_MODE_ALL;
>   static const CORBA::ULong eEXEC_MODE_AUTO;
>   static const CORBA::ULong eEXEC_MODE_PROG;
>   static const CORBA::ULong eEXEC_MODE_MAN;

> and this in the skeleton source file:

> const CORBA::ULong Dme::eEXEC_MODE_ALL = 7;
> const CORBA::ULong Dme::eEXEC_MODE_AUTO = 4;
> const CORBA::ULong Dme::eEXEC_MODE_PROG = 2;
> const CORBA::ULong Dme::eEXEC_MODE_MAN = 1;

> Unfortunately, since the header file declares these as !!! static !!!, 
> zero'd value constants are being inserted into each source file! and 
> there is no way to resolve the global const definition. This means that 
> code which uses these constants does not, of course, do what is expected.

> Suggestions? About where to look, where to patch the IDL generator?

> Regards,
> Dietmar May
> Object Workshops, Inc.