diff options
Diffstat (limited to 'xsd/xsd/cxx/tree/generator.cxx')
-rw-r--r-- | xsd/xsd/cxx/tree/generator.cxx | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/xsd/xsd/cxx/tree/generator.cxx b/xsd/xsd/cxx/tree/generator.cxx index 5601f4e..3233248 100644 --- a/xsd/xsd/cxx/tree/generator.cxx +++ b/xsd/xsd/cxx/tree/generator.cxx @@ -928,19 +928,16 @@ namespace CXX } } - if (inline_) - { - hxx << "#ifndef XSD_DONT_INCLUDE_INLINE" << endl - << "#include " << ctx.process_include_path (ixx_name) << endl - << "#endif // XSD_DONT_INCLUDE_INLINE" << endl - << endl; - } - hxx << "#include <xsd/cxx/post.hxx>" << endl << endl; // Copy epilogue. // + // Note that it goes before the inline file in case it defines + // something (such as a custom type) which is needed by this file. + // And if something in the epilogue needs something from the inline + // file, then it should be the inline rather than header epilogue. + // hxx << "// Begin epilogue." << endl << "//" << endl; @@ -951,6 +948,14 @@ namespace CXX << "// End epilogue." << endl << endl; + if (inline_) + { + hxx << "#ifndef XSD_DONT_INCLUDE_INLINE" << endl + << "#include " << ctx.process_include_path (ixx_name) << endl + << "#endif // XSD_DONT_INCLUDE_INLINE" << endl + << endl; + } + hxx << "#endif // " << guard << endl; if (show_sloc) @@ -999,6 +1004,9 @@ namespace CXX << "// End prologue." << endl << endl; + ixx << "#include <xsd/cxx/pre.hxx>" << endl + << endl; + // Generate. // { @@ -1006,6 +1014,9 @@ namespace CXX generate_tree_inline (ctx, 1, 0); } + ixx << "#include <xsd/cxx/post.hxx>" << endl + << endl; + // Copy epilogue. // ixx << "// Begin epilogue." << endl |