diff options
Diffstat (limited to 'xsde/cxx/serializer/generator.cxx')
-rw-r--r-- | xsde/cxx/serializer/generator.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/xsde/cxx/serializer/generator.cxx b/xsde/cxx/serializer/generator.cxx index 92e5197..5c94c98 100644 --- a/xsde/cxx/serializer/generator.cxx +++ b/xsde/cxx/serializer/generator.cxx @@ -123,6 +123,7 @@ namespace CXX extern Key generate_polymorphic = "generate-polymorphic"; extern Key runtime_polymorphic = "runtime-polymorphic"; extern Key suppress_reset = "suppress-reset"; + extern Key custom_allocator = "custom-allocator"; extern Key generate_empty_impl = "generate-empty-impl"; extern Key generate_test_driver = "generate-test-driver"; extern Key force_overwrite = "force-overwrite"; @@ -243,6 +244,11 @@ namespace CXX << " Suppress the generation of serializer reset code." << endl; + e << "--custom-allocator" << endl + << " Generate code that uses custom allocator functions\n" + << " instead of operator new/delete." + << endl; + e << "--generate-empty-impl" << endl << " Generate a sample serializer implementation with\n" << " empty function bodies." @@ -1382,6 +1388,25 @@ namespace CXX << endl; } + if (ops.value<CLI::custom_allocator> ()) + { + hxx << "#ifndef XSDE_CUSTOM_ALLOCATOR" << endl + << "#error the generated code uses custom allocator while " << + "the XSD/e runtime does not (reconfigure the runtime or " << + "remove --custom-allocator)" << endl + << "#endif" << endl + << endl; + } + else + { + hxx << "#ifdef XSDE_CUSTOM_ALLOCATOR" << endl + << "#error the XSD/e runtime uses custom allocator while " << + "the generated code does not (reconfigure the runtime or " << + "add --custom-allocator)" << endl + << "#endif" << endl + << endl; + } + // // |