[omniORB] Bug in omniORB 2.71? consts and MSVC 6.0
Bill Lowrey
billl@ForeLogic.com
Thu, 22 Apr 1999 18:19:30 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_0001_01BE8CEC.A9F30880
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
I believe I have found a bug in omniORB 2.71relating to the handling of
consts inside class scope.
Example code:
/// foo.idl ///
interface Foo {
const short useLatestVersion = -1;
];
The idl compiler works fine, but the SK file will not compile.
The problem is the definition of the following macros in CORBA_sysdep.h
starting at Line 445. The obvious assumption was that the bug would be fixed
in 6.0. I don't believe it is. 6.0 defines _MSC_VER to be 1200.
#ifndef _init_in_cldecl_
# if !defined(_MSC_VER) || _MSC_VER > 1199
# define _init_in_cldecl_(x) x
# else
# define _init_in_cldecl_(x)
# endif
#else
#error "Name conflict: _init_in_cldecl_ is already defined."
#endif
#ifndef _init_in_cldef_
# if !defined(_MSC_VER) || _MSC_VER > 1199
# define _init_in_cldef_(x)
# else
# define _init_in_cldef_(x) x
# endif
#else
#error "Name conflict: _init_in_cldef_ is already defined."
#endif
If you use the following, the code compiles as it should.
#ifndef _init_in_cldecl_
# if !defined(_MSC_VER) || _MSC_VER > 1299
# define _init_in_cldecl_(x) x
# else
# define _init_in_cldecl_(x)
# endif
#else
#error "Name conflict: _init_in_cldecl_ is already defined."
#endif
#ifndef _init_in_cldef_
# if !defined(_MSC_VER) || _MSC_VER > 1299
# define _init_in_cldef_(x)
# else
# define _init_in_cldef_(x) x
# endif
#else
#error "Name conflict: _init_in_cldef_ is already defined."
#endif
Regards,
Bill Lowrey
billl@forelogic.com
------=_NextPart_000_0001_01BE8CEC.A9F30880
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3612.1706"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2>I=20
believe I have found a bug in omniORB 2.71relating to the handling of =
consts=20
inside class scope.</FONT></SPAN></DIV>
<DIV><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2>Example code:</FONT></SPAN></DIV>
<DIV><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2></FONT></SPAN><SPAN class=3D467430623-22041999><FONT =
color=3D#000000=20
face=3DArial size=3D2>/// foo.idl ///</FONT></SPAN></DIV>
<DIV><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2>interface Foo {</FONT></SPAN></DIV>
<DIV><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2></FONT></SPAN><SPAN class=3D467430623-22041999><FONT =
color=3D#000000=20
face=3DArial size=3D2> const short useLatestVersion =
=3D=20
-1;</FONT></SPAN></DIV>
<DIV><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2></FONT></SPAN><SPAN class=3D467430623-22041999><FONT =
color=3D#000000=20
face=3DArial size=3D2>];</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2>The=20
idl compiler works fine, but the SK file will not =
compile.</FONT></SPAN></DIV>
<DIV><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2></FONT></SPAN><SPAN class=3D467430623-22041999><FONT =
color=3D#000000=20
face=3DArial size=3D2>The problem is the definition of the following =
macros in=20
CORBA_sysdep.h</FONT></SPAN></DIV>
<DIV><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2></FONT></SPAN><SPAN class=3D467430623-22041999><FONT =
color=3D#000000=20
face=3DArial size=3D2>starting at Line 445. The obvious assumption was =
that the bug=20
would be fixed</FONT></SPAN></DIV>
<DIV><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2></FONT></SPAN><SPAN class=3D467430623-22041999><FONT =
color=3D#000000=20
face=3DArial size=3D2>in 6.0. I don't believe it is. 6.0 defines =
_MSC_VER to be=20
1200.</FONT></SPAN></DIV>
<DIV><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2><FONT=20
size=3D2>
<P>#ifndef _init_in_cldecl_<BR># if !defined(_MSC_VER) || _MSC_VER =
>=20
1199<BR># define _init_in_cldecl_(x) x<BR># =20
else<BR># define _init_in_cldecl_(x) <BR># =20
endif<BR>#else<BR>#error "Name conflict: _init_in_cldecl_ is =
already=20
defined."<BR>#endif</P>
<P>#ifndef _init_in_cldef_<BR># if !defined(_MSC_VER) || _MSC_VER =
>=20
1199<BR># define _init_in_cldef_(x)<BR># =20
else<BR># define _init_in_cldef_(x) x <BR># =20
endif<BR>#else<BR>#error "Name conflict: _init_in_cldef_ is already =
defined."<BR>#endif</P>
<P><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2>If you=20
use the following, the code compiles as it should.</FONT></SPAN></P>
<P><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2>#ifndef=20
_init_in_cldecl_<BR># if !defined(_MSC_VER) || _MSC_VER >=20
1299<BR># define _init_in_cldecl_(x) x<BR># =20
else<BR># define _init_in_cldecl_(x) <BR># =20
endif<BR>#else<BR>#error "Name conflict: _init_in_cldecl_ is =
already=20
defined."<BR>#endif</FONT></SPAN></P>
<P><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2>#ifndef=20
_init_in_cldef_<BR># if !defined(_MSC_VER) || _MSC_VER >=20
1299<BR># define _init_in_cldef_(x)<BR># =20
else<BR># define _init_in_cldef_(x) x <BR># =20
endif<BR>#else<BR>#error "Name conflict: _init_in_cldef_ is already =
defined."<BR>#endif</FONT></SPAN></P>
<P><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial=20
size=3D2>Regards,</FONT></SPAN></P>
<P><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2>Bill=20
Lowrey</FONT></SPAN></P>
<P><SPAN class=3D467430623-22041999><FONT color=3D#000000 face=3DArial =
size=3D2><A=20
href=3D"mailto:billl@forelogic.com">billl@forelogic.com</A></FONT></SPAN>=
</P></FONT></FONT></SPAN></DIV></BODY></HTML>
------=_NextPart_000_0001_01BE8CEC.A9F30880--