I made a quick pass at trying to modify mongoose so it will compile and run under Windows with VS2008. It is clear you haven't finished the Windows-specific code, but I did see some issues you might want to address before you go much further.
VS2008 uses 64-bit time as default. This will break logic since you assume the time-related structures are all 32-bits. The _USE_32BIT_TIME_T will force compiler & linker to use 32-bit time. MSFT also gives you several flavors of stat function based on whether or not you want 32 or 64-bit structures. VS2008 throws out warnings with the current code saying you are comparing 32-bit with 64-bit numbers. Structures such as ones returned by stat function will definitely break with your current source code on WIN64 platforms. Also look at the file-related functions like seek so you handle 64-bit file systems. On Win64 platforms, datatypes SOCKET is UINT_PTR, a 64-bit value. So when you test for (sock != -1) on such a platform then it won't necessarily work .... The MSDN way of testing for invalid sockets is below #if defined (_WIN32) || defined (_UNIX) #define MY_SOCK_ERROR INVALID_SOCKET /* Socket not valid/init'd*/ typedef SOCKET MY_SOCKID; /* Socket Id */ #else #define MY_SOCK_ERROR -1 /* Socket not valid/init'd */ typedef int MY_SOCKID; /* Socket Id */ #endif /* defined (_WIN32) */ if (sock == MY_SOCK_ERR) goto fail; If you prefer this stuff stay off the list to keep traffic down, then let me know. David ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ shttpd-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/shttpd-general
