On 13 November 2014 21:57, Dirk Hohndel <[email protected]> wrote: > On Thu, Nov 13, 2014 at 09:50:19PM +0200, Lubomir I. Ivanov wrote: >> On 13 November 2014 21:36, Thiago Macieira <[email protected]> wrote: >> > On Thursday 13 November 2014 21:12:03 Lubomir I. Ivanov wrote: >> >> 2014-11-13 1:27 GMT+02:00 Salvo Tomaselli <[email protected]>: >> >> >> + } else if (access(data->devname, R_OK | W_OK) != 0) >> >> > >> >> > Hm. Now that I think of it. I don't know if this works on Windows… >> >> >> >> access() is part of the Win32 C library, but it needs UTF-16 to work >> >> for non-ASCII paths (_waccess()). >> >> we already do this for a set of functions such as fopen(), rename() >> >> etc, so a new wrapper function subsurface_access() has to be added. >> >> >> >> two patches are attached. >> >> (the second one is just some cleanup) >> >> >> >> another solution would be to not use access(). >> > >> > Hi Lubomir >> > >> > macos.c won't compile, there's an extra ( that isn't closed. >> > >> > Sorry, I can't include the patch code inline because your email listed >> > them as >> > application/octet-stream... >> >> my bad, > > There's also no "io.h" on Linux or Mac ;-) > > access() is in unistd.h >
my bad again, access() is in unistd.h because it's POSIX. Win32 has it in io.h for some reason (or to try to make sense), but looking at MINGW's unistd.h it includes io.h, so it's OK for windows.c to include unistd.h as well. ...until we attempt building with MSVC and fail miserably on many levels. :-) lubomir -- _______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
