This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

portability notes


We have done some things in a possibly non-optimal way,
someone may wish to comment on a better way to do these things?

CVS log entry for our systems says:

* added WSAID_CONNECTEX and LPFN_CONNECTEX definitions for ming 
(nocygwin) target

* now conditionally define EAGAIN in posix compat layer because ming
seems to have it.

The first comment is about Cygwin supplied MinGW support for
Win32 functions. We use these calls, but they're not defined,
so we hacked up our own declarations.

The second issue is that I provided a POSIX portability API for
pure MSVC++ Win32 environment, mainly support for synchronisation
primitives including condition variables etc. For POSIX compatibility
I had to define EAGAIN, which doesn't seem to be supplied in 
Windows headers. Unfortunately, MingW headers under Cygwin do
seem to define it, hence the hack.

Any suggestions how to do this better? The API we're providing
provides threads, events, and other such stuff on multiple
platforms including Linux, Solaris, Win32 native, Cygwin,
Cygwin with -mno-cygwin, MSYS/MinGW (maybe), OSX, BSD, etc.

There is a configure script .. not being used in the current 
hacks.

The EAGAIN hack is this:

// THIS IS SICK but there ain't no other way in C
#define ETIMEDOUT WAIT_TIMEOUT
// looks like EAGAIN is available in minggw, but not in vs sdk.
#ifndef EAGAIN
#define EAGAIN WAIT_TIMEOUT
#endif

and the WSAID_CONNECTEX hack is this:

// cygwin's copy of mswsock.h leaves something to be desired...
#ifndef WSAID_CONNECTEX
typedef 
BOOL
(PASCAL FAR * LPFN_CONNECTEX) (
    IN SOCKET s,
...
#define WSAID_CONNECTEX \           
    {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0

...


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]