diff options
author | Xin LI <delphij@FreeBSD.org> | 2015-03-31 07:08:00 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2015-03-31 07:08:00 +0000 |
commit | 1e0f9c5aadd2d4f1f7f5a237c4daaafd77235e75 (patch) | |
tree | 78917bf49ceac628433c2677aa29dda7b28d1619 /chinese/opencc/files/patch-src_utils.c | |
parent | Fix madsonic rc script. I should have made an end-to-end test when I converted (diff) |
Major update to libpinyin, fcitx and their add ons:
- New port: chinese/brise Rime schema repository
- Update chinese/fcitx to 4.2.8.5.
- Update chinese/fcitx-chewing to 0.2.2.
- Update chinese/fcitx-cloudpinyin to 0.3.4.
- Update chinese/fcitx-configtool to 0.4.8.
- Update chinese/fcitx-libpinyin to 0.3.1.
- Update chinese/fcitx-rime to 0.3.1.
- Update chinese/fcitx-sunpinyin to 0.4.1.
- Update chinese/fcitx-table-extra to 0.3.7.
- Add LICENSE and update website (mainly move off Google Code)
for various ports.
- Update chinese/libpinyin to 1.1.0.
- Update chinese/librime to 1.1.
- Update chinese/opencc to 0.4.3.
- Update japanese/fcitx-anthy to 0.2.1.
- New port: japanese/fcitx-skk SKK support for Fcitx
- Update korean/fcitx-hangul to 0.3.0.
- Update textproc/fcitx-m17n to 0.2.3.
PR: ports/198743
Submitted by: maintainer, hiroto.kagotani@gmail.com, delphij
Diffstat (limited to 'chinese/opencc/files/patch-src_utils.c')
-rw-r--r-- | chinese/opencc/files/patch-src_utils.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/chinese/opencc/files/patch-src_utils.c b/chinese/opencc/files/patch-src_utils.c new file mode 100644 index 000000000000..855c3c8525f2 --- /dev/null +++ b/chinese/opencc/files/patch-src_utils.c @@ -0,0 +1,46 @@ +--- src/utils.c.orig 2014-04-07 11:37:35.909060780 -0400 ++++ src/utils.c 2014-04-07 11:53:24.429168115 -0400 +@@ -19,6 +19,11 @@ + #include "utils.h" + #include <unistd.h> + ++#ifdef __FreeBSD__ ++ #include <sys/types.h> ++ #include <sys/sysctl.h> ++#endif ++ + #ifdef __APPLE__ + #include "TargetConditionals.h" + #ifdef TARGET_OS_MAC +@@ -95,14 +100,19 @@ const char* executable_path(void) { + static int calculated = 0; + + if (!calculated) { +-#ifdef __linux ++#if defined(__linux) + ssize_t res = readlink("/proc/self/exe", path_buffer, sizeof(path_buffer)); + assert(res != -1); +-#elif __APPLE__ ++#elif defined(__FreeBSD__) ++ int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; ++ size_t size = sizeof(path_buffer); ++ int res = sysctl(mib, 4, path_buffer, &size, NULL, 0); ++ assert(res == 0); ++#elif defined(__APPLE__) + uint32_t size = sizeof(path_buffer); + int res = _NSGetExecutablePath(path_buffer, &size); + assert(res == 0); +-#elif _WIN32 || _WIN64 ++#elif defined(_WIN32) || defined(_WIN64) + // NOTE: for "C:\\opencc.exe" on Windows, the returned path "C:" is + // incorrect until a '/' is appended to it later in try_open_file() + DWORD res = GetModuleFileNameA(NULL, path_buffer, PATH_BUFFER_SIZE); +@@ -110,7 +120,7 @@ const char* executable_path(void) { + #else + /* Other unsupported os */ + assert(0); +-#endif /* ifdef __linux */ ++#endif /* if defined(__linux) */ + char* last_sep = strrchr(path_buffer, PATH_SEPARATOR); + assert(last_sep != NULL); + *last_sep = '\0'; |