-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Well, we had to enter CRT territory at one point.
- Loading branch information
Showing
7 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Win32 UTF-8 wrapper | ||
* | ||
* ---- | ||
* | ||
* C runtime functions. | ||
*/ | ||
|
||
#include "win32_utf8.h" | ||
|
||
// Yes, this should better be implemented as a wrapper around fopen_s() (and | ||
// thus, _wfopen_s()), but XP's msvcrt.dll doesn't have that function. | ||
_Check_return_ FILE * __cdecl fopen_u( | ||
_In_z_ const char * _Filename, | ||
_In_z_ const char * _Mode | ||
) | ||
{ | ||
FILE *ret = NULL; | ||
WCHAR_T_DEC(_Filename); | ||
WCHAR_T_DEC(_Mode); | ||
WCHAR_T_CONV(_Filename); | ||
WCHAR_T_CONV(_Mode); | ||
ret = _wfopen(_Filename_w, _Mode_w); | ||
WCHAR_T_FREE(_Filename); | ||
WCHAR_T_FREE(_Mode); | ||
return ret; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Win32 UTF-8 wrapper | ||
* | ||
* ---- | ||
* | ||
* C runtime functions. | ||
*/ | ||
|
||
#pragma once | ||
|
||
_Check_return_ FILE * __cdecl fopen_u( | ||
_In_z_ const char * _Filename, | ||
_In_z_ const char * _Mode | ||
); | ||
#undef fopen | ||
#define fopen fopen_u |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters