RE: [RFA] Fix remote-fileio.c compilation for Cygwin 1.5 API

Pierre Muller
2010-03-09T23:50:18Z

Hi Christopher,
> >I just discovered for windows-nat.c
> >
> >See http://sourceware.org/ml/gdb-patches/2010-03/msg00344.html
>
> You're right. My macro was too simple minded. I've checked in your
> change to windows-nat.c. If you want to use that in remote-fileio.c
> that's fine. Or not. It really isn't a big deal either way.
Thanks for the check-in.

OK, here is a new, lighter version of the remote-fileio.c patch...
There is also a small problem remaining for windows-nat.c
(the previous definition of the cygwin_conv_path macro
needs to be removed).

Is this patch OK?

Pierre

2010-03-10 Pierre Muller <muller@ics.u-strasbg.fr>

* remote-fileio.c (cygwin_conv_path): Define macro for old cygwin
API.
* windows-nat.c (cygwin_conv_path): Remove old macro.

Index: remote-fileio.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-fileio.c,v
retrieving revision 1.34
diff -u -p -r1.34 remote-fileio.c
--- remote-fileio.c 1 Mar 2010 09:09:24 -0000 1.34
+++ remote-fileio.c 9 Mar 2010 23:45:48 -0000
@@ -35,6 +35,15 @@
#include <sys/time.h>
#ifdef __CYGWIN__
#include <sys/cygwin.h> /* For
cygwin_conv_to_full_posix_path. */
+#include <cygwin/version.h>
+#if
CYGWIN_VERSION_DLL_MAKE_COMBINED(CYGWIN_VERSION_API_MAJOR,CYGWIN_VERSION_API
_MINOR) < 181
+# define CCP_POSIX_TO_WIN_A 0
+# define CCP_WIN_A_TO_POSIX 2
+# define cygwin_conv_path(op, from, to, size) \
+ (op == CCP_WIN_A_TO_POSIX) ? \
+ cygwin_conv_to_full_posix_path (from, to) : \
+ cygwin_conv_to_win32_path (from, to)
+#endif
#endif
#include <signal.h>

Index: windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-nat.c,v
retrieving revision 1.206
diff -u -p -r1.206 windows-nat.c
--- windows-nat.c 9 Mar 2010 19:10:39 -0000 1.206
+++ windows-nat.c 9 Mar 2010 23:45:49 -0000
@@ -121,7 +121,6 @@ static struct target_ops windows_ops;
(op == CCP_WIN_W_TO_POSIX) ? \
cygwin_conv_to_full_posix_path (from, to) : \
cygwin_conv_to_win32_path (from, to)
-# define cygwin_conv_path(op, from, to, size)
cygwin_conv_to_full_posix_path (from, to)
typedef char cygwin_buf_t;
static DWORD WINAPI (*GetModuleFileNameEx) (HANDLE, HMODULE, LPSTR,
DWORD);
# define STARTUPINFO STARTUPINFOA