/// lsb()/msb() finds the least/most significant bit in a nonzero bitboard.
/// pop_lsb() finds and clears the least significant bit in a nonzero bitboard.
-#if !defined(USE_BSFQ)
+#ifndef USE_BSFQ
Square lsb(Bitboard b) { return BSFTable[bsf_index(b)]; }
return (Square)(result + MS1BTable[b32]);
}
-#endif // !defined(USE_BSFQ)
+#endif // ifndef USE_BSFQ
/// Bitboards::print() prints a bitboard in an easily readable format to the
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(BITBOARD_H_INCLUDED)
+#ifndef BITBOARD_H_INCLUDED
#define BITBOARD_H_INCLUDED
#include "types.h"
/// lsb()/msb() finds the least/most significant bit in a nonzero bitboard.
/// pop_lsb() finds and clears the least significant bit in a nonzero bitboard.
-#if defined(USE_BSFQ)
+#ifdef BSFQ
# if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
return s;
}
-#else // if !defined(USE_BSFQ)
+#else // if defined(USE_BSFQ)
extern Square msb(Bitboard b);
extern Square lsb(Bitboard b);
#endif
-#endif // !defined(BITBOARD_H_INCLUDED)
+#endif // #ifndef BITBOARD_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(BITCOUNT_H_INCLUDED)
+#ifndef BITCOUNT_H_INCLUDED
#define BITCOUNT_H_INCLUDED
#include <cassert>
template<>
inline int popcount<CNT_HW_POPCNT>(Bitboard b) {
-#if !defined(USE_POPCNT)
+#ifndef USE_POPCNT
assert(false);
return b != 0; // Avoid 'b not used' warning
#endif
}
-#endif // !defined(BITCOUNT_H_INCLUDED)
+#endif // #ifndef BITCOUNT_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(BOOK_H_INCLUDED)
+#ifndef BOOK_H_INCLUDED
#define BOOK_H_INCLUDED
#include <fstream>
std::string fileName;
};
-#endif // !defined(BOOK_H_INCLUDED)
+#endif // #ifndef BOOK_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(ENDGAME_H_INCLUDED)
+#ifndef ENDGAME_H_INCLUDED
#define ENDGAME_H_INCLUDED
#include <map>
{ return eg = map(eg).count(key) ? map(eg)[key] : NULL; }
};
-#endif // !defined(ENDGAME_H_INCLUDED)
+#endif // #ifndef ENDGAME_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(EVALUATE_H_INCLUDED)
+#ifndef EVALUATE_H_INCLUDED
#define EVALUATE_H_INCLUDED
#include "types.h"
}
-#endif // !defined(EVALUATE_H_INCLUDED)
+#endif // #ifndef EVALUATE_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(MATERIAL_H_INCLUDED)
+#ifndef MATERIAL_H_INCLUDED
#define MATERIAL_H_INCLUDED
#include "endgame.h"
}
-#endif // !defined(MATERIAL_H_INCLUDED)
+#endif // #ifndef MATERIAL_H_INCLUDED
#include "misc.h"
#include "thread.h"
-#if defined(__hpux)
+#ifdef __hpux
# include <sys/pstat.h>
#endif
int cpu_count() {
-#if defined(_WIN32)
+#ifdef _WIN32
SYSTEM_INFO s;
GetSystemInfo(&s);
return s.dwNumberOfProcessors;
void timed_wait(WaitCondition& sleepCond, Lock& sleepLock, int msec) {
-#if defined(_WIN32)
+#ifdef _WIN32
int tm = msec;
#else
timespec ts, *tm = &ts;
/// prefetch() preloads the given address in L1/L2 cache. This is a non
/// blocking function and do not stalls the CPU waiting for data to be
/// loaded from memory, that can be quite slow.
-#if defined(NO_PREFETCH)
+#ifdef NO_PREFETCH
void prefetch(char*) {}
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(MISC_H_INCLUDED)
+#ifndef MISC_H_INCLUDED
#define MISC_H_INCLUDED
#include <fstream>
#define sync_cout std::cout << io_lock
#define sync_endl std::endl << io_unlock
-#endif // !defined(MISC_H_INCLUDED)
+#endif // #ifndef MISC_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(MOVEGEN_H_INCLUDED)
+#ifndef MOVEGEN_H_INCLUDED
#define MOVEGEN_H_INCLUDED
#include "types.h"
ExtMove *cur, *last;
};
-#endif // !defined(MOVEGEN_H_INCLUDED)
+#endif // #ifndef MOVEGEN_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined MOVEPICK_H_INCLUDED
+#ifndef MOVEPICK_H_INCLUDED
#define MOVEPICK_H_INCLUDED
#include <algorithm> // For std::max
ExtMove moves[MAX_MOVES];
};
-#endif // !defined(MOVEPICK_H_INCLUDED)
+#endif // #ifndef MOVEPICK_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(NOTATION_H_INCLUDED)
+#ifndef NOTATION_H_INCLUDED
#define NOTATION_H_INCLUDED
#include <string>
const std::string move_to_san(Position& pos, Move m);
std::string pretty_pv(Position& pos, int depth, Value score, int64_t msecs, Move pv[]);
-#endif // !defined(NOTATION_H_INCLUDED)
+#endif // #ifndef NOTATION_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(PAWNS_H_INCLUDED)
+#ifndef PAWNS_H_INCLUDED
#define PAWNS_H_INCLUDED
#include "misc.h"
}
-#endif // !defined(PAWNS_H_INCLUDED)
+#endif // #ifndef PAWNS_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(PLATFORM_H_INCLUDED)
+#ifndef PLATFORM_H_INCLUDED
#define PLATFORM_H_INCLUDED
-#if defined(_MSC_VER)
+#ifdef _MSC_VER
// Disable some silly and noisy warning from MSVC compiler
#pragma warning(disable: 4127) // Conditional expression is constant
# include <unistd.h> // Used by sysconf(_SC_NPROCESSORS_ONLN)
#endif
-#if !defined(_WIN32) // Linux - Unix
+#ifndef _WIN32 // Linux - Unix
# include <sys/time.h>
typedef timeval sys_time_t;
inline void system_time(sys_time_t* t) { _ftime(t); }
inline int64_t time_to_msec(const sys_time_t& t) { return t.time * 1000LL + t.millitm; }
-#if !defined(NOMINMAX)
+#ifndef NOMINMAX
# define NOMINMAX // disable macros min() and max()
#endif
#endif
-#endif // !defined(PLATFORM_H_INCLUDED)
+#endif // #ifndef PLATFORM_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(POSITION_H_INCLUDED)
+#ifndef POSITION_H_INCLUDED
#define POSITION_H_INCLUDED
#include <cassert>
return thisThread;
}
-#endif // !defined(POSITION_H_INCLUDED)
+#endif // #ifndef POSITION_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(PSQTAB_H_INCLUDED)
+#ifndef PSQTAB_H_INCLUDED
#define PSQTAB_H_INCLUDED
#include "types.h"
#undef S
-#endif // !defined(PSQTAB_H_INCLUDED)
+#endif // #ifndef PSQTAB_H_INCLUDED
(at your option) any later version.
*/
-#if !defined(RKISS_H_INCLUDED)
+#ifndef RKISS_H_INCLUDED
#define RKISS_H_INCLUDED
#include "types.h"
template<typename T> T rand() { return T(rand64()); }
};
-#endif // !defined(RKISS_H_INCLUDED)
+#endif // #ifndef RKISS_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(SEARCH_H_INCLUDED)
+#ifndef SEARCH_H_INCLUDED
#define SEARCH_H_INCLUDED
#include <cstring>
} // namespace Search
-#endif // !defined(SEARCH_H_INCLUDED)
+#endif // #ifndef SEARCH_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(THREAD_H_INCLUDED)
+#ifndef THREAD_H_INCLUDED
#define THREAD_H_INCLUDED
#include <vector>
extern ThreadPool Threads;
-#endif // !defined(THREAD_H_INCLUDED)
+#endif // #ifndef THREAD_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(TIMEMAN_H_INCLUDED)
+#ifndef TIMEMAN_H_INCLUDED
#define TIMEMAN_H_INCLUDED
/// The TimeManager class computes the optimal time to think depending on the
int unstablePVExtraTime;
};
-#endif // !defined(TIMEMAN_H_INCLUDED)
+#endif // #ifndef TIMEMAN_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(TT_H_INCLUDED)
+#ifndef TT_H_INCLUDED
#define TT_H_INCLUDED
#include "misc.h"
const_cast<TTEntry*>(tte)->set_generation(generation);
}
-#endif // !defined(TT_H_INCLUDED)
+#endif // #ifndef TT_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(TYPES_H_INCLUDED)
+#ifndef TYPES_H_INCLUDED
#define TYPES_H_INCLUDED
/// For Linux and OSX configuration is done automatically using Makefile. To get
# define CACHE_LINE_ALIGNMENT __attribute__ ((aligned(CACHE_LINE_SIZE)))
#endif
-#if defined(_MSC_VER)
+#ifdef _MSC_VER
# define FORCE_INLINE __forceinline
#elif defined(__GNUC__)
# define FORCE_INLINE inline __attribute__((always_inline))
# define FORCE_INLINE inline
#endif
-#if defined(USE_POPCNT)
+#ifdef USE_POPCNT
const bool HasPopCnt = true;
#else
const bool HasPopCnt = false;
#endif
-#if defined(IS_64BIT)
+#ifdef IS_64BIT
const bool Is64Bit = true;
#else
const bool Is64Bit = false;
return ch;
}
-#endif // !defined(TYPES_H_INCLUDED)
+#endif // #ifndef TYPES_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(UCIOPTION_H_INCLUDED)
+#ifndef UCIOPTION_H_INCLUDED
#define UCIOPTION_H_INCLUDED
#include <map>
extern UCI::OptionsMap Options;
-#endif // !defined(UCIOPTION_H_INCLUDED)
+#endif // #ifndef UCIOPTION_H_INCLUDED