Skip to content
This repository was archived by the owner on Aug 2, 2019. It is now read-only.

Commit 811d59c

Browse files
committed
Platform macro
Using platform macro instead of compiler macro
1 parent a000ffe commit 811d59c

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

src/egbb.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
// includes
3131

32-
#ifdef _MSC_VER
32+
#ifdef _WIN32
3333
# include <windows.h>
3434
#else
3535
# include <cstring>
@@ -46,7 +46,7 @@
4646

4747
// constants
4848

49-
#ifdef _MSC_VER
49+
#ifdef _WIN32
5050
static const char EgbbLib[] = "egbb.dll";
5151
#else
5252
static const char EgbbLib[] = "egbb.so";

src/mutex.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
// includes
2626

27-
#ifdef _MSC_VER
27+
#ifdef _WIN32
2828
# include <windows.h>
2929
#else
3030
# include <signal.h>
@@ -33,7 +33,7 @@
3333

3434
// macros
3535

36-
#ifdef _MSC_VER
36+
#ifdef _WIN32
3737
# define MUTEX_INIT(x,y) InitializeCriticalSection(x)
3838
# define MUTEX_LOCK(x) EnterCriticalSection(x)
3939
# define MUTEX_FREE(x) LeaveCriticalSection(x)
@@ -47,13 +47,13 @@
4747

4848
// types
4949

50-
#ifdef _MSC_VER
50+
#ifdef _WIN32
5151
typedef CRITICAL_SECTION mutex_t;
5252
#else
5353
typedef pthread_mutex_t mutex_t;
5454
#endif
5555

56-
#ifdef _MSC_VER
56+
#ifdef _WIN32
5757
typedef HANDLE handle_t;
5858
#else
5959
typedef pthread_cond_t handle_t;

src/tb.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
// includes
2323

24-
#ifdef _MSC_VER
24+
#ifdef _WIN32
2525
# include <windows.h>
2626
#else
2727
# include <cstring>
@@ -40,7 +40,7 @@
4040

4141
// constants
4242

43-
#ifdef _MSC_VER
43+
#ifdef _WIN32
4444
static const char EgtbLib[] = "egtb.dll";
4545
#else
4646
static const char EgtbLib[] = "egtb.so";

src/thread.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
// includes
2323

24-
#ifdef _MSC_VER
24+
#ifdef _WIN32
2525
# include <windows.h>
2626
#else
2727
# include <cstring>
@@ -83,7 +83,7 @@ static void mutex_close ();
8383
static void thread_create ();
8484
static void thread_exit ();
8585

86-
#ifdef _MSC_VER
86+
#ifdef _WIN32
8787
static DWORD WINAPI thread_start (LPVOID id);
8888
#else
8989
static void * thread_start (void * id);
@@ -123,7 +123,7 @@ void smp_wakeup(void) {
123123
Thread[id].split_nb = 0;
124124
Thread[id].split_used = NULL;
125125

126-
#ifdef _MSC_VER
126+
#ifdef _WIN32
127127
SetEvent(Thread[id].wait);
128128
#else
129129
pthread_cond_broadcast(&Thread[id].wait);
@@ -392,7 +392,7 @@ static void thread_create(void) {
392392
volatile int i;
393393
bool thread_is_ok;
394394

395-
#ifndef _MSC_VER
395+
#ifndef _WIN32
396396
pthread_t pthread[1];
397397
#endif
398398

@@ -404,7 +404,7 @@ static void thread_create(void) {
404404
Thread[i].split_used = NULL;
405405
Thread[i].split_nb = 0;
406406

407-
#ifdef _MSC_VER
407+
#ifdef _WIN32
408408
Thread[i].wait = CreateEvent(0,false,false,0);
409409
#else
410410
pthread_cond_init(&Thread[i].wait,NULL);
@@ -415,7 +415,7 @@ static void thread_create(void) {
415415

416416
for (i = 1; i < ThreadMax; i++) { // no main thread
417417

418-
#ifdef _MSC_VER
418+
#ifdef _WIN32
419419
thread_is_ok = (CreateThread(NULL,0,thread_start,(LPVOID)(&i),0,NULL) != NULL);
420420
#else
421421
thread_is_ok = (pthread_create(pthread,NULL,thread_start,(void*)(&i)) == 0);
@@ -438,7 +438,7 @@ static void thread_exit(void) {
438438

439439
Thread[id].stage = STAGE_EXIT;
440440

441-
#ifdef _MSC_VER
441+
#ifdef _WIN32
442442
SetEvent(Thread[id].wait);
443443
#else
444444
pthread_cond_broadcast(&Thread[id].wait);
@@ -450,7 +450,7 @@ static void thread_exit(void) {
450450

451451
// thread_start()
452452

453-
#ifdef _MSC_VER
453+
#ifdef _WIN32
454454
static DWORD WINAPI thread_start(LPVOID id) {
455455
#else
456456
static void * thread_start(void * id) {
@@ -486,7 +486,7 @@ static void thread_loop(int id, split_t * split) {
486486

487487
Thread[id].stage = STAGE_SLEEP;
488488

489-
#ifdef _MSC_VER
489+
#ifdef _WIN32
490490
WaitForSingleObject(Thread[id].wait, INFINITE);
491491
#else
492492
MUTEX_LOCK(SleepLock);
@@ -595,7 +595,7 @@ static void thread_update(const split_t * split, int old_alpha) {
595595

596596
if (best_move != MoveNone) {
597597

598-
good_move(best_move,board,depth,split->height,split->master,best_value >=split->beta);
598+
good_move(best_move,board,depth,split->height,split->master);
599599

600600
if (best_value >= split->beta && !MOVE_IS_TACTICAL(best_move,board)) {
601601

src/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
#define MIN(a,b) ((a)<=(b)?(a):(b))
8080
#define MAX(a,b) ((a)>=(b)?(a):(b))
8181

82-
#ifdef _MSC_VER
82+
#ifdef _WIN32
8383
# define INSTANCE HINSTANCE
8484
# define LOAD_LIB(x) LoadLibrary(x)
8585
# define UNLOAD_LIB(x) FreeLibrary(x)

0 commit comments

Comments
 (0)