Skip to content

Commit 5c65ecc

Browse files
committed
Merge pull request git-for-windows#1958 from dscho/ansi-unicode
mingw: safeguard against compiling with `-DUNICODE`
2 parents c0965c0 + aa9691a commit 5c65ecc

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
@@ -1693,7 +1693,7 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen
16931693
do_unset_environment_variables();
16941694

16951695
/* Determine whether or not we are associated to a console */
1696-
cons = CreateFile("CONOUT$", GENERIC_WRITE,
1696+
cons = CreateFileA("CONOUT$", GENERIC_WRITE,
16971697
FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
16981698
FILE_ATTRIBUTE_NORMAL, NULL);
16991699
if (cons == INVALID_HANDLE_VALUE) {
@@ -2358,7 +2358,7 @@ struct passwd *getpwuid(int uid)
23582358
return p;
23592359

23602360
len = sizeof(user_name);
2361-
if (!GetUserName(user_name, &len)) {
2361+
if (!GetUserNameA(user_name, &len)) {
23622362
initialized = 1;
23632363
return NULL;
23642364
}

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
@@ -629,12 +629,12 @@ void winansi_init(void)
629629

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

637-
hread = CreateFile(name, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
637+
hread = CreateFileA(name, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
638638
if (hread == INVALID_HANDLE_VALUE)
639639
die_lasterr("CreateFile for named pipe failed");
640640

0 commit comments

Comments
 (0)