On 2/28/2011 5:23 PM, Bruno Haible wrote: > Thanks for the reminder. Three weeks ago, I concentrated on discussing the > support of UCS-4 characters (still working on that). I've added minor tweaks > (especially so as to avoid mixing the Win32 and the Cygwin approach), and > committed this:
Thanks... > +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ > # define WIN32_NATIVE > #endif > -#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined > __EMX__ || defined __DJGPP__ > - /* Win32, Cygwin, OS/2, DOS */ > +#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || > defined __EMX__ || defined __DJGPP__ > + /* Win32, OS/2, DOS */ I'm confused. You told Jan, in a different thread, to be /sure/ to use WIN32_NATIVE throughout his new code, defined as above. Yet here, you repeat the same sequence of conditionals rather than using WIN32_NATIVE. Why? > +# ifdef __CYGWIN__ > + /* The executable is accessible as /proc/<pid>/exe, at least in > + Cygwin >= 1.5. */ > + { > + char *link; > + > + link = xreadlink ("/proc/self/exe"); > + if (link != NULL) > + return link; > + if (executable_fd < 0) > + executable_fd = open ("/proc/self/exe", O_EXEC, 0); > + } > +# endif The comment doesn't match the code. You talk about /proc/<pid>/exe, but use /proc/self/exe... > -#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined > __EMX__ || defined __DJGPP__ > - /* Win32, Cygwin, OS/2, DOS */ > +#if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || > defined __EMX__ || defined __DJGPP__ > + /* Win32, OS/2, DOS */ Same as above (although in this case, relocatable.c, you did not add a new stanza to define WIN32_NATIVE, so obv. you'd have to DO that before you could use it). > +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ > +/* Native Win32 only. > + On Cygwin, it is better to use the Cygwin provided /proc interface, than > + to use native Win32 API and cygwin_conv_to_posix_path, because it supports > + longer file names > + (see <http://cygwin.com/ml/cygwin/2011-01/msg00410.html>). */ Ditto... > -#if !(defined _WIN32 || defined __WIN32__ || defined __CYGWIN__) > +#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) > static bool tried_find_shared_library_fullname; > if (!tried_find_shared_library_fullname) And ditto... -- Chuck