diff --git a/FL/fl_utf8.h b/FL/fl_utf8.h index 494519428..74d893893 100644 --- a/FL/fl_utf8.h +++ b/FL/fl_utf8.h @@ -43,7 +43,7 @@ # include # include # define xchar wchar_t -# ifndef FL_DLL +# if !defined(FL_DLL) && !defined(__CYGWIN__) # undef strdup # define strdup _strdup # undef putenv diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index 3cd1df5a0..92037dad8 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -655,6 +655,7 @@ Fl_Preferences::RootNode::RootNode( Fl_Preferences *prefs, Root root, const char } +#ifndef __CYGWIN__ if (!filename[1] && !filename[0]) { strcpy(filename, "C:\\FLTK"); } else { @@ -664,7 +665,10 @@ Fl_Preferences::RootNode::RootNode( Fl_Preferences *prefs, Root root, const char filename[len] = 0; free(b); } - +#else +#warning CHECKME (Cygwin) this should probably be UTF8 aware as well + if (!filename[0]) strcpy(filename, "C:\\FLTK"); +#endif snprintf(filename + strlen(filename), sizeof(filename) - strlen(filename), "/%s/%s.prefs", vendor, application); for (char *s = filename; *s; s++) if (*s == '\\') *s = '/'; diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index e3cf9e83b..400dfce48 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -48,13 +48,16 @@ # include #else # if !defined(USE_WSOCK1) -# define WSCK_DLL_NAME "WS2_32.DLL" # include #else -# define WSCK_DLL_NAME "WSOCK32.DLL" # include # endif #endif +#if !defined(USE_WSOCK1) +# define WSCK_DLL_NAME "WS2_32.DLL" +#else +# define WSCK_DLL_NAME "WSOCK32.DLL" +#endif #include #include @@ -87,10 +90,12 @@ */ // dynamic wsock dll handling api: +#if defined(__CYGWIN__) && !defined(SOCKET) +# define SOCKET int +#endif typedef int (WINAPI* fl_wsk_select_f)(int, fd_set*, fd_set*, fd_set*, const struct timeval*); typedef int (WINAPI* fl_wsk_fd_is_set_f)(SOCKET, fd_set *); typedef int (WINAPI* fl_wsk_async_select_f)(SOCKET,HWND,u_int,long); -//typedef int (WINAPI* fl_wsk_startup_f)(WORD,LPWSADATA); static HMODULE s_wsock_mod = 0; static fl_wsk_select_f s_wsock_select=0; static fl_wsk_fd_is_set_f fl_wsk_fd_is_set=0;