Hello, I've investigated this problem a little bit more and have found a solution (patch attached). It looks simple but has driven me crazy.
On 07/26/13 02:35, Jon Trulson wrote:
... So I wonder if something like this would work: __instantiate(Vector<size_t>) #if (sizeof(size_t) != sizeof(unsigned int)) __instantiate(Vector<unsigned int>) #endif ...since we only need it if the two are different sized...?
I'm afraid this won't work because sizeof is unknown to preprocessor. I played around with UINT_MAX and ULONG_MAX but that also doesn't work.Then I found that the size of the types doesn't matter at all. The internal names of the types are important. They are not allowed to be
equal. size_t is typedef from 'unsigned long' on 64bit systems and 'unsigned int' on 32bit systems. 'unsigned long' is ok but 'unsigned int' gives a problem because it is equal to the following instantiation. On OpenBSD size_t is always typedef from 'unsigned long', even on 32bit. That's why the problem doesn't exist under OpenBSD. Finally I adopted the OpenBSD solution to the other platforms. I did it by replacing size_t with 'unsigned long': __instantiate(Vector<unsigned long>) __instantiate(Vector<unsigned int>) Now it runs on all platforms and a preprocessor directive is not even needed. Best Regards, Ulrich -- Ulrich Wilkens Email: m...@uwilkens.de
>From 641bd89d40b01b9d2d35b8f552b61ab234a97287 Mon Sep 17 00:00:00 2001 From: Ulrich Wilkens <m...@uwilkens.de> Date: Tue, 30 Jul 2013 01:47:52 +0200 Subject: [PATCH] avoid identical Vector instantiations. --- cde/programs/nsgmls/parser_inst.m4 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cde/programs/nsgmls/parser_inst.m4 b/cde/programs/nsgmls/parser_inst.m4 index 4c09cb2..2cfd30e 100644 --- a/cde/programs/nsgmls/parser_inst.m4 +++ b/cde/programs/nsgmls/parser_inst.m4 @@ -165,7 +165,7 @@ __instantiate(Vector<NamedResourceTable<Entity> >) __instantiate(Vector<ContentModelAmbiguity>) __instantiate(Vector<Transition>) __instantiate(Vector<LeafContentToken*>) -__instantiate(Vector<size_t>) +__instantiate(Vector<unsigned long>) __instantiate(Vector<unsigned int>) __instantiate(NamedTable<Id>) -- 1.7.8
------------------------------------------------------------------------------ Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________ cdesktopenv-devel mailing list cdesktopenv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel