diff options
| author | Bill Spitzak <spitzak@gmail.com> | 2000-04-04 17:57:05 +0000 |
|---|---|---|
| committer | Bill Spitzak <spitzak@gmail.com> | 2000-04-04 17:57:05 +0000 |
| commit | 328a8f8f0dd777bb9a124e6701bf1595b5aff96e (patch) | |
| tree | c5c21271c8280ca526502e9d8bc5568abae3eb68 /src | |
| parent | 6f42bc1a58242305e554cb66b84c570fbcdc5738 (diff) | |
Fixes for Cygwin POSIX emulation layer from Norman Vine.
Requires the symbol __CYGWIN__ to be defined, appears to disable the
special meaning of backslash and colon in file names.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1056 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/filename_absolute.cxx | 12 | ||||
| -rw-r--r-- | src/filename_expand.cxx | 12 | ||||
| -rw-r--r-- | src/filename_ext.cxx | 6 | ||||
| -rw-r--r-- | src/filename_match.cxx | 6 | ||||
| -rw-r--r-- | src/fl_file_chooser.cxx | 14 | ||||
| -rw-r--r-- | src/numericsort.c | 6 | ||||
| -rw-r--r-- | src/scandir.c | 2 | ||||
| -rw-r--r-- | src/scandir_win32.c | 7 |
8 files changed, 34 insertions, 31 deletions
diff --git a/src/filename_absolute.cxx b/src/filename_absolute.cxx index b525fe82e..6bd17d6a0 100644 --- a/src/filename_absolute.cxx +++ b/src/filename_absolute.cxx @@ -1,5 +1,5 @@ // -// "$Id: filename_absolute.cxx,v 1.5 1999/01/13 16:56:05 mike Exp $" +// "$Id: filename_absolute.cxx,v 1.5.2.1 2000/04/04 17:57:03 bill Exp $" // // Filename expansion routines for the Fast Light Tool Kit (FLTK). // @@ -32,7 +32,7 @@ #include <FL/filename.H> #include <stdlib.h> #include <string.h> -#if defined(WIN32) && !defined(CYGNUS) +#if defined(WIN32) && !defined(__CYGWIN__) # include <direct.h> //# define getcwd(a,b) _getdcwd(0,a,b) #else @@ -42,7 +42,7 @@ # endif #endif -#if defined(WIN32) || defined(__EMX__) +#if defined(WIN32) || defined(__EMX__) && !defined(__CYGWIN__) inline int isdirsep(char c) {return c=='/' || c=='\\';} #else #define isdirsep(c) ((c)=='/') @@ -51,7 +51,7 @@ inline int isdirsep(char c) {return c=='/' || c=='\\';} int filename_absolute(char *to,const char *from) { if (isdirsep(*from) || *from == '|' -#if defined(WIN32) || defined(__EMX__) +#if defined(WIN32) || defined(__EMX__) && !defined(__CYGWIN__) || from[1]==':' #endif ) { @@ -65,7 +65,7 @@ int filename_absolute(char *to,const char *from) { a = getenv("PWD"); if (a) strncpy(temp,a,FL_PATH_MAX); else {a = getcwd(temp,FL_PATH_MAX); if (!a) return 0;} -#if defined(WIN32) || defined(__EMX__) +#if defined(WIN32) || defined(__EMX__) && !defined(__CYGWIN__) for (a = temp; *a; a++) if (*a=='\\') *a = '/'; // ha ha #else a = temp+strlen(temp); @@ -92,5 +92,5 @@ int filename_absolute(char *to,const char *from) { } // -// End of "$Id: filename_absolute.cxx,v 1.5 1999/01/13 16:56:05 mike Exp $". +// End of "$Id: filename_absolute.cxx,v 1.5.2.1 2000/04/04 17:57:03 bill Exp $". // diff --git a/src/filename_expand.cxx b/src/filename_expand.cxx index 384d656cb..3b1329d66 100644 --- a/src/filename_expand.cxx +++ b/src/filename_expand.cxx @@ -1,5 +1,5 @@ // -// "$Id: filename_expand.cxx,v 1.4 1999/01/07 19:17:34 mike Exp $" +// "$Id: filename_expand.cxx,v 1.4.2.1 2000/04/04 17:57:03 bill Exp $" // // Filename expansion routines for the Fast Light Tool Kit (FLTK). // @@ -31,13 +31,13 @@ #include <FL/filename.H> #include <stdlib.h> #include <string.h> -#ifdef WIN32 +#if defined(WIN32) && !defined(__CYGWIN__) #else # include <unistd.h> # include <pwd.h> #endif -#if defined(WIN32) || defined(__EMX__) +#if defined(WIN32) || defined(__EMX__) && !defined(__CYGWIN__) static inline int isdirsep(char c) {return c=='/' || c=='\\';} #else #define isdirsep(c) ((c)=='/') @@ -76,7 +76,7 @@ int filename_expand(char *to,const char *from) { if (value) { // substitutions that start with slash delete everything before them: if (isdirsep(value[0])) start = a; -#if defined(WIN32) || defined(__EMX__) +#if defined(WIN32) || defined(__EMX__) && !defined(__CYGWIN__) // also if it starts with "A:" if (value[0] && value[1]==':') start = a; #endif @@ -87,7 +87,7 @@ int filename_expand(char *to,const char *from) { ret++; } else { a = e+1; -#if defined(WIN32) || defined(__EMX__) +#if defined(WIN32) || defined(__EMX__) && !defined(__CYGWIN__) if (*e == '\\') {*e = '/'; ret++;} // ha ha! #endif } @@ -97,5 +97,5 @@ int filename_expand(char *to,const char *from) { } // -// End of "$Id: filename_expand.cxx,v 1.4 1999/01/07 19:17:34 mike Exp $". +// End of "$Id: filename_expand.cxx,v 1.4.2.1 2000/04/04 17:57:03 bill Exp $". // diff --git a/src/filename_ext.cxx b/src/filename_ext.cxx index a0e5056a8..ea086b2a1 100644 --- a/src/filename_ext.cxx +++ b/src/filename_ext.cxx @@ -1,5 +1,5 @@ // -// "$Id: filename_ext.cxx,v 1.4 1999/01/07 19:17:34 mike Exp $" +// "$Id: filename_ext.cxx,v 1.4.2.1 2000/04/04 17:57:03 bill Exp $" // // Filename extension routines for the Fast Light Tool Kit (FLTK). // @@ -32,7 +32,7 @@ const char *filename_ext(const char *buf) { const char *p = buf; for (p=buf; *p; p++) { if (*p == '/') q = 0; -#if defined(WIN32) || defined(__EMX__) +#if defined(WIN32) || defined(__EMX__) && !defined(__CYGWIN__) else if (*p == '\\') q = 0; #endif else if (*p == '.') q = p; @@ -41,5 +41,5 @@ const char *filename_ext(const char *buf) { } // -// End of "$Id: filename_ext.cxx,v 1.4 1999/01/07 19:17:34 mike Exp $". +// End of "$Id: filename_ext.cxx,v 1.4.2.1 2000/04/04 17:57:03 bill Exp $". // diff --git a/src/filename_match.cxx b/src/filename_match.cxx index 60bac1d83..47b8bd299 100644 --- a/src/filename_match.cxx +++ b/src/filename_match.cxx @@ -1,5 +1,5 @@ // -// "$Id: filename_match.cxx,v 1.5 1999/01/07 21:22:28 mike Exp $" +// "$Id: filename_match.cxx,v 1.5.2.1 2000/04/04 17:57:03 bill Exp $" // // Pattern matching routines for the Fast Light Tool Kit (FLTK). // @@ -89,7 +89,7 @@ int filename_match(const char *s, const char *p) { case 0: // end of pattern return !*s; -#ifdef WIN32 +#if defined(WIN32) && !defined(__CYGWIN__) case '\\': // quote next character if (*p) p++; if (*s++ != *(p-1)) return 0; @@ -109,5 +109,5 @@ int filename_match(const char *s, const char *p) { } // -// End of "$Id: filename_match.cxx,v 1.5 1999/01/07 21:22:28 mike Exp $". +// End of "$Id: filename_match.cxx,v 1.5.2.1 2000/04/04 17:57:03 bill Exp $". // diff --git a/src/fl_file_chooser.cxx b/src/fl_file_chooser.cxx index 3847e0c7a..6d616ec04 100644 --- a/src/fl_file_chooser.cxx +++ b/src/fl_file_chooser.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_file_chooser.cxx,v 1.10 1999/01/07 21:22:28 mike Exp $" +// "$Id: fl_file_chooser.cxx,v 1.10.2.1 2000/04/04 17:57:03 bill Exp $" // // File chooser widget for the Fast Light Tool Kit (FLTK). // @@ -247,12 +247,12 @@ void FCB::set(const char* buf) { const char* c = buf; for (bufdirend=0; *c;) switch(*c++) { case '?': case '[': case '*': case '{': ispattern = 1; goto BREAK; -#if defined(WIN32) || defined(__EMX__) +#if defined(WIN32) || defined(__EMX__) && !defined(__CYGWIN__) case '\\': #endif case '/': bufdirend=c-buf; break; } -#if defined(WIN32) || defined(__EMX__) +#if defined(WIN32) || defined(__EMX__) && !defined(__CYGWIN__) if ((!bufdirend) && isalpha(buf[0]) && (buf[1]==':')) bufdirend = 2; #endif BREAK: @@ -305,7 +305,7 @@ void FCB::set(const char* buf) { any = 1; const char* a = (*q)->d_name; const char* b = buf+bufdirend; -#ifdef WIN32 +#if defined(WIN32) && !defined(__CYGWIN__) while (*b && tolower(*a)==tolower(*b)) {a++; b++;} #else while (*b && *a==*b) {a++; b++;} @@ -327,7 +327,7 @@ void FCB::set(const char* buf) { any = 1; const char* a = (*q)->d_name; const char* b = buf+bufdirend; -#ifdef WIN32 +#if defined(WIN32) && !defined(__CYGWIN__) while (*b && tolower(*a)==tolower(*b)) {a++; b++;} #else while (*b && *a==*b) {a++; b++;} @@ -405,7 +405,7 @@ static void tab_cb(Fl_Widget*, void* v) { } } -#if defined(WIN32) || defined(__EMX__) +#if defined(WIN32) || defined(__EMX__) && !defined(__CYGWIN__) // ':' needs very special handling! static inline int isdirsep(char c) {return c=='/' || c=='\\';} #else @@ -622,5 +622,5 @@ char* fl_file_chooser(const char* message, const char* pat, const char* fname) } // -// End of "$Id: fl_file_chooser.cxx,v 1.10 1999/01/07 21:22:28 mike Exp $". +// End of "$Id: fl_file_chooser.cxx,v 1.10.2.1 2000/04/04 17:57:03 bill Exp $". // diff --git a/src/numericsort.c b/src/numericsort.c index 288074da4..99a6eaf58 100644 --- a/src/numericsort.c +++ b/src/numericsort.c @@ -1,5 +1,5 @@ /* - * "$Id: numericsort.c,v 1.10 1999/03/08 14:53:44 mike Exp $" + * "$Id: numericsort.c,v 1.10.2.1 2000/04/04 17:57:04 bill Exp $" * * Numeric sorting routine for the Fast Light Tool Kit (FLTK). * @@ -31,7 +31,7 @@ #include <stdlib.h> #include <sys/types.h> -#ifdef WIN32 +#if defined(WIN32) && !defined(__CYGWIN__) #include <FL/filename.H> #else #if HAVE_DIRENT_H @@ -84,5 +84,5 @@ int numericsort(struct dirent **A, struct dirent **B) { } /* - * End of "$Id: numericsort.c,v 1.10 1999/03/08 14:53:44 mike Exp $". + * End of "$Id: numericsort.c,v 1.10.2.1 2000/04/04 17:57:04 bill Exp $". */ diff --git a/src/scandir.c b/src/scandir.c index b4c23bc0e..5eabafa41 100644 --- a/src/scandir.c +++ b/src/scandir.c @@ -16,7 +16,7 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifdef WIN32 +#if defined(WIN32) && !defined(__CYGWIN__) #include "scandir_win32.c" #else diff --git a/src/scandir_win32.c b/src/scandir_win32.c index 502acd892..fee29d03a 100644 --- a/src/scandir_win32.c +++ b/src/scandir_win32.c @@ -1,5 +1,5 @@ // -// "$Id: scandir_win32.c,v 1.11 1999/01/07 19:17:47 mike Exp $" +// "$Id: scandir_win32.c,v 1.11.2.1 2000/04/04 17:57:04 bill Exp $" // // WIN32 scandir function for the Fast Light Tool Kit (FLTK). // @@ -23,6 +23,7 @@ // Please report all bugs and problems to "fltk-bugs@easysw.com". // +#ifndef __CYGWIN__ // Emulation of posix scandir() call #include <config.h> @@ -97,6 +98,8 @@ int alphasort (struct dirent **a, struct dirent **b) { return strcmp ((*a)->d_name, (*b)->d_name); } +#endif + // -// End of "$Id: scandir_win32.c,v 1.11 1999/01/07 19:17:47 mike Exp $". +// End of "$Id: scandir_win32.c,v 1.11.2.1 2000/04/04 17:57:04 bill Exp $". // |
