Fabien Costantini wrote:
> Here's a proposal in the case we decide to keep add_fd with underlying 
> winsock use:
> - make unavailable by default on win32 the add_fd/remove_fd
> - make it available statically only if :
>   USE_FD_WSOCK2 or USE_FD_WSOCK1 is defined at compile time
>  if USE_FD_WSOCK2 is defined we include the winsock2 header, if USE_FD_WSOCK1 
> is used we used the winsock 1 (presently used) header
> 
> Note 1: it would be the responsibility of the 3rd app use and link against
> the appropriate winsock lib if necessary.
> Note 2: not using the USE_WSOCK* compile time variables would not prevent the 
> 3rd party user to use winsock API with a clear non ambiguous impl. choice.

Note: this point is being discussed in STR 1906, For background info
please see <http://www.fltk.org/str.php?L1906>

My answer was (and is):

I don't like the idea of compile time decisions (about availability of library 
functions like add_fd()). FLTK is a library, and compile time decisions should 
only be made, if a particular function is not available at all (or the user 
wants 
to exclude it deliberately). If at all, then there should be a default to use 
wsock2 (but let the application decide differently by initializing a global 
variable), and optionally disable the socket library by explicitly using 
--disable-wsock at configure time (windows only) or similar.

Rationale: FLTK can also be linked as a dll, and deliberately excluding
documented functions should be avoided. Even, if a developer would
not use add_fd() in one program, s/he might use it in another program
that can be linked (statically or via dll) with the same FLTK library.

Additionally, please keep in mind, that socket functions (e.g. select())
are also used in Fl::ready() and maybe more.

Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to