Skip to content

Commit d078c00

Browse files
committed
Windows Phalanx engine code fixes FINAL ATTEMPT 3
1 parent d06f1bb commit d078c00

3 files changed

Lines changed: 24 additions & 19 deletions

File tree

engines/phalanx-scid/evaluate.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ if(Flag.polling)
303303
DWORD read;
304304
if (PeekNamedPipe(h, buf, 255, &read, &nBytes, NULL)) {
305305
buf[read] = '\0';
306-
if (strchr(buf, '\n') || strchr(buf, '\r')) interrupt(0);
306+
if (strchr(buf, '\n') || strchr(buf, '\r')) {
307+
interrupt(0);
308+
}
307309
}
308310
}
309311
}
@@ -318,7 +320,9 @@ if(Flag.polling)
318320
tv.tv_usec=0;
319321
select(16, &readfds, 0, 0, &tv);
320322
data=FD_ISSET(fileno(stdin), &readfds);
321-
if(data) interrupt(0);
323+
if(data) {
324+
interrupt(0);
325+
}
322326
#endif
323327
if( Abort && ! NoAbort ) return 0;
324328
}

engines/phalanx-scid/phalanx.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
*/
77

88
#include "phalanx.h"
9-
#ifdef _WIN32
10-
#include <fcntl.h>
11-
#include <io.h>
12-
#endif
139

1410
/* 2005-09-14, José de Paula
1511
* GCC 3.0 deprecated multi-line strings, and, as of GCC 3.4, they are no longer supported.

engines/phalanx-scid/phalanx.h

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
#ifndef PHALANX_INCLUDED
22
#define PHALANX_INCLUDED
33

4+
#include <stdio.h>
5+
#include <stdlib.h>
6+
#include <string.h>
7+
#include <time.h>
8+
#include <ctype.h>
9+
#include <signal.h>
10+
#include <sys/types.h>
11+
#include <sys/stat.h>
12+
13+
#ifdef _WIN32
14+
#include <windows.h>
15+
#include <fcntl.h>
16+
#include <io.h>
17+
#else
18+
#include <unistd.h>
19+
#include <sys/time.h>
20+
#endif
21+
422
#define VERSION "XXII-pg"
523

624
#ifdef GNUFUN
725
#include <getopt.h>
826
#endif
927

1028
#ifdef _WIN32
11-
#include <windows.h>
12-
1329
#ifndef GNUFUN
1430
extern int opterr;
1531
extern int optind;
@@ -25,21 +41,10 @@
2541
#define clearTimeout(DUMMY)
2642

2743
#else
28-
#include <unistd.h>
29-
#include <sys/time.h>
3044
#define setTimeout(FN, SEC) signal(SIGALRM,FN); alarm(SEC);
3145
#define clearTimeout(DUMMY) alarm(0);
3246
#endif
3347

34-
#include <stdio.h>
35-
#include <stdlib.h>
36-
#include <string.h>
37-
#include <time.h>
38-
#include <ctype.h>
39-
#include <signal.h>
40-
#include <sys/types.h>
41-
#include <sys/stat.h>
42-
4348
/*
4449
* COMPATIBILITY
4550
*/

0 commit comments

Comments
 (0)