From: Harvie Date: Sun, 29 Aug 2010 22:07:21 +0000 (+0200) Subject: Added notes for future porting to windows X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=b86255fd1538758fb8a21917295ee58839bc885e;p=mirrors%2Flibpurple-core-answerscripts.git Added notes for future porting to windows --- 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);