diff options
author | Vicent Marti <tanoku@gmail.com> | 2013-08-13 09:15:39 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2013-08-13 09:15:39 +0200 |
commit | abf3732728d0af42ed7217c7148509c8aa30a7e5 (patch) | |
tree | 068a4aedbc27989e78d6acf14fe638dfcb9bb1cd /src/win32/utf-conv.h | |
parent | 0e26fca1daa11a3108960dee3cb555b4c482ad81 (diff) | |
download | libgit2-abf3732728d0af42ed7217c7148509c8aa30a7e5.tar.gz |
windows: Path conversion with better semantics
Diffstat (limited to 'src/win32/utf-conv.h')
-rw-r--r-- | src/win32/utf-conv.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/win32/utf-conv.h b/src/win32/utf-conv.h index 66422e17c..3cfb3514e 100644 --- a/src/win32/utf-conv.h +++ b/src/win32/utf-conv.h @@ -13,20 +13,19 @@ #define GIT_WIN_PATH_UTF16 (260 + 1) #define GIT_WIN_PATH_UTF8 (260 * 4 + 1) -typedef wchar_t git_win32_path_utf16[GIT_WIN_PATH_UTF16]; -typedef char git_win32_path_utf8[GIT_WIN_PATH_UTF8]; +typedef wchar_t git_win32_path[GIT_WIN_PATH_UTF16]; // dest_size is the size of dest in wchar_t's int git__utf8_to_16(wchar_t * dest, size_t dest_size, const char *src); // dest_size is the size of dest in char's int git__utf16_to_8(char *dest, size_t dest_size, const wchar_t *src); -GIT_INLINE(int) git__win32_path_utf8_to_16(git_win32_path_utf16 dest, const char *src) +GIT_INLINE(int) git__win32_path_from_c(git_win32_path dest, const char *src) { return git__utf8_to_16(dest, GIT_WIN_PATH_UTF16, src); } -GIT_INLINE(int) git__win32_path_utf16_to_8(git_win32_path_utf8 dest, const wchar_t *src) +GIT_INLINE(int) git__win32_path_to_c(char *dest, const git_win32_path *src) { return git__utf16_to_8(dest, GIT_WIN_PATH_UTF8, src); } |