Re: [RFA] Re: [RFC-v2] Reenable compilation with cygwin 1.5 versions

Christopher Faylor
2010-03-08T22:11:34Z

On Mon, Mar 08, 2010 at 05:02:24PM +0100, Pierre Muller wrote:
>Are these patches OK?

Although I didn't really succed in windows_create_inferior, the goal
here is to reduce the amount of ifdef clutter in the code. So, I'd
propose the below as a slightly less alternative to your version.

cgf

Index: windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-nat.c,v
retrieving revision 1.205
diff -d -u -p -r1.205 windows-nat.c
--- windows-nat.c 6 Mar 2010 19:27:09 -0000 1.205
+++ windows-nat.c 8 Mar 2010 22:08:07 -0000
@@ -122,6 +122,7 @@ static struct target_ops windows_ops;
# define CreateProcess CreateProcessA
# define GetModuleFileNameEx_name "GetModuleFileNameExA"
# define bad_GetModuleFileNameEx bad_GetModuleFileNameExA
+# define CW_SET_DOS_FILE_WARNING -1 /* no-op this for older Cygwin */
# endif
#endif

@@ -706,7 +707,7 @@ windows_make_so (const char *name, LPVOI
SO_NAME_MAX_PATH_SIZE);
else
{
- char *rname = canonicalize_file_name (name);
+ char *rname = realpath (name, NULL);
if (rname && strlen (rname) < SO_NAME_MAX_PATH_SIZE)
{
strcpy (so->so_name, rname);
@@ -1945,6 +1946,8 @@ windows_create_inferior (struct target_o
error (_("Error starting executable: %d"), errno);
cygallargs = (wchar_t *) alloca (len * sizeof (wchar_t));
mbstowcs (cygallargs, allargs, len);
+#else
+ cygallargs = allargs;
#endif
}
else