diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-05-11 12:20:11 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-05-11 12:20:11 +0200 |
commit | 2e501c68a8641a2b3c430b55f13491a9c1c5d0f5 (patch) | |
tree | 49c2748443fe3c1f01108756b647440e0647a11b /dist | |
parent | 161beba6cdb0d91b15ad19fa8b3e51d986203915 (diff) |
Add support for custom allocators
New example: examples/cxx/hybrid/allocator.
Diffstat (limited to 'dist')
32 files changed, 607 insertions, 2 deletions
diff --git a/dist/build/config.make b/dist/build/config.make index b05df1a..e9e7826 100644 --- a/dist/build/config.make +++ b/dist/build/config.make @@ -23,6 +23,8 @@ XSDE_SNPRINTF := $(strip $(XSDE_SNPRINTF)) XSDE_PARSER_VALIDATION := $(strip $(XSDE_PARSER_VALIDATION)) XSDE_SERIALIZER_VALIDATION := $(strip $(XSDE_SERIALIZER_VALIDATION)) XSDE_REUSE_STYLE := $(strip $(XSDE_REUSE_STYLE)) +XSDE_CUSTOM_ALLOCATOR := $(strip $(XSDE_CUSTOM_ALLOCATOR)) +XSDE_DEFAULT_ALLOCATOR := $(strip $(XSDE_DEFAULT_ALLOCATOR)) XSDE_CDR := $(strip $(XSDE_CDR)) XSDE_XDR := $(strip $(XSDE_XDR)) XSDE_POLYMORPHIC := $(strip $(XSDE_POLYMORPHIC)) diff --git a/dist/config/config.make b/dist/config/config.make index fccb68f..95dc46f 100644 --- a/dist/config/config.make +++ b/dist/config/config.make @@ -117,6 +117,24 @@ XSDE_SERIALIZER_VALIDATION := y XSDE_REUSE_STYLE := tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR := n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR := n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/config/config.nmake b/dist/config/config.nmake index 0e4008f..3e23c25 100644 --- a/dist/config/config.nmake +++ b/dist/config/config.nmake @@ -116,6 +116,24 @@ XSDE_SERIALIZER_VALIDATION = y XSDE_REUSE_STYLE = tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR = n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR = n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/evc-4.0/config.nmake b/dist/etc/evc-4.0/config.nmake index 136f281..825c909 100644 --- a/dist/etc/evc-4.0/config.nmake +++ b/dist/etc/evc-4.0/config.nmake @@ -119,6 +119,24 @@ XSDE_SERIALIZER_VALIDATION = y XSDE_REUSE_STYLE = tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR = n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR = n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/iphone/config-device.make b/dist/etc/iphone/config-device.make index c6e8634..8d11943 100644 --- a/dist/etc/iphone/config-device.make +++ b/dist/etc/iphone/config-device.make @@ -124,6 +124,24 @@ XSDE_SERIALIZER_VALIDATION := y XSDE_REUSE_STYLE := tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR := n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR := n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/iphone/config-simulator.make b/dist/etc/iphone/config-simulator.make index afff0a6..48f0652 100644 --- a/dist/etc/iphone/config-simulator.make +++ b/dist/etc/iphone/config-simulator.make @@ -124,6 +124,24 @@ XSDE_SERIALIZER_VALIDATION := y XSDE_REUSE_STYLE := tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR := n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR := n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/lynxos/config-4.2.make b/dist/etc/lynxos/config-4.2.make index 5be4262..d1b1b68 100644 --- a/dist/etc/lynxos/config-4.2.make +++ b/dist/etc/lynxos/config-4.2.make @@ -123,6 +123,24 @@ XSDE_SERIALIZER_VALIDATION := y XSDE_REUSE_STYLE := tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR := n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR := n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/lynxos/config-5.0.make b/dist/etc/lynxos/config-5.0.make index 25a15b2..b61ade3 100644 --- a/dist/etc/lynxos/config-5.0.make +++ b/dist/etc/lynxos/config-5.0.make @@ -123,6 +123,24 @@ XSDE_SERIALIZER_VALIDATION := y XSDE_REUSE_STYLE := tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR := n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR := n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/qnx/config-6.3-gcc-2.95.make b/dist/etc/qnx/config-6.3-gcc-2.95.make index 3211450..1228db2 100644 --- a/dist/etc/qnx/config-6.3-gcc-2.95.make +++ b/dist/etc/qnx/config-6.3-gcc-2.95.make @@ -122,6 +122,24 @@ XSDE_SERIALIZER_VALIDATION := y XSDE_REUSE_STYLE := tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR := n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR := n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/qnx/config-6.3-gcc-3.3.make b/dist/etc/qnx/config-6.3-gcc-3.3.make index e0a84db..fe39d31 100644 --- a/dist/etc/qnx/config-6.3-gcc-3.3.make +++ b/dist/etc/qnx/config-6.3-gcc-3.3.make @@ -122,6 +122,24 @@ XSDE_SERIALIZER_VALIDATION := y XSDE_REUSE_STYLE := tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR := n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR := n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/qnx/config-6.4.make b/dist/etc/qnx/config-6.4.make index 71f40db..33d3658 100644 --- a/dist/etc/qnx/config-6.4.make +++ b/dist/etc/qnx/config-6.4.make @@ -122,6 +122,24 @@ XSDE_SERIALIZER_VALIDATION := y XSDE_REUSE_STYLE := tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR := n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR := n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/vc-8.0/config-max.nmake b/dist/etc/vc-8.0/config-max.nmake index 59d1a1c..07a7c0a 100644 --- a/dist/etc/vc-8.0/config-max.nmake +++ b/dist/etc/vc-8.0/config-max.nmake @@ -120,6 +120,24 @@ XSDE_SERIALIZER_VALIDATION = y XSDE_REUSE_STYLE = tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR = n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR = n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/vc-8.0/config-min.nmake b/dist/etc/vc-8.0/config-min.nmake index bdb9863..1177d58 100644 --- a/dist/etc/vc-8.0/config-min.nmake +++ b/dist/etc/vc-8.0/config-min.nmake @@ -120,6 +120,24 @@ XSDE_SERIALIZER_VALIDATION = y XSDE_REUSE_STYLE = tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR = n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR = n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/vc-9.0/config-max.nmake b/dist/etc/vc-9.0/config-max.nmake index 3a11fe7..6d39a73 100644 --- a/dist/etc/vc-9.0/config-max.nmake +++ b/dist/etc/vc-9.0/config-max.nmake @@ -120,6 +120,24 @@ XSDE_SERIALIZER_VALIDATION = y XSDE_REUSE_STYLE = tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR = n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR = n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/vc-9.0/config-min.nmake b/dist/etc/vc-9.0/config-min.nmake index 9df85b5..337369f 100644 --- a/dist/etc/vc-9.0/config-min.nmake +++ b/dist/etc/vc-9.0/config-min.nmake @@ -120,6 +120,24 @@ XSDE_SERIALIZER_VALIDATION = y XSDE_REUSE_STYLE = tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR = n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR = n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/vxworks/config-5.5.1.make b/dist/etc/vxworks/config-5.5.1.make index 89bf164..df7549e 100644 --- a/dist/etc/vxworks/config-5.5.1.make +++ b/dist/etc/vxworks/config-5.5.1.make @@ -123,6 +123,24 @@ XSDE_SERIALIZER_VALIDATION := y XSDE_REUSE_STYLE := tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR := n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR := n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/vxworks/config-6.4-max.make b/dist/etc/vxworks/config-6.4-max.make index b1b08fd..835ba84 100644 --- a/dist/etc/vxworks/config-6.4-max.make +++ b/dist/etc/vxworks/config-6.4-max.make @@ -135,6 +135,24 @@ XSDE_SERIALIZER_VALIDATION := y XSDE_REUSE_STYLE := tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR := n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR := n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/vxworks/config-6.4-min.make b/dist/etc/vxworks/config-6.4-min.make index 3435c70..2ac5ef3 100644 --- a/dist/etc/vxworks/config-6.4-min.make +++ b/dist/etc/vxworks/config-6.4-min.make @@ -122,6 +122,24 @@ XSDE_SERIALIZER_VALIDATION := y XSDE_REUSE_STYLE := tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR := n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR := n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/vxworks/config-6.7-max.make b/dist/etc/vxworks/config-6.7-max.make index 43731df..30e7347 100644 --- a/dist/etc/vxworks/config-6.7-max.make +++ b/dist/etc/vxworks/config-6.7-max.make @@ -135,6 +135,24 @@ XSDE_SERIALIZER_VALIDATION := y XSDE_REUSE_STYLE := tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR := n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR := n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/etc/vxworks/config-6.7-min.make b/dist/etc/vxworks/config-6.7-min.make index cf8d622..b624c8c 100644 --- a/dist/etc/vxworks/config-6.7-min.make +++ b/dist/etc/vxworks/config-6.7-min.make @@ -122,6 +122,24 @@ XSDE_SERIALIZER_VALIDATION := y XSDE_REUSE_STYLE := tiein +# Set to 'y' if you would like the XSD/e runtime and the generated code +# to perform memory management using custom allocator functions provided +# by your application instead of the standard operator new/delete. Also +# don't forget to use the --custom-allocator option when compiling your +# schemas. See the documentation and examples for more information on +# custom allocators. +# +XSDE_CUSTOM_ALLOCATOR := n + + +# Set to 'y' if you would like to include the default implementation of the +# custom allocator into the XSD/e runtime library. This option is primarily +# useful for testing and only makes sense if XSDE_CUSTOM_ALLOCATOR is set +# to 'y'. +# +XSDE_DEFAULT_ALLOCATOR := n + + # Set to 'y' if you want support for serialization of the C++/Hybrid # object model to the CDR (Common Data Representation) binary format. # This functionality requires the ACE library. diff --git a/dist/examples/cxx/hybrid/allocator/makefile b/dist/examples/cxx/hybrid/allocator/makefile new file mode 100644 index 0000000..d0e2318 --- /dev/null +++ b/dist/examples/cxx/hybrid/allocator/makefile @@ -0,0 +1,81 @@ +root := ../../../.. + +include $(root)/build/cxx/rules.make + +# Build. +# +EXTRA_CPPFLAGS := -I$(root)/libxsde + +EXTRA_XSDFLAGS := --no-stl --no-exceptions --custom-allocator + +ifeq ($(XSDE_ENCODING),iso8859-1) +EXTRA_XSDFLAGS += --char-encoding iso8859-1 +endif + +ifeq ($(XSDE_IOSTREAM),n) +EXTRA_XSDFLAGS += --no-iostream +endif + +ifeq ($(XSDE_LONGLONG),n) +EXTRA_XSDFLAGS += --no-long-long +endif + +ifeq ($(XSDE_PARSER_VALIDATION),n) +EXTRA_XSDFLAGS += --suppress-parser-val +endif + +ifeq ($(XSDE_SERIALIZER_VALIDATION),n) +EXTRA_XSDFLAGS += --suppress-serializer-val +endif + +ifeq ($(XSDE_REUSE_STYLE),mixin) +EXTRA_XSDFLAGS += --reuse-style-mixin +endif + +ifeq ($(XSDE_POLYMORPHIC),y) +EXTRA_XSDFLAGS += --runtime-polymorphic +endif + +driver: driver.o arena.o people.o people-pskel.o people-pimpl.o \ +people-sskel.o people-simpl.o $(root)/libxsde/xsde/libxsde.a + +driver.o: driver.cxx arena.cxx arena.hxx people.hxx people-pimpl.hxx \ +people-simpl.hxx +arena.o: arena.cxx arena.hxx +people.o: people.cxx +people-pskel.o: people-pskel.cxx +people-pimpl.o: people-pimpl.cxx +people-simpl.o: people-simpl.cxx +people-simpl.o: people-simpl.cxx + +.PRECIOUS: %.hxx %.cxx %-pskel.hxx %-pskel.cxx %-pimpl.hxx %-pimpl.cxx \ +%-sskel.hxx %-sskel.cxx %-simpl.hxx %-simpl.cxx + +%.hxx %.cxx %-pskel.hxx %-pskel.cxx %-pimpl.hxx %-pimpl.cxx \ +%-sskel.hxx %-sskel.cxx %-simpl.hxx %-simpl.cxx: %.xsd + $(root)/bin/xsde cxx-hybrid $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--generate-parser --generate-serializer --generate-aggregate $< + + +# Generate. +# +.PHONY: gen +gen: people.hxx + + +# Test. +# +.PHONY: test +test: driver people.xml + ./driver people.xml + +# Clean. +# +.PHONY: clean cleanobj +cleanobj: + rm -f people-pimpl.o people-pskel.o people-simpl.o people-sskel.o \ +people.o driver.o arena.o driver + +clean: cleanobj + rm -f people-pimpl.?xx people-pskel.?xx people-simpl.?xx \ +people-sskel.?xx people.?xx diff --git a/dist/examples/cxx/hybrid/allocator/nmakefile b/dist/examples/cxx/hybrid/allocator/nmakefile new file mode 100644 index 0000000..908dd7e --- /dev/null +++ b/dist/examples/cxx/hybrid/allocator/nmakefile @@ -0,0 +1,77 @@ +root = ..\..\..\.. + +!include $(root)\build\cxx\rules.nmake + +# Build. +# +EXTRA_CPPFLAGS = /I$(root)\libxsde + +EXTRA_XSDFLAGS = --no-stl --no-exceptions --custom-allocator + +!if "$(XSDE_ENCODING)" == "iso8859-1" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --char-encoding iso8859-1 +!endif + +!if "$(XSDE_IOSTREAM)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-iostream +!endif + +!if "$(XSDE_LONGLONG)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --no-long-long +!endif + +!if "$(XSDE_PARSER_VALIDATION)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-parser-val +!endif + +!if "$(XSDE_SERIALIZER_VALIDATION)" == "n" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --suppress-serializer-val +!endif + +!if "$(XSDE_REUSE_STYLE)" == "mixin" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --reuse-style-mixin +!endif + +!if "$(XSDE_POLYMORPHIC)" == "y" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --runtime-polymorphic +!endif + +driver.exe: driver.obj arena.obj people.obj people-pskel.obj people-pimpl.obj \ +people-sskel.obj people-simpl.obj $(root)\libxsde\xsde\xsde.lib + +driver.obj: driver.cxx arena.cxx arena.hxx people.hxx people-pimpl.hxx \ +people-simpl.hxx +arena.obj: arena.cxx arena.hxx +people.obj: people.cxx +people-pskel.obj: people-pskel.cxx +people-pimpl.obj: people-pimpl.cxx +people-sskel.obj: people-sskel.cxx +people-simpl.obj: people-simpl.cxx + +people.cxx people.hxx \ +people-pskel.cxx people-pskel.hxx people-pimpl.cxx people-pimpl.hxx \ +people-sskel.cxx people-sskel.hxx people-simpl.cxx people-simpl.hxx \ +: people.xsd + $(root)\bin\xsde.exe cxx-hybrid $(XSDFLAGS) $(EXTRA_XSDFLAGS) \ +--generate-parser --generate-serializer --generate-aggregate people.xsd + + +# Generate. +# +gen: people.hxx + + +# Test. +# +test: driver.exe people.xml + .\driver.exe people.xml + +# Clean. +# +cleanobj: + -del people-pimpl.obj people-pskel.obj people-simpl.obj \ +people-sskel.obj people.obj driver.obj arena.obj driver.exe + +clean: cleanobj + -del people-pimpl.?xx people-pskel.?xx people-simpl.?xx \ +people-sskel.?xx people.?xx diff --git a/dist/examples/cxx/hybrid/makefile b/dist/examples/cxx/hybrid/makefile index 3a9ddaa..859451b 100644 --- a/dist/examples/cxx/hybrid/makefile +++ b/dist/examples/cxx/hybrid/makefile @@ -2,7 +2,11 @@ root := ../../.. include $(root)/build/config.make -dirs := binary compositors custom +dirs := + +ifeq ($(XSDE_CUSTOM_ALLOCATOR),n) + +dirs += binary compositors custom ifeq ($(XSDE_IOSTREAM),y) ifeq ($(XSDE_EXCEPTIONS),y) @@ -26,6 +30,16 @@ dirs += minimal endif endif +else # XSDE_CUSTOM_ALLOCATOR + +ifeq ($(XSDE_STL),n) +ifeq ($(XSDE_EXCEPTIONS),n) +dirs += allocator +endif +endif + +endif + .PHONY: all $(dirs) diff --git a/dist/examples/cxx/hybrid/nmakefile b/dist/examples/cxx/hybrid/nmakefile index 8bd74e6..45c57ca 100644 --- a/dist/examples/cxx/hybrid/nmakefile +++ b/dist/examples/cxx/hybrid/nmakefile @@ -2,7 +2,11 @@ root = ..\..\.. !include $(root)\build\config.nmake -dirs = binary compositors custom +dirs = + +!if "$(XSDE_CUSTOM_ALLOCATOR)" == "n" + +dirs = $(dirs) binary compositors custom !if "$(XSDE_IOSTREAM)" == "y" !if "$(XSDE_EXCEPTIONS)" == "y" @@ -26,6 +30,17 @@ dirs = $(dirs) minimal !endif !endif +!else # XSDE_CUSTOM_ALLOCATOR + +!if "$(XSDE_STL)" == "n" +!if "$(XSDE_EXCEPTIONS)" == "n" +dirs = $(dirs) allocator +!endif +!endif + +!endif + + all: @for %i in ( $(dirs) ) do \ @cmd /c "echo entering %i && cd %i && $(MAKE) /nologo /f nmakefile" || exit 1 diff --git a/dist/examples/cxx/parser/generated/makefile b/dist/examples/cxx/parser/generated/makefile index 6f77af4..5335819 100644 --- a/dist/examples/cxx/parser/generated/makefile +++ b/dist/examples/cxx/parser/generated/makefile @@ -46,6 +46,10 @@ ifeq ($(XSDE_POLYMORPHIC),y) EXTRA_XSDFLAGS += --runtime-polymorphic endif +ifeq ($(XSDE_CUSTOM_ALLOCATOR),y) +EXTRA_XSDFLAGS += --custom-allocator +endif + library-pdriver: library-pdriver.o library-pskel.o library-pimpl.o $(root)/libxsde/xsde/libxsde.a library-pdriver.o: library-pdriver.cxx library-pimpl.hxx library-pskel.hxx diff --git a/dist/examples/cxx/parser/generated/nmakefile b/dist/examples/cxx/parser/generated/nmakefile index c801757..e505207 100644 --- a/dist/examples/cxx/parser/generated/nmakefile +++ b/dist/examples/cxx/parser/generated/nmakefile @@ -46,6 +46,10 @@ EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --reuse-style-mixin EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --runtime-polymorphic !endif +!if "$(XSDE_CUSTOM_ALLOCATOR)" == "y" +EXTRA_XSDFLAGS = $(EXTRA_XSDFLAGS) --custom-allocator +!endif + library-pdriver.exe: library-pdriver.obj library-pskel.obj library-pimpl.obj $(root)\libxsde\xsde\xsde.lib library-pdriver.obj: library-pdriver.cxx library-pimpl.hxx library-pskel.hxx diff --git a/dist/examples/cxx/parser/makefile b/dist/examples/cxx/parser/makefile index c286089..e0d9974 100644 --- a/dist/examples/cxx/parser/makefile +++ b/dist/examples/cxx/parser/makefile @@ -4,6 +4,8 @@ include $(root)/build/config.make dirs := +ifeq ($(XSDE_CUSTOM_ALLOCATOR),n) + ifneq ($(XSDE_REUSE_STYLE),none) dirs += generated endif @@ -39,6 +41,15 @@ endif endif endif +else # XSDE_CUSTOM_ALLOCATOR + +ifeq ($(XSDE_DEFAULT_ALLOCATOR),y) +ifneq ($(XSDE_REUSE_STYLE),none) +dirs += generated +endif +endif + +endif .PHONY: all $(dirs) diff --git a/dist/examples/cxx/parser/nmakefile b/dist/examples/cxx/parser/nmakefile index 8e88704..a23503d 100644 --- a/dist/examples/cxx/parser/nmakefile +++ b/dist/examples/cxx/parser/nmakefile @@ -4,6 +4,8 @@ root = ..\..\.. dirs = +!if "$(XSDE_CUSTOM_ALLOCATOR)" == "n" + !if "$(XSDE_REUSE_STYLE)" != "none" dirs = $(dirs) generated !endif @@ -39,6 +41,16 @@ dirs = $(dirs) minimal !endif !endif +!else # XSDE_CUSTOM_ALLOCATOR + +!if "$(XSDE_DEFAULT_ALLOCATOR)" == "y" +!if "$(XSDE_REUSE_STYLE)" != "none" +dirs = $(dirs) generated +!endif +!endif + +!endif + all: @for %i in ( $(dirs) ) do \ @cmd /c "echo entering %i && cd %i && $(MAKE) /nologo /f nmakefile" || exit 1 diff --git a/dist/examples/cxx/serializer/makefile b/dist/examples/cxx/serializer/makefile index 7677036..4164240 100644 --- a/dist/examples/cxx/serializer/makefile +++ b/dist/examples/cxx/serializer/makefile @@ -4,6 +4,8 @@ include $(root)/build/config.make dirs := +ifeq ($(XSDE_CUSTOM_ALLOCATOR),n) + ifeq ($(XSDE_STL),y) ifeq ($(XSDE_IOSTREAM),y) ifeq ($(XSDE_EXCEPTIONS),y) @@ -35,6 +37,7 @@ endif endif endif +endif # XSDE_CUSTOM_ALLOCATOR .PHONY: all $(dirs) diff --git a/dist/examples/cxx/serializer/nmakefile b/dist/examples/cxx/serializer/nmakefile index cd87db8..ee2224d 100644 --- a/dist/examples/cxx/serializer/nmakefile +++ b/dist/examples/cxx/serializer/nmakefile @@ -4,6 +4,8 @@ root = ..\..\.. dirs = +!if "$(XSDE_CUSTOM_ALLOCATOR)" == "n" + !if "$(XSDE_STL)" == "y" !if "$(XSDE_IOSTREAM)" == "y" !if "$(XSDE_EXCEPTIONS)" == "y" @@ -35,6 +37,8 @@ dirs = $(dirs) minimal !endif !endif +!endif # XSDE_CUSTOM_ALLOCATOR + all: @for %i in ( $(dirs) ) do \ @cmd /c "echo entering %i && cd %i && $(MAKE) /nologo /f nmakefile" || exit 1 diff --git a/dist/libxsde/xsde/makefile b/dist/libxsde/xsde/makefile index 9d3d1a1..34e026b 100644 --- a/dist/libxsde/xsde/makefile +++ b/dist/libxsde/xsde/makefile @@ -9,8 +9,20 @@ EXTRA_CPPFLAGS := -I.. src := c/expat/xmlparse.c c/expat/xmlrole.c c/expat/xmltok.c src += c/genx/genx.c c/genx/char-props.c +ifeq ($(XSDE_CUSTOM_ALLOCATOR),y) +ifeq ($(XSDE_DEFAULT_ALLOCATOR),y) +src += allocator.c +endif +endif + src += cxx/string.cxx cxx/string-search.cxx cxx/ro-string.cxx cxx/stack.cxx +ifeq ($(XSDE_CUSTOM_ALLOCATOR),y) +ifeq ($(XSDE_EXCEPTIONS),y) +src += cxx/allocator.cxx +endif +endif + ifeq ($(XSDE_ENCODING),iso8859-1) src += cxx/iso8859-1.cxx endif @@ -565,6 +577,12 @@ ifeq ($(XSDE_REUSE_STYLE),none) else @echo $(h)undef XSDE_REUSE_STYLE_NONE >>$@ endif +ifeq ($(XSDE_CUSTOM_ALLOCATOR),y) + @echo $(h)define XSDE_CUSTOM_ALLOCATOR >>$@ +endif +ifeq ($(XSDE_DEFAULT_ALLOCATOR),y) + @echo $(h)define XSDE_DEFAULT_ALLOCATOR >>$@ +endif ifeq ($(XSDE_POLYMORPHIC),y) @echo $(h)define XSDE_POLYMORPHIC >>$@ @echo $(h)define XSDE_PARSER_SMAP_BUCKETS $(XSDE_PARSER_SMAP_BUCKETS)UL >>$@ diff --git a/dist/libxsde/xsde/nmakefile b/dist/libxsde/xsde/nmakefile index b1fd08b..25625a3 100644 --- a/dist/libxsde/xsde/nmakefile +++ b/dist/libxsde/xsde/nmakefile @@ -11,12 +11,24 @@ EXTRA_CPPFLAGS = /I.. src = c\expat\xmlparse.c c\expat\xmlrole.c c\expat\xmltok.c src = $(src) c\genx\genx.c c\genx\char-props.c +!if "$(XSDE_CUSTOM_ALLOCATOR)" == "y" +!if "$(XSDE_DEFAULT_ALLOCATOR)" == "y" +src = $(src) allocator.c +!endif +!endif + src = $(src) \ cxx\string.cxx \ cxx\string-search.cxx \ cxx\ro-string.cxx \ cxx\stack.cxx +!if "$(XSDE_CUSTOM_ALLOCATOR)" == "y" +!if "$(XSDE_EXCEPTIONS)" == "y" +src = $(src) cxx/allocator.cxx +!endif +!endif + !if "$(XSDE_ENCODING)" == "iso8859-1" src = $(src) cxx\iso8859-1.cxx !endif @@ -565,6 +577,12 @@ config.h: !else @echo #undef XSDE_REUSE_STYLE_NONE >>$@ !endif +!if "$(XSDE_CUSTOM_ALLOCATOR)" == "y" + @echo #define XSDE_CUSTOM_ALLOCATOR >>$@ +!endif +!if "$(XSDE_DEFAULT_ALLOCATOR)" == "y" + @echo #define XSDE_DEFAULT_ALLOCATOR >>$@ +!endif !if "$(XSDE_POLYMORPHIC)" == "y" @echo #define XSDE_POLYMORPHIC >>$@ @echo #define XSDE_PARSER_SMAP_BUCKETS $(XSDE_PARSER_SMAP_BUCKETS)UL >>$@ |