#STR2056 partial fixes : wsock API now compiles ok, but there are still all utf8 stuff that won't compile: fl_utf8.cxx, fl_set_fonts_win32.cxx won't compile yet and Fl_Preferences recent utf8 addon should be checked for Cygwin.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6375 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Fabien Costantini 2008-10-04 16:35:58 +00:00
parent c28c0de681
commit fdeb60898e
3 changed files with 14 additions and 5 deletions

View File

@ -43,7 +43,7 @@
# include <locale.h> # include <locale.h>
# include <ctype.h> # include <ctype.h>
# define xchar wchar_t # define xchar wchar_t
# ifndef FL_DLL # if !defined(FL_DLL) && !defined(__CYGWIN__)
# undef strdup # undef strdup
# define strdup _strdup # define strdup _strdup
# undef putenv # undef putenv

View File

@ -655,6 +655,7 @@ Fl_Preferences::RootNode::RootNode( Fl_Preferences *prefs, Root root, const char
} }
#ifndef __CYGWIN__
if (!filename[1] && !filename[0]) { if (!filename[1] && !filename[0]) {
strcpy(filename, "C:\\FLTK"); strcpy(filename, "C:\\FLTK");
} else { } else {
@ -664,7 +665,10 @@ Fl_Preferences::RootNode::RootNode( Fl_Preferences *prefs, Root root, const char
filename[len] = 0; filename[len] = 0;
free(b); 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), snprintf(filename + strlen(filename), sizeof(filename) - strlen(filename),
"/%s/%s.prefs", vendor, application); "/%s/%s.prefs", vendor, application);
for (char *s = filename; *s; s++) if (*s == '\\') *s = '/'; for (char *s = filename; *s; s++) if (*s == '\\') *s = '/';

View File

@ -48,13 +48,16 @@
# include <unistd.h> # include <unistd.h>
#else #else
# if !defined(USE_WSOCK1) # if !defined(USE_WSOCK1)
# define WSCK_DLL_NAME "WS2_32.DLL"
# include <winsock2.h> # include <winsock2.h>
#else #else
# define WSCK_DLL_NAME "WSOCK32.DLL"
# include <winsock.h> # include <winsock.h>
# endif # endif
#endif #endif
#if !defined(USE_WSOCK1)
# define WSCK_DLL_NAME "WS2_32.DLL"
#else
# define WSCK_DLL_NAME "WSOCK32.DLL"
#endif
#include <winuser.h> #include <winuser.h>
#include <commctrl.h> #include <commctrl.h>
@ -87,10 +90,12 @@
*/ */
// dynamic wsock dll handling api: // 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_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_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_async_select_f)(SOCKET,HWND,u_int,long);
//typedef int (WINAPI* fl_wsk_startup_f)(WORD,LPWSADATA);
static HMODULE s_wsock_mod = 0; static HMODULE s_wsock_mod = 0;
static fl_wsk_select_f s_wsock_select=0; static fl_wsk_select_f s_wsock_select=0;
static fl_wsk_fd_is_set_f fl_wsk_fd_is_set=0; static fl_wsk_fd_is_set_f fl_wsk_fd_is_set=0;