Skip to content

Commit 34e7f82

Browse files
committed
Merge pull request git-for-windows#1958 from dscho/ansi-unicode
mingw: safeguard against compiling with `-DUNICODE`
2 parents a270bfd + 07bb682 commit 34e7f82

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

16811681
/* Determine whether or not we are associated to a console */
1682-
cons = CreateFile("CONOUT$", GENERIC_WRITE,
1682+
cons = CreateFileA("CONOUT$", GENERIC_WRITE,
16831683
FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
16841684
FILE_ATTRIBUTE_NORMAL, NULL);
16851685
if (cons == INVALID_HANDLE_VALUE) {
@@ -2344,7 +2344,7 @@ struct passwd *getpwuid(int uid)
23442344
return p;
23452345

23462346
len = sizeof(user_name);
2347-
if (!GetUserName(user_name, &len)) {
2347+
if (!GetUserNameA(user_name, &len)) {
23482348
initialized = 1;
23492349
return NULL;
23502350
}

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)