Dann Corbit wrote:
You have no shot to compile it with VC++ without doing a big conversion.
It isn't big. It does not even involve a "conversion".
1. cast all calls to malloc() with the target type. there is just 3 or 4 of these.
2. wrap with #ifndef _MSC_VER (or remove) the line #include <strings.h>
3. in compatibility.h, add the following lines under the _MSC_VER section:
typedef __int64 int64_t;
#define PRIu64 "%I64u"
#define PRIx64 "%I64x"
#define INT32_MAX INT_MAX
#define INT64_MAX _I64_MAX
#include <time.h>
int gettimeofday(struct timeval *tv, struct timezone *tz){clock_t c=clock();tv->tv_sec=c/1000;tv->tv_usec=(c%1000)*1000;return 0;}
#define snprintf _snprintf
4. in eval_pieces.c, define 'file_t file' and 'int rrank' at the start of the function instead of before its use.
5. in hash.c, add "={}" to the declaration of piece_random, castle_random and enpassant_random
that's it! now compile "as C++" (-TP option).
cl -Oxt -W0 -TP *.c
btw, the gettimeofday above is not correct. the engine is not looking for the time of day anyway - but just some timer. so, that is what is provided here in a compact form.