Re: mingw cross compilation (Frediano Ziglio)

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Thomas Stover wrote:
> Although this maybe obvious to some, it took some head 
> scratching for me. You have to initialize winsock!! Also add the library
> 
> for winsock when building so "-lsysbdb -lws2_32".

Oh, that sounds like a bug.  Normal Win32 db-lib and ODBC applications
don't need to initialize winsock.  

This could be handled in tds_alloc_context().  It is called by the
initialization functions of all three client libraries.  

One way would be to call, say, WSAEnumProtocols() looking for the error
WSANOTINITIALISED.  If that error is returned, call WSAStartup() and try
again.  If that fails, the function fails.  

Patches welcome!  :-)

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.