Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: A question about crafty chess.h

Author: Robert Hyatt

Date: 15:12:04 01/08/03

Go up one level in this thread


On January 08, 2003 at 15:53:45, Dieter Buerssner wrote:

>On January 08, 2003 at 14:55:56, Robert Hyatt wrote:
>
>>On January 08, 2003 at 08:25:06, Uri Blass wrote:
>>
>>>2)chess.h in crafty has the following code
>>>
>>>#if defined(HAS_64BITS)
>>>  typedef unsigned long BITBOARD;
>>>#else
>>>#  if defined(NT_i386) || defined(NT_AXP)
>>>    typedef unsigned __int64 BITBOARD;
>>>#  else
>>>    typedef unsigned long long BITBOARD;
>>>#  endif
>>>#endif
>>>
>>>Do I need all this #if's and in which machines my code is not supposed to work
>>>if I avoid them and simply defined bitboard as unsigned__int64
>>>Noe the problem is to understand chess.h that is a basic file.
>>
>>__int64 is _only_ going to work on microsoft's compiler.
>
>It also works with Borland. Perhaps more.
>
>>It will not work
>>on gcc or any other compiler I know of.  If you have no need to compile with
>>other compilers (gcc, etc) then you can do without the spaghetti code above.
>
>I am also puzzled by the above code snippet. Actually I cannot see, what the
>difference would be to slighly simpler looking:
>
>#if defined(NT_i386) || defined(NT_AXP)
>  typedef unsigned __int64 BITBOARD;
>#else
>  typedef unsigned long long BITBOARD;
>#endif

Since I didn't write all of the "spaghetti" I don't know if that will work or
not.  IE if you
assume that NT means __int64 it might be ok, but remember that there are other
compiler
options for NT, besides MSVC, and that is probably where the extra tests came
from,
although not remembering who ported what to what means I am not sure...




>
>Regards,
>Dieter



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.