From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3617 invoked by alias); 8 Mar 2010 16:13:04 -0000 Received: (qmail 3598 invoked by uid 22791); 8 Mar 2010 16:13:03 -0000 X-SWARE-Spam-Status: No, hits=0.1 required=5.0 tests=AWL,BAYES_20,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Mar 2010 16:13:00 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id o28GCvL8002935 for ; Mon, 8 Mar 2010 17:12:57 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms3.u-strasbg.fr [IPv6:2001:660:2402:d::12]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o28GCuMf034964 for ; Mon, 8 Mar 2010 17:12:56 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o28GCuFp003595 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Mon, 8 Mar 2010 17:12:56 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Subject: [RFA] Fix remote-fileio.c compilation for Cygwin 1.5 API Date: Mon, 08 Mar 2010 16:13:00 -0000 Message-ID: <000901cabeda$3cd7bd00$b6873700$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00310.txt.bz2 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 * 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 #ifdef __CYGWIN__ #include /* For cygwin_conv_to_full_posix_path. */ +#include +#if CYGWIN_VERSION_DLL_MAKE_COMBINED(CYGWIN_VERSION_API_MAJOR,CYGWIN_VERSION_API _MINOR) < 181 +#define __USE_OLD_CYGWIN_API_ +#endif + #endif #include +#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;