Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Fix remote-fileio.c compilation for Cygwin 1.5 API
@ 2010-03-08 16:13 Pierre Muller
  2010-03-08 20:09 ` Daniel Jacobowitz
  0 siblings, 1 reply; 9+ messages in thread
From: Pierre Muller @ 2010-03-08 16:13 UTC (permalink / raw)
  To: gdb-patches

http://sourceware.org/ml/gdb-patches/2010-03/msg00101.html

In order to complete the fix for 1.5 Cygwin API,
we need to fix the compilation failure in
remote-fileio.c source.

Christopher said in a previous email that he
didn't have an opinion about that part.
http://sourceware.org/ml/gdb-patches/2010-03/msg00260.html

I do not really know if there is a specific maintainer for this
file... Could someone (a global maintainr?)
please review this patch?

Pierre 

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

	* remote-fileio.c:
	(__USE_OLD_CYGWIN_API_): New macro, set for
	older cygwin API that does not have cygwin_conv_path.
	(cygwin_conv_path): New static function emulating
	new cygwin API.
	


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	4 Mar 2010 15:06:28 -0000
@@ -35,9 +35,45 @@
 #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 __USE_OLD_CYGWIN_API_
+#endif
+
 #endif
 #include <signal.h>
 
+#ifdef __USE_OLD_CYGWIN_API_
+/* Possible 'what' values in calls to cygwin_conv_path/cygwin_create_path.
*/
+enum
+{
+  CCP_POSIX_TO_WIN_A = 0, /* from is char*, to is char*       */
+  CCP_POSIX_TO_WIN_W,	  /* from is char*, to is wchar_t*    */
+  CCP_WIN_A_TO_POSIX,	  /* from is char*, to is char*       */
+  CCP_WIN_W_TO_POSIX,	  /* from is wchar_t*, to is char*    */
+
+  /* Or these values to the above as needed. */
+  CCP_ABSOLUTE = 0,	  /* Request absolute path (default). */
+  CCP_RELATIVE = 0x100    /* Request to keep path relative.   */
+};
+typedef unsigned int cygwin_conv_path_t;
+
+static ssize_t 
+cygwin_conv_path (cygwin_conv_path_t what, const void *from,
+				 void *to, size_t size)
+{
+  if (size < PATH_MAX) 
+    internal_error (__FILE__,__LINE__, 
+      "string buffer too short in cygwin_conv_path");
+ 
+  if (what == CCP_WIN_A_TO_POSIX) 
+    return cygwin_conv_to_full_posix_path (from, to);
+  else
+    internal_error (__FILE__,__LINE__,"Error in cygwin_conv_path");
+}
+#endif /* __USE_OLD_CYGWIN_API_ */
+
+
 static struct {
   int *fd_map;
   int fd_map_size;


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-03-10 16:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-08 16:13 [RFA] Fix remote-fileio.c compilation for Cygwin 1.5 API Pierre Muller
2010-03-08 20:09 ` Daniel Jacobowitz
2010-03-08 21:49   ` Christopher Faylor
2010-03-08 21:55     ` Daniel Jacobowitz
2010-03-08 23:21     ` Pierre Muller
2010-03-09 19:15       ` Christopher Faylor
2010-03-09 23:50         ` Pierre Muller
2010-03-10 15:57           ` Christopher Faylor
2010-03-10 16:42             ` Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox