public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* GetDriveType on gnulib
@ 2012-03-22 17:16 marco atzeri
  2012-03-22 17:37 ` Eric Blake
  0 siblings, 1 reply; 3+ messages in thread
From: marco atzeri @ 2012-03-22 17:16 UTC (permalink / raw)
  To: cygwin

Hi Eric Blake,

this portion of your gnulib code

----------------------------------------------
#ifdef __CYGWIN__
#include <windows.h>
#define ME_REMOTE me_remote
/* All cygwin mount points include `:' or start with `//'; so it
    requires a native Windows call to determine remote disks.  */
static int
me_remote (char const *fs_name, char const *fs_type _GL_UNUSED)
{
     if (fs_name[0] && fs_name[1] == ':')
     {
         char drive[4];
         sprintf (drive, "%c:\\", fs_name[0]);
         switch (GetDriveType (drive))
         {
         case DRIVE_REMOVABLE:
         case DRIVE_FIXED:
         case DRIVE_CDROM:
         case DRIVE_RAMDISK:
             return 0;
         }
     }
     return 1;
}
#endif
-------------------------------------

has been reused on midnight commander 4.8.x , but on cygwin-1.7.11,
the  #include <windows.h> is causing:

   CC     libmcfilemanager_la-mountlist.lo
In file included from 
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/objbase.h:73:0,
                  from 
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/ole2.h:9,
                  from 
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/windows.h:114,
                  from 
/pub/devel/mc/mc-4.8.1.1-1/src/mc-4.8.1.1/src/filemanager/mountlist.c:217:
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/objidl.h:95:3: 
error: expected identifier or '(' before string constant
/pub/devel/mc/mc-4.8.1.1-1/src/mc-4.8.1.1/src/filemanager/mountlist.c:222:53: 
error: expected ';', ',' or ')' before '_GL_UNUSED'
/pub/devel/mc/mc-4.8.1.1-1/src/mc-4.8.1.1/src/filemanager/mountlist.c: 
In function 'read_file_system_list':


idea about the possible culprit ?

Regards
Marco


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: GetDriveType on gnulib
  2012-03-22 17:16 GetDriveType on gnulib marco atzeri
@ 2012-03-22 17:37 ` Eric Blake
  2012-07-08 20:20   ` marco atzeri
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2012-03-22 17:37 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1113 bytes --]

On 03/22/2012 11:15 AM, marco atzeri wrote:
> Hi Eric Blake,
> 
> this portion of your gnulib code
> 
> ----------------------------------------------
> #ifdef __CYGWIN__
> #include <windows.h>
> #define ME_REMOTE me_remote
> /* All cygwin mount points include `:' or start with `//'; so it
>    requires a native Windows call to determine remote disks.  */

Hmm; cygwin has had some improvements since I first wrote this - not the
least of which is that we redid mounting as part of the transition from
1.5.x to 1.7.x; maybe the real solution is to determine if cygwin now
provides indications of a remote mount point that the code is looking
for without having to drop to native function calls, and kill the
<windows.h> include in that case.  It's okay if that still requires the
use of a cygwin-specific function (that is, use of cygwin_internal would
be okay) if that's what it takes.  It may be a few days before I have
time to properly look at fixing this in gnulib, though.

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

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

* Re: GetDriveType on gnulib
  2012-03-22 17:37 ` Eric Blake
@ 2012-07-08 20:20   ` marco atzeri
  0 siblings, 0 replies; 3+ messages in thread
From: marco atzeri @ 2012-07-08 20:20 UTC (permalink / raw)
  To: cygwin

On 3/22/2012 6:36 PM, Eric Blake wrote:
> On 03/22/2012 11:15 AM, marco atzeri wrote:
>> Hi Eric Blake,
>>
>> this portion of your gnulib code
>>
>> ----------------------------------------------
>> #ifdef __CYGWIN__
>> #include <windows.h>
>> #define ME_REMOTE me_remote
>> /* All cygwin mount points include `:' or start with `//'; so it
>>     requires a native Windows call to determine remote disks.  */
>
> Hmm; cygwin has had some improvements since I first wrote this - not the
> least of which is that we redid mounting as part of the transition from
> 1.5.x to 1.7.x; maybe the real solution is to determine if cygwin now
> provides indications of a remote mount point that the code is looking
> for without having to drop to native function calls, and kill the
> <windows.h> include in that case.  It's okay if that still requires the
> use of a cygwin-specific function (that is, use of cygwin_internal would
> be okay) if that's what it takes.  It may be a few days before I have
> time to properly look at fixing this in gnulib, though.
>

ping ?

Marco



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

end of thread, other threads:[~2012-07-08 20:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-22 17:16 GetDriveType on gnulib marco atzeri
2012-03-22 17:37 ` Eric Blake
2012-07-08 20:20   ` marco atzeri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).