Lee Begg wrote:
Hummm..... patch please?
I attached patch which makes it possible to compile libtpproto_cpp for Win32 and Pocket PC. I used Embedded MSVC 4.0 available for free from Microsoft to compile code for Pocket PC. I used MinGW to compile code for Win32.
Few notes:I replaced long long with int64_t, unsigned long long with uint64_t, uint with uint32_t.
In Win32 to close socket you call closesocket() instead of close(). I added #ifdef _WIN32.
Compiler doesn't recognize LL suffix as 64-bit type. And 0 always have type you need. So i just replaced all 0LL's with simple 0.
WinCE platform have no iostream library, so i added #ifdef HAVE_IOSTREAM around uses of cout and cerr.
There is no stdint.h. I had to add #ifdef HAVE_STDINT_H I replaced pthread mutexes with my siple cross-platform implementation.WinCE platform has no sstream. I replaced stringstream with simple strring+string. and added #ifdef HAVE_SSTREAM
Added include of "config.h" everywhere. After you replace long long with int64_t there are many new places where you need it. Anyway i believe it's a bad habit not to include config.h everywhere.
Declaration of variable inside 'for' loop creates it in parent scope. So you can not declare same name twice in function:
for(int i....) .... for(int i...) That is why i had to rename loop variables from i to itcategory and so on. There was some problems with htonq/ntohq, but fortunately it's not used in code. For reference purpose i also attached my manually created config.h.There are some problems with autoconf script in MinGW, which i'm not able to resolve. That is why i had to create makefile and config.h for Win32 manually.
httpssocket, tlssocket, tpssocket aren't used at all.If you see some problems with patch (probably it makes code non-compilable on your platform) just tell me and i will try to fix problems and resend you patch.
--- Sergey
0001-Changes-to-make-it-possible-to-compile-library-on-Wi.patch.bz2
Description: Binary data
#include <windows.h> #include <winsock2.h> typedef unsigned int uint32_t; typedef unsigned __int64 uint64_t; typedef int int32_t; typedef __int64 int64_t;
_______________________________________________ tp-devel mailing list [email protected] http://www.thousandparsec.net/tp/mailman.php/listinfo/tp-devel
