1
包装C的结构我有一个包含以下类型定义的C头文件:与SWIG
// example.h
typedef struct Vertex {
int color;
} Vertex;
我试着来包装这个结构与痛饮,但显然我做错了什么。我痛饮接口文件看起来像
// example.i
%module example
%inline %{
#include "example.h"
}
但是,如果我在我的头文件中的内容复制到我的接口文件,使后者的样子
%module example
%inline %{
typedef struct Vertex {
int color;
} Vertex;
%}
我可以在Ruby访问结构在以下way
irb> require 'example'
# => true
irb> Examlpe::Vertex
# => Vertex
有没有办法自动换行头文件?我不想在每次更改它时将头文件的内容复制并粘贴到接口文件中。
在此先感谢您的帮助。
- T6D