Skip to content

Commit 335087b

Browse files
committed
build with old librime
1 parent 5819dca commit 335087b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/types.cc

+11-3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ struct COMPAT {
5050
static string get_sync_dir() {
5151
return string(rime_get_api()->get_sync_dir());
5252
}
53+
54+
static string to_path(const std::string &file) {
55+
return file;
56+
}
5357
};
5458

5559
template<typename T>
@@ -73,6 +77,10 @@ struct COMPAT<T, void_t<decltype(std::declval<T>().user_data_dir.string())>> {
7377
T &deployer = Service::instance().deployer();
7478
return deployer.sync_dir.string();
7579
}
80+
81+
static path to_path(const std::string &file) {
82+
return path(file);
83+
}
7684
};
7785

7886
//--- wrappers for Segment
@@ -1217,7 +1225,7 @@ namespace ConfigReg {
12171225
int raw_make(lua_State *L) {
12181226
an<T> config = New<T>();
12191227
if (auto cstr = lua_tostring(L, 1)) {
1220-
config->LoadFromFile(path(cstr));
1228+
config->LoadFromFile(COMPAT::to_path(cstr));
12211229
}
12221230
LuaType<an<T>>::pushdata(L, config);
12231231
return 1;
@@ -1282,10 +1290,10 @@ namespace ConfigReg {
12821290
}
12831291

12841292
bool load_from_file(T &t, const string &f) {
1285-
return t.LoadFromFile(path(f));
1293+
return t.LoadFromFile(COMPAT::to_path(f));
12861294
}
12871295
bool save_to_file(T &t, const string &f) {
1288-
return t.SaveToFile(path(f));
1296+
return t.SaveToFile(COMPAT::to_path(f));
12891297
}
12901298

12911299
static const luaL_Reg funcs[] = {

0 commit comments

Comments
 (0)