# define STARTUPINFO STARTUPINFOA
#else
# define __PMAX PATH_MAX
-# define __USEWIDE
# define STARTUPINFO STARTUPINFOW
#endif
if (access (name, F_OK) != 0)
{
if (strcasecmp (name, "ntdll.dll") == 0)
-#ifdef __USEWIDE
{
GetSystemDirectoryW (buf, sizeof (buf) / sizeof (wchar_t));
wcscat (buf, L"\\ntdll.dll");
}
-#else
- {
- GetSystemDirectoryA (buf, sizeof (buf) / sizeof (wchar_t));
- strcat (buf, "\\ntdll.dll");
- }
-#endif
}
#endif
windows_process.solibs.emplace_back ();
__PMAX * sizeof (wchar_t)) < 0)
error (_("Error starting executable: %d"), errno);
toexec = real_path;
-#ifdef __USEWIDE
len = mbstowcs (NULL, allargs, 0) + 1;
if (len == (size_t) -1)
error (_("Error starting executable: %d"), errno);
cygallargs = (wchar_t *) alloca (len * sizeof (wchar_t));
mbstowcs (cygallargs, allargs, len);
-#else /* !__USEWIDE */
- cygallargs = allargs;
-#endif
}
else
{
sh = get_shell ();
if (cygwin_conv_path (CCP_POSIX_TO_WIN_W, sh, shell, __PMAX) < 0)
error (_("Error starting executable via shell: %d"), errno);
-#ifdef __USEWIDE
len = sizeof (L" -c 'exec '") + mbstowcs (NULL, exec_file, 0)
+ mbstowcs (NULL, allargs, 0) + 2;
cygallargs = (wchar_t *) alloca (len * sizeof (wchar_t));
swprintf (cygallargs, len, L" -c 'exec %s %s'", exec_file, allargs);
-#else /* !__USEWIDE */
- len = (sizeof (" -c 'exec '") + strlen (exec_file)
- + strlen (allargs) + 2);
- cygallargs = (char *) alloca (len);
- xsnprintf (cygallargs, len, " -c 'exec %s %s'", exec_file, allargs);
-#endif /* __USEWIDE */
toexec = shell;
flags |= DEBUG_PROCESS;
}
infcwd, strlen (inferior_cwd)) < 0)
error (_("Error converting inferior cwd: %d"), errno);
-#ifdef __USEWIDE
args = (wchar_t *) alloca ((wcslen (toexec) + wcslen (cygallargs) + 2)
* sizeof (wchar_t));
wcscpy (args, toexec);
wcscat (args, L" ");
wcscat (args, cygallargs);
-#else /* !__USEWIDE */
- args = (char *) alloca (strlen (toexec) + strlen (cygallargs) + 2);
- strcpy (args, toexec);
- strcat (args, " ");
- strcat (args, cygallargs);
-#endif /* !__USEWIDE */
#ifdef CW_CVT_ENV_TO_WINENV
/* First try to create a direct Win32 copy of the POSIX environment. */