Skip to content

Commit 236524e

Browse files
committed
Merge pull request #1958 from dscho/ansi-unicode
mingw: safeguard against compiling with `-DUNICODE`
2 parents 208f457 + 3a3f487 commit 236524e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

compat/mingw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen
14351435
do_unset_environment_variables();
14361436

14371437
/* Determine whether or not we are associated to a console */
1438-
cons = CreateFile("CONOUT$", GENERIC_WRITE,
1438+
cons = CreateFileA("CONOUT$", GENERIC_WRITE,
14391439
FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
14401440
FILE_ATTRIBUTE_NORMAL, NULL);
14411441
if (cons == INVALID_HANDLE_VALUE) {
@@ -1985,7 +1985,7 @@ struct passwd *getpwuid(int uid)
19851985
return p;
19861986

19871987
len = sizeof(user_name);
1988-
if (!GetUserName(user_name, &len)) {
1988+
if (!GetUserNameA(user_name, &len)) {
19891989
initialized = 1;
19901990
return NULL;
19911991
}

compat/poll/poll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ win32_compute_revents (HANDLE h, int *p_sought)
150150
if (!once_only)
151151
{
152152
NtQueryInformationFile = (PNtQueryInformationFile)
153-
GetProcAddress (GetModuleHandle ("ntdll.dll"),
153+
GetProcAddress (GetModuleHandleA ("ntdll.dll"),
154154
"NtQueryInformationFile");
155155
once_only = TRUE;
156156
}

compat/winansi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,12 @@ void winansi_init(void)
633633

634634
/* create a named pipe to communicate with the console thread */
635635
xsnprintf(name, sizeof(name), "\\\\.\\pipe\\winansi%lu", GetCurrentProcessId());
636-
hwrite = CreateNamedPipe(name, PIPE_ACCESS_OUTBOUND,
636+
hwrite = CreateNamedPipeA(name, PIPE_ACCESS_OUTBOUND,
637637
PIPE_TYPE_BYTE | PIPE_WAIT, 1, BUFFER_SIZE, 0, 0, NULL);
638638
if (hwrite == INVALID_HANDLE_VALUE)
639639
die_lasterr("CreateNamedPipe failed");
640640

641-
hread = CreateFile(name, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
641+
hread = CreateFileA(name, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
642642
if (hread == INVALID_HANDLE_VALUE)
643643
die_lasterr("CreateFile for named pipe failed");
644644

0 commit comments

Comments
 (0)