From b86255fd1538758fb8a21917295ee58839bc885e Mon Sep 17 00:00:00 2001 From: Harvie Date: Mon, 30 Aug 2010 00:07:21 +0200 Subject: [PATCH 1/1] Added notes for future porting to windows --- answerscripts.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/answerscripts.c b/answerscripts.c index c2e4dd0..f84dcc6 100755 --- a/answerscripts.c +++ b/answerscripts.c @@ -17,6 +17,8 @@ #ifndef __WIN32__ #include +#else + #include #endif /* Purple plugin */ @@ -44,7 +46,7 @@ int answerscripts_process_message_cb(answerscripts_job *job) { if (pipe && !feof(pipe)) { if(!fgets(response, ANSWERSCRIPTS_LINE_LENGTH, pipe) - && (errno == EWOULDBLOCK || errno == EAGAIN) + && (errno == EWOULDBLOCK || errno == EAGAIN) //WARNING! Not compatible with windows :-( ) return 1; for(i=0;response[i];i++) if(response[i]=='\n') response[i]=0; @@ -100,6 +102,8 @@ static void received_im_msg_cb(PurpleAccount *account, char *who, char *buffer, #ifndef __WIN32__ int fflags = fcntl(fileno(job->pipe), F_GETFL, 0); fcntl(fileno(job->pipe), F_SETFL, fflags | O_NONBLOCK); + #else + //WARNING! Somehow implement FILE_FLAG_OVERLAPPED & FILE_FLAG_NO_BUFFERING support on windows #endif purple_timeout_add(ANSWERSCRIPTS_TIMEOUT_INTERVAL, (GSourceFunc) answerscripts_process_message_cb, (gpointer) job); -- 2.30.2