[omniORB] #include in .IDL file works incorrectly!!!

David Morgenlender dmorgen@alum.mit.edu
Thu, 14 Jan 1999 21:20:33 GMT


I'm trying to #include a .H file into my .IDL file.  But the IDL compiler=
 is
having problems:

1.  If I do the #include within an interface, I get a "can't parse =
statement"
error & the compiler (omniidl2) crashes with a system exception. =20

2.  So, for testing purposes, I moved the #include outside any interface =
& tried
again.  I preceded the #include with a typedef statement, defining a type=
 used
by the .H file.  This compiled without error, but generated incorrect =
code, e.g.
in the .HH file:

  a.  The #include statement is put at the front of the .HH file, while =
the
typedef is placed later, AFTER the #include, which requires it.

  b.  The #include is for x.HH, when it should be for x.H.

How can I get the IDL compiler to do what I need, which is handle a =
struct
defined within an interface, via a .H file, placing a typedef before the =
struct?

BTW, here's why I'm doing things this way ... I use the same struct in =
different
apps, some of which use CORBA, some of which use COM, & some of which use=
 both.
The variables within the struct are carefully used so they generate =
compatible
data for both CORBA & COM, assuming the typedef mentioned above is =
defined
appropriately in both CORBA & COM .IDL files.  I desperately want to =
avoid
having to define 2 different structs for CORBA & COM ... this is a very =
large
struct!!! =20

So I'm #include'ing one .H into both my CORBA & COM IDL files.  I want to=
 do
this within an interface, so the struct typedef is essentially given a =
different
name for CORBA than for COM, since one app will have both definitions.

If the CORBA IDL compiler cannot be made to work with this approach, can =
you
suggest something better???

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
Dave Morgenlender
e-mail: dmorgen@alum.mit.edu
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D