On Wednesday, 11 December 2013 at 23:27:57 UTC, Gary Willoughby wrote:
On Wednesday, 11 December 2013 at 23:12:39 UTC, bearophile wrote:
Adam D. Ruppe:

Nested structs and unions like in your example are supported in D too, same syntax, same effect.

But don't forget to add to use "static struct" instad of "struct".

Bye,
bearophile

Have you got an example because i always get:

tcl.d(713): Error: no identifier for declarator twoPtrValue
tcl.d(718): Error: no identifier for declarator ptrAndLongRep
tcl.d(719): Error: no identifier for declarator internalRep

Like this perhaps:

struct Tcl_Obj
{
    int refCount;
    char* bytes;
    int length;
    Tcl_ObjType* typePtr;

    static union internalRep
        {
                c_long longValue;
                double doubleValue;
                void* otherValuePtr;
                Tcl_WideInt wideValue;

                static struct twoPtrValue
                {
                        void* ptr1;
                        void* ptr2;
                }

                static struct ptrAndLongRep
                {
                        void* ptr;
                        c_ulong value;
                }
    }
}

Reply via email to