And #ifdef instead of #if defined
This is more standard form (see for example iostream file).
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
23 files changed:
/// 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.
/// 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.
Square lsb(Bitboard b) { return BSFTable[bsf_index(b)]; }
Square lsb(Bitboard b) { return BSFTable[bsf_index(b)]; }
return (Square)(result + MS1BTable[b32]);
}
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
/// Bitboards::print() prints a bitboard in an easily readable format to the
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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"
#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.
/// 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(_MSC_VER) && !defined(__INTEL_COMPILER)
# if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
-#else // if !defined(USE_BSFQ)
+#else // if defined(USE_BSFQ)
extern Square msb(Bitboard b);
extern Square lsb(Bitboard b);
extern Square msb(Bitboard b);
extern Square lsb(Bitboard b);
-#endif // !defined(BITBOARD_H_INCLUDED)
+#endif // #ifndef BITBOARD_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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>
#define BITCOUNT_H_INCLUDED
#include <cassert>
template<>
inline int popcount<CNT_HW_POPCNT>(Bitboard b) {
template<>
inline int popcount<CNT_HW_POPCNT>(Bitboard b) {
-#if !defined(USE_POPCNT)
assert(false);
return b != 0; // Avoid 'b not used' warning
assert(false);
return b != 0; // Avoid 'b not used' warning
-#endif // !defined(BITCOUNT_H_INCLUDED)
+#endif // #ifndef BITCOUNT_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(BOOK_H_INCLUDED)
#define BOOK_H_INCLUDED
#include <fstream>
#define BOOK_H_INCLUDED
#include <fstream>
-#endif // !defined(BOOK_H_INCLUDED)
+#endif // #ifndef BOOK_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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>
#define ENDGAME_H_INCLUDED
#include <map>
{ return eg = map(eg).count(key) ? map(eg)[key] : NULL; }
};
{ 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/>.
*/
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"
#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/>.
*/
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"
#define MATERIAL_H_INCLUDED
#include "endgame.h"
-#endif // !defined(MATERIAL_H_INCLUDED)
+#endif // #ifndef MATERIAL_H_INCLUDED
#include "misc.h"
#include "thread.h"
#include "misc.h"
#include "thread.h"
# include <sys/pstat.h>
#endif
# include <sys/pstat.h>
#endif
SYSTEM_INFO s;
GetSystemInfo(&s);
return s.dwNumberOfProcessors;
SYSTEM_INFO s;
GetSystemInfo(&s);
return s.dwNumberOfProcessors;
void timed_wait(WaitCondition& sleepCond, Lock& sleepLock, int msec) {
void timed_wait(WaitCondition& sleepCond, Lock& sleepLock, int msec) {
int tm = msec;
#else
timespec ts, *tm = &ts;
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.
/// 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)
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(MISC_H_INCLUDED)
#define MISC_H_INCLUDED
#include <fstream>
#define MISC_H_INCLUDED
#include <fstream>
#define sync_cout std::cout << io_lock
#define sync_endl std::endl << io_unlock
#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/>.
*/
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"
#define MOVEGEN_H_INCLUDED
#include "types.h"
-#endif // !defined(MOVEGEN_H_INCLUDED)
+#endif // #ifndef MOVEGEN_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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
#define MOVEPICK_H_INCLUDED
#include <algorithm> // For std::max
ExtMove moves[MAX_MOVES];
};
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/>.
*/
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>
#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[]);
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/>.
*/
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"
#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/>.
*/
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
#define PLATFORM_H_INCLUDED
// Disable some silly and noisy warning from MSVC compiler
#pragma warning(disable: 4127) // Conditional expression is constant
// 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
# 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;
# 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; }
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; }
# define NOMINMAX // disable macros min() and max()
#endif
# define NOMINMAX // disable macros min() and max()
#endif
-#endif // !defined(PLATFORM_H_INCLUDED)
+#endif // #ifndef PLATFORM_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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>
#define POSITION_H_INCLUDED
#include <cassert>
-#endif // !defined(POSITION_H_INCLUDED)
+#endif // #ifndef POSITION_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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"
#define PSQTAB_H_INCLUDED
#include "types.h"
-#endif // !defined(PSQTAB_H_INCLUDED)
+#endif // #ifndef PSQTAB_H_INCLUDED
(at your option) any later version.
*/
(at your option) any later version.
*/
-#if !defined(RKISS_H_INCLUDED)
+#ifndef RKISS_H_INCLUDED
#define RKISS_H_INCLUDED
#include "types.h"
#define RKISS_H_INCLUDED
#include "types.h"
template<typename T> T rand() { return T(rand64()); }
};
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/>.
*/
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>
#define SEARCH_H_INCLUDED
#include <cstring>
-#endif // !defined(SEARCH_H_INCLUDED)
+#endif // #ifndef SEARCH_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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>
#define THREAD_H_INCLUDED
#include <vector>
extern ThreadPool Threads;
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/>.
*/
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
#define TIMEMAN_H_INCLUDED
/// The TimeManager class computes the optimal time to think depending on the
int unstablePVExtraTime;
};
int unstablePVExtraTime;
};
-#endif // !defined(TIMEMAN_H_INCLUDED)
+#endif // #ifndef TIMEMAN_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#if !defined(TT_H_INCLUDED)
#define TT_H_INCLUDED
#include "misc.h"
#define TT_H_INCLUDED
#include "misc.h"
const_cast<TTEntry*>(tte)->set_generation(generation);
}
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/>.
*/
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 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
# define CACHE_LINE_ALIGNMENT __attribute__ ((aligned(CACHE_LINE_SIZE)))
#endif
# define FORCE_INLINE __forceinline
#elif defined(__GNUC__)
# define FORCE_INLINE inline __attribute__((always_inline))
# define FORCE_INLINE __forceinline
#elif defined(__GNUC__)
# define FORCE_INLINE inline __attribute__((always_inline))
# define FORCE_INLINE inline
#endif
# define FORCE_INLINE inline
#endif
const bool HasPopCnt = true;
#else
const bool HasPopCnt = false;
#endif
const bool HasPopCnt = true;
#else
const bool HasPopCnt = false;
#endif
const bool Is64Bit = true;
#else
const bool Is64Bit = false;
const bool Is64Bit = true;
#else
const bool Is64Bit = false;
-#endif // !defined(TYPES_H_INCLUDED)
+#endif // #ifndef TYPES_H_INCLUDED
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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>
#define UCIOPTION_H_INCLUDED
#include <map>
extern UCI::OptionsMap Options;
extern UCI::OptionsMap Options;
-#endif // !defined(UCIOPTION_H_INCLUDED)
+#endif // #ifndef UCIOPTION_H_INCLUDED