[omniORB] Reopening namespace - the complete solution
Duncan Grisby
dgrisby@uk.research.att.com
Fri, 18 Feb 2000 09:43:00 +0000
On Friday 18 February, Alex Shabarshoff wrote:
> To solve this problem i'm use this technique:
>
> Add the following to idl file (assuming file is Arbiter.idl and
> namespace PSIT):
[...stripping out the #ifdefs to save space...]
> module PSIT { // here namespace begins
> // some more such includes goes here
> #include "Authentificator.idl"
> }; // here namespace ends
> This works fine even with Sun's idl2java.
Unfortunately, this is wrong, since the repository identifiers of
declarations in Authentificator.idl will not be qualified by PSIT.
If you write
module M {
interface I {};
};
then the repository id of I is IDL:M/I:1.0. However, if you write
// a.idl
module M {
#include "b.idl"
};
// b.idl
interface I {};
then the repository id of I should be IDL:I:1.0. Some IDL compilers
get it wrong, though, and use IDL:M/I:1.0.
It is extremely unwise to use #include within a module.
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --