[email protected] wrote in fltk.commit:
> Author: fabien
> Date: 2008-08-27 09:53:39 -0700 (Wed, 27 Aug 2008)
> New Revision: 6172
> Log:
> + Added a new optional compile time varaible named USE_WSOCK1 that would
> change the use of the WINSOCK2 libray by default, by the use of Winsock 1
> (also implies the use of winsock.h instead of winsock2.h)
> + Removed one unused ret variable.
[...]
Two comments (embedded):
> Modified: branches/branch-1.3/src/Fl_win32.cxx
> ===================================================================
> --- branches/branch-1.3/src/Fl_win32.cxx 2008-08-26 21:07:32 UTC (rev
> 6171)
> +++ branches/branch-1.3/src/Fl_win32.cxx 2008-08-27 16:53:39 UTC (rev
> 6172)
> @@ -44,7 +44,13 @@
> # include <sys/time.h>
> # include <unistd.h>
> #else
> +# if !defined(USE_WSOCK1)
> +# define WSCK_DLL_NAME "WS2_32.DLL"
> +# include <winsock2.h>
> +#else
> +# define WSCK_DLL_NAME "WSOCK32.DLL"
> # include <winsock.h>
> +# endif
> #endif
The same should be done for src/Fl_win32.cxx.
[...]
> @@ -82,6 +83,10 @@
> static HMODULE get_wsock_mod() {
> if (!s_wsock_mod) {
> s_wsock_mod = LoadLibrary(WSCK_DLL_NAME);
> + if (s_wsock_mod==NULL){
> + fprintf(stderr,"FLTK Lib Error: %s file not found!
> Please check your winsock dll accessibility.\n",WSCK_DLL_NAME);
> + exit(1);
> + }
fprintf(stderr,...) is a bad idea, since windows programs usually don't have
a console window, and windows would discard any output.
Fl::error() would be the supported and _necessary_ method here.
Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev