-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port to Windows(MINGW64) #259
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tql!
cp -rfv $gdbus $dst_bin/ | ||
cp -rfv $mingw64_dlls $dst_bin/ | ||
cp -rfv $prefix/lib/gio $dst_lib/ | ||
cp -rfv $prefix/lib/gdk-pixbuf-2.0 $dst_lib/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不太懂 gio 和 gdk-pixbuf 为啥是单独复制的,不能也通过 get_dll 么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gio / gdk-pixbuf-2.0 是目录,下面的 dll 都是动态加载的,ldd 获取不到,其中还有几个不是动态库的文件
if (g_file_test(path, G_FILE_TEST_EXISTS)){ | ||
return path; | ||
suffix = g_build_filename("themes", name, NULL); | ||
if (!suffix){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该不会失败?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以,如果不考虑 allocation failure 的话可以省略
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对于 app 来说,可能考虑了会比较累,不过写了也无妨。
src/lib/path.c
Outdated
path = srn_find_file_in_prefix(prefix, name); | ||
|
||
for (size_t i = 0; i < sizeof(prefix) / sizeof(*prefix) - 1; i++){ | ||
g_free(prefix[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以用 g_strfreev
path = srn_try_to_find_data_file("srain.cfg"); | ||
if (!path){ | ||
path = g_build_filename(g_get_user_config_dir(), PACKAGE, "srain.cfg", NULL); | ||
if (!path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该也不需要判断?
src/lib/self.c
Outdated
@@ -0,0 +1,100 @@ | |||
/* Copyright (C) 2020 Fei Li <lifeibiren@gmail.com> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
只在 path.c 内部用的话可以就写 path.c 里?copyright 加一行就好。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
似乎也有道理,之前纠结了一下到底是放在 path.c 中还是单独抽出来,主要纠结的点是“有没有可能未来会在其它地方用到获取可执行文件所在目录的功能”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个倒是,应该都是 path 相关的,通过 inc/path.h 导出就好?
b964083
to
3ff17e7
Compare
看起来我理解错了,g-strfreev 要求存储 char* 的内存是动态分配的 |
…ht at the executable' location first
…itioned in portable directories
…ect icon showed in the taskbar for MINGW64
3ff17e7
to
0fc4816
Compare
github 居然不能看 force push 的 diff 么? |
可以看的,你点 force-pushed 这个连接就是 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.