【发布时间】:2011-12-12 15:44:08
【问题描述】:
我的 SWIG 接口文件和我的 sample.h 头文件中具有以下结构。我假设这个结构中的 sockaddr、ios_boolean 和 unsigned char 定义是我得到下面生成的类的原因。如果我知道 ios_boolean 和 unsigned char 映射到 Java 端的类型,有没有办法使用 %apply 来摆脱生成的指针类?我试过 %apply int {ios_boolean};但后来我得到了一个 SWIGTYPE_p_boolean.java。有什么想法吗?
%rename (Sample) sample_details_t_;
typedef struct sample_details_t_ {
ios_boolean is_allowed;
unsigned char mac[11];
} sample_t;
generates:
SWIGTYPE_p_unsigned_char.java
SWIGTYPE_p_ios_boolean.java
例外:
[exec] ewapi_wrap.c:982: error: `true' undeclared (first use in this function)
[exec] ewapi_wrap.c:982: error: (Each undeclared identifier is reported only once
[exec] ewapi_wrap.c:982: error: for each function it appears in.)
[exec] ewapi_wrap.c:982: error: `false' undeclared (first use in this function
【问题讨论】:
标签: swig