def METHOD_NAME(cursor, anonymousUnion=False):
    if not anonymousUnion:
        structs.append(cursor.spelling)
        print("template <class A, class B>\nvoid copy%s(A * dest, B * src)\n{" % cursor.spelling)
    for c in cursor.get_children():
        if c.kind == clang.cindex.CursorKind.UNION_DECL:
            if valid_spelling(c.spelling):
                raise Exception("Cannot handle non anonymous unions")
            copied_union_member = False
            for uc in c.get_children():
                if not valid_spelling(uc.spelling) or uc.kind == clang.cindex.CursorKind.PACKED_ATTR:
                    # Ignore
                    pass
                else:
                    # per default we copy only the first member of a union and warn if there are more
                    # members (declare the other members NOBACKUP)
                    if copied_union_member:
                        print("Warning more than one union member (%s) in anynomous union inside struct %s, consider NOBACKUP statements" % (uc.spelling, cursor.spelling), file=sys.stderr)
                    else:
                        copy_decl(uc, uc.spelling)
                        copied_union_member = True
        elif c.kind == clang.cindex.CursorKind.FIELD_DECL:
            copy_decl(c, c.spelling)
    if not anonymousUnion:
        print("}\n")