From e0b7f0008b1ff2d9eddeaba8be0b35e1e40f5e49 Mon Sep 17 00:00:00 2001 From: "berkeviktor@aol.com" Date: Wed, 25 Aug 2010 04:19:10 +0200 Subject: [PATCH] xchat-text compiles but won't run --- src/fe-text/makefile.mak | 14 ++++++++ src/makefile.mak | 2 ++ xchat-wdk.patch | 78 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 src/fe-text/makefile.mak diff --git a/src/fe-text/makefile.mak b/src/fe-text/makefile.mak new file mode 100644 index 00000000..abca9985 --- /dev/null +++ b/src/fe-text/makefile.mak @@ -0,0 +1,14 @@ +include "..\makeinc.mak" + +COMLIB = ..\common\xchatcommon.lib +PROG = xchat-text.exe + +all: fe-text.obj + link /out:$(PROG) /entry:mainCRTStartup $(LDFLAGS) $(LIBS) $(COMLIB) fe-text.obj + +fe-text.obj: fe-text.c makefile.mak + cl $(CFLAGS) $(GLIB) fe-text.c + +clean: + del *.obj + del $(PROG) diff --git a/src/makefile.mak b/src/makefile.mak index 595202d2..700ba6e6 100644 --- a/src/makefile.mak +++ b/src/makefile.mak @@ -3,6 +3,8 @@ all: @-$(MAKE) /nologo /s /f makefile.mak $@ @cd ..\fe-gtk @-$(MAKE) /nologo /s /f makefile.mak $@ +# @cd ..\fe-text +# @-$(MAKE) /nologo /s /f makefile.mak $@ clean: @del common\*.obj diff --git a/xchat-wdk.patch b/xchat-wdk.patch index 8a253ff5..fbc5b024 100644 --- a/xchat-wdk.patch +++ b/xchat-wdk.patch @@ -1078,3 +1078,81 @@ diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/xtext.c xchat-wdk/src/fe #include #include #include +diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-text/fe-text.c xchat-wdk/src/fe-text/fe-text.c +--- xchat-wdk.orig/src/fe-text/fe-text.c 2008-08-29 13:24:17 +0200 ++++ xchat-wdk/src/fe-text/fe-text.c 2010-08-25 04:16:04 +0200 +@@ -22,9 +22,13 @@ + #ifdef HAVE_STRINGS_H + #include + #endif ++#ifdef WIN32 ++#define STDIN_FILENO 0 ++#define STDOUT_FILENO 1 ++#else + #include ++#endif + #include +-#include + #include + #include "../common/xchat.h" + #include "../common/xchatc.h" +@@ -339,7 +343,11 @@ + te->callback = callback; + te->userdata = userdata; + +- gettimeofday (&now, NULL); ++#ifdef WIN32 ++ g_get_current_time (&now); ++#else ++ gettimeofday (&now, NULL); ++#endif + te->next_call = now.tv_sec * 1000 + (now.tv_usec / 1000) + te->interval; + + tmr_list = g_slist_prepend (tmr_list, te); +@@ -417,7 +425,12 @@ + void + fe_main (void) + { +- struct timeval timeout, now; ++ struct timeval timeout; ++#ifdef WIN32 ++ GTimeVal now; ++#else ++ struct timeval now; ++#endif + socketevent *se; + timerevent *te; + fd_set rd, wd, ex; +@@ -428,7 +441,7 @@ + new_ircwindow (NULL, NULL, SESS_SERVER, 0); + + #ifdef ENABLE_NLS +- bindtextdomain (GETTEXT_PACKAGE, PREFIX"/share/locale"); ++ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + #endif +@@ -464,7 +477,11 @@ + shortest = te->next_call; + list = list->next; + } ++#ifdef WIN32 ++ g_get_current_time (&now); ++#else + gettimeofday (&now, NULL); ++#endif + delay = shortest - ((now.tv_sec * 1000) + (now.tv_usec / 1000)); + timeout.tv_sec = delay / 1000; + timeout.tv_usec = (delay % 1000) * 1000; +@@ -514,7 +531,11 @@ + } + + /* now check our list of timeout events, some might need to be called! */ ++#ifdef WIN32 ++ g_get_current_time (&now); ++#else + gettimeofday (&now, NULL); ++#endif + list = tmr_list; + while (list) + {