Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: CPP related question on double code (B/W)

Author: Anthony Cozzie

Date: 04:43:30 11/24/03

Go up one level in this thread


On November 24, 2003 at 06:01:30, Reinhard Scharnagl wrote:

>Hello,
>
>I want to use the same source file (using different macros)
>twice to compile a move generator for the black and white
>side. How could this be done CPP _conform_?
>
>This attempt is for to avoid double (redundant) source code
>and its change management synchronizing.
>
>I hope that there are some experts with matching experiences
>on that.
>
>Regards, Reinhard.

I do something similar with my eval, it works like this:

#ifdef ZAPPA_EVAL_PRINT_DEBUG
#define DEBUG_ONLY(a) a
#else
#define DEBUG_ONLY(a) ;
#endif

#define ZAPPA_EVAL_PRINT_DEBUG
#include "z_eval_inline.c"
#undef ZAPPA_EVAL_PRINT_DEBUG
#include "z_eval_inline.c"

#ifdef ZAPPA_EVAL_PRINT_DEBUG
int eval_kingsafety_white_debug(zappa_game g, recursion_block rb, zevp *base)
#else
int eval_kingsafety_white(zappa_game g, recursion_block rb)
#endif

hope this helps,

anthony



This page took 0.01 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.