summaryrefslogtreecommitdiff
path: root/src/win32/utf-conv.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-08-13 09:45:56 -0700
committerRussell Belfer <rb@github.com>2013-08-13 09:45:56 -0700
commit841034a35ee34190fa1cc136acccfa1a4abaed39 (patch)
tree1b2a1d4a7a7070b513d6b75b9d07ccfd95477134 /src/win32/utf-conv.h
parentd4cff0cb1caac8c2c2cabbab9d3301f99b5ee230 (diff)
downloadlibgit2-841034a35ee34190fa1cc136acccfa1a4abaed39.tar.gz
Reintroduce type for UTF8 win32 path conversions
Diffstat (limited to 'src/win32/utf-conv.h')
-rw-r--r--src/win32/utf-conv.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/win32/utf-conv.h b/src/win32/utf-conv.h
index 1d008dba5..3af77580e 100644
--- a/src/win32/utf-conv.h
+++ b/src/win32/utf-conv.h
@@ -4,13 +4,12 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+#ifndef INCLUDE_git_utfconv_h__
+#define INCLUDE_git_utfconv_h__
#include <wchar.h>
#include "common.h"
-#ifndef INCLUDE_git_utfconv_h__
-#define INCLUDE_git_utfconv_h__
-
/* Maximum characters in a Windows path plus one for NUL byte */
#define GIT_WIN_PATH_UTF16 (260 + 1)
@@ -19,6 +18,8 @@
typedef wchar_t git_win32_path[GIT_WIN_PATH_UTF16];
+typedef char git_win32_path_as_utf8[GIT_WIN_PATH_UTF8];
+
/* 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 */
@@ -29,7 +30,7 @@ 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_to_c(char *dest, const git_win32_path src)
+GIT_INLINE(int) git_win32_path_to_c(git_win32_path_as_utf8 dest, const wchar_t *src)
{
return git__utf16_to_8(dest, GIT_WIN_PATH_UTF8, src);
}