Merge commit 'v4.3.16'
[xboard.git] / backend.h
index eba5366..840dda3 100644 (file)
--- a/backend.h
+++ b/backend.h
 #ifndef _BACKEND\r
 #define _BACKEND\r
 \r
+/* unsigned int 64 for engine nodes work and display */\r
+#ifdef WIN32\r
+       /* I don't know the name for this type of other compiler\r
+        * If it not work, just modify here\r
+        * This is for MS Visual Studio\r
+        */\r
+       #ifdef _MSC_VER\r
+               #define u64 unsigned __int64\r
+               #define s64 signed __int64\r
+               #define u64Display "%I64u"\r
+               #define s64Display "%I64d"\r
+               #define u64Const(c) (c ## UI64)\r
+               #define s64Const(c) (c ## I64)\r
+       #else\r
+               /* place holder\r
+                * or dummy types for other compiler\r
+                */\r
+               #define u64 unsigned long long\r
+               #define s64 signed long long\r
+               #define u64Display "%llu"\r
+               #define s64Display "%lld"\r
+               #define u64Const(c) (c ## ULL)\r
+               #define s64Const(c) (c ## LL)\r
+       #endif\r
+#else\r
+       /* GNU gcc */\r
+       #define u64 unsigned long long\r
+       #define s64 signed long long\r
+       #define u64Display "%llu"\r
+       #define s64Display "%lld"\r
+       #define u64Const(c) (c ## ull)\r
+       #define s64Const(c) (c ## ll)\r
+#endif\r
+\r
 #include "lists.h"\r
 #include "frontend.h"\r
 \r
@@ -159,6 +193,7 @@ Boolean ParseOneMove P((char *move, int moveNum,
                        int *toX, int *toY, char *promoChar));\r
 char *VariantName P((VariantClass v));\r
 VariantClass StringToVariant P((char *e));\r
+double u64ToDouble P((u64 value));\r
 \r
 char *StrStr P((char *string, char *match));\r
 char *StrCaseStr P((char *string, char *match));\r
@@ -176,6 +211,14 @@ int ToUpper P((int c));
 \r
 extern GameInfo gameInfo;\r
 \r
+/* ICS vars used with backend.c and zippy.c */\r
+#define ICS_GENERIC 0\r
+#define ICS_ICC 1\r
+#define ICS_FICS 2\r
+#define ICS_CHESSNET 3 /* not really supported */\r
+int ics_type;\r
+\r
\r
 \r
 /* pgntags.c prototypes\r
  */\r
@@ -302,7 +345,7 @@ typedef struct {
   int nr_moves;           /* Total nr of root moves */\r
   int moves_left;         /* Moves remaining to be searched */\r
   char move_name[MOVE_LEN];  /* Current move being searched, if provided */\r
-  unsigned long nodes;    /* # of nodes searched */\r
+  u64 nodes;    /* # of nodes searched */\r
   int time;               /* Search time (centiseconds) */\r
   int score;              /* Score (centipawns) */\r
   int got_only_move;      /* If last msg was "(only move)" */\r