[xsd-users] Obscure problem with inlines and custom types.

Boris Kolpackov boris at codesynthesis.com
Tue Jan 27 09:39:03 EST 2009


Hi Bill,

Bill Pringlemeir <bpringle at sympatico.ca> writes:

>    #ifndef XSD_DONT_INCLUDE_INLINE
> 
>    #include "primary.ixx"
> 
>    #endif // XSD_DONT_INCLUDE_INLINE
> 
>    // Begin epilogue.
>    //
>    #include "CompositeWrapper.h"
>    //
>    // End epilogue.

Hm, that's unfortunate. We have all this XSD_DONT_INCLUDE_INLINE
machinery to support schemas with include cycles. The proper
solution would be to undefine this macro in prologues and
epilogues, something along these lines:

#ifdef XSD_DONT_INCLUDE_INLINE
#  undef XSD_DONT_INCLUDE_INLINE
#  define RESTORE_XSD_DONT_INCLUDE_INLINE
#endif

// Begin epilogue.
//
#include "CompositeWrapper.h"
//
// End epilogue.

#ifdef RESTORE_XSD_DONT_INCLUDE_INLINE
#  define XSD_DONT_INCLUDE_INLINE
#endif

We will also probably need to use a header-specific RESTORE_* macro
name to make sure it works when there are several levels of this.
But then, it all looks very ugly so I am not sure we should do this.
Maybe we should analyze the schemas and only use DONT_INCLUDE_INLINE
when it is actually necessary. Then we can go all the way.

BTW, an easier work around would be to include the .ixx file right
after the header in CompositeWrapper.h:

#include "secondary.h"
#include "secondary.ixx"

Thanks for reporting this!

Boris




More information about the xsd-users mailing list