=== modified file 'pybindgen/gccxmlparser.py' --- pybindgen/gccxmlparser.py 2008-07-25 18:05:16 +0000 +++ pybindgen/gccxmlparser.py 2008-07-27 14:51:24 +0000 @@ -193,10 +193,14 @@ def get_type_traits(self, type_info): assert isinstance(type_info, cpptypes.type_t) - debug = False #('int64_t' in type_info.decl_string) + debug = ('SomeEnum' in type_info.decl_string) or ('FooType' in type_info.decl_string) if debug: - print >> sys.stderr, "***** type traits for %r" % (type_info.decl_string, ) + print >> sys.stderr, "-----" + print >> sys.stderr, "***** type traits for %r: %r :::: %r -> artificial=%r" % \ + (type_info.decl_string, type_info, + type_traits.remove_declarated(type_info), + type_traits.remove_declarated(type_info).is_artificial) is_const = False is_reference = False @@ -220,6 +224,8 @@ if type_info is prev_type_info: break + + type_name = normalize_name(type_info.decl_string) try: cpp_type = self.root_module[type_name] @@ -926,6 +932,8 @@ for enum in enums: + print >> sys.stderr, "<<<<|||||>>>>>", str(enum) + global_annotations, param_annotations = \ annotations_scanner.get_annotations(enum.location.file_name, enum.location.line) @@ -1130,6 +1138,8 @@ for alias in module_namespace.typedefs(function=self.location_filter, recursive=False, allow_empty=True): + print >> sys.stderr, "<<<>>>>", str(alias) + ## handle "typedef int Something;" if isinstance(alias.type, cpptypes.int_t): param_cls, dummy_transf = typehandlers.base.param_type_matcher.lookup('int') === modified file 'tests/c-hello/hello.c' --- tests/c-hello/hello.c 2008-06-06 11:39:05 +0000 +++ tests/c-hello/hello.c 2008-07-27 14:03:37 +0000 @@ -91,3 +91,14 @@ return foo; } + +int hello_xpto (struct SomeStruct xto) +{ + return xto.x*xto.y; +} + +int hello_zbr (enum SomeEnum xto) +{ + return xto; +} + === modified file 'tests/c-hello/hello.h' --- tests/c-hello/hello.h 2008-06-06 11:39:05 +0000 +++ tests/c-hello/hello.h 2008-07-27 14:41:47 +0000 @@ -26,6 +26,34 @@ const HelloFoo* hello_foo_get_self (HelloFoo *foo); +struct SomeStruct +{ + int x; + float y; +}; + +enum SomeEnum { + SOME_FOO, + SOME_BAR +}; + +int hello_xpto (struct SomeStruct xto); +int hello_zbr (enum SomeEnum xto); + + +typedef struct { + int x; + float y; +} SomeStruct2; + +typedef enum { + SOME2_FOO, + SOME2_BAR +} SomeEnum2; + +int hello_xpto2 (SomeStruct2 xto); +int hello_zbr2 (SomeEnum2 xto); + #ifdef __cplusplus } === modified file 'tests/wscript' --- tests/wscript 2008-07-20 18:26:00 +0000 +++ tests/wscript 2008-07-27 14:41:35 +0000 @@ -25,6 +25,13 @@ def build(bld): + + ## pure C tests + bld.add_subdirs('c-hello') + + return + + top_srcdir = bld.m_srcnode.abspath() gen = bld.create_obj('command-output') @@ -157,6 +164,3 @@ obj.inst_var = 0 # do not install obj.includes = '.' - ## pure C tests - bld.add_subdirs('c-hello') -