From 65a844aed69227cb2f45a9851f25d395deec819e Mon Sep 17 00:00:00 2001 From: Neil Mclean Date: Sun, 15 Jul 2012 23:44:16 +0100 Subject: [PATCH] Win32 MinGW compilation changes, chat.c requires regex parsing library. string.h function 'index()' is Posix deprecated, equivalent to 'strchr()' --- Makefile | 2 +- gtp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9db5a69..5e0fe18 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ CUSTOM_CFLAGS=-Wall -ggdb3 -O3 -std=gnu99 -frename-registers -pthread -Wsign-com ifdef WIN SYS_CFLAGS= LDFLAGS=-pthread - LIBS=-lm -lws2_32 + LIBS=-lm -lws2_32 -lregex else ifdef MAC SYS_CFLAGS=-DNO_THREAD_LOCAL diff --git a/gtp.c b/gtp.c index 2ca0f44..7827305 100644 --- a/gtp.c +++ b/gtp.c @@ -544,7 +544,7 @@ next_group:; next_tok(from); char *msg = next; msg += strspn(msg, " \n\t"); - char *end = index(msg, '\n'); + char *end = strchr(msg, '\n'); if (end) *end = '\0'; char *reply = NULL; if (engine->chat) { -- 2.11.4.GIT