1
我正在嘗試使用SWIG重命名將自動生成的代理Java類test_cache_t.java的名稱更改爲Example.java。我已經嘗試了下面的內容,因爲它可以按照this question的C結構正常工作,但它不適用於C枚舉。有任何想法嗎?我得到了一些警告,不太引起我的問題......如何重命名從C枚舉類型創建的SWIG生成的代理Java類
%module Example
%rename (Example) test_cache_t_;
typedef enum test_cache_t_ {
CACHE_FALSE = 0,
CACHE_TRUE = 1
} test_cache_t;
%{
#include "Example.h"
%}
%include "Example.h"
[exec] /test/include/Example.h:84: Warning 302: Identifier 'test_cache_t' redefined (ignored) (Renamed from 'test_cache_t_'),
[exec] test.i:7: Warning 302: previous definition of 'test_cache_t' (Renamed from 'test_cache_t_').
[exec] /test/include/Example.h:82: Warning 302: Identifier 'CACHE_FALSE' redefined (ignored),
[exec] test.i:5: Warning 302: previous definition of 'CACHE_FALSE'.
[exec] /test/include/Example.h:84: Warning 302: Identifier 'CACHE_TRUE' redefined (ignored),
[exec] test.i:7: Warning 302: previous definition of 'CACHE_TRUE'.
#2是我的問題。我使用「示例」名稱代替真名。 – c12