From 13ee029364b37eca95c43641420e75c872b32653 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Sun, 11 Dec 2011 18:04:35 +0100 Subject: [PATCH] some more multiplatform support --- plugins/lua/lua.c | 2 +- plugins/lua/makefile.mak | 2 +- plugins/perl/makefile-512.mak | 2 +- plugins/perl/makefile-514.mak | 2 +- plugins/perl/perl.c | 2 +- plugins/python/makefile.mak | 2 +- plugins/python/python.c | 2 +- src/common/{dirent.c => dirent-win32.c} | 2 +- src/common/{dirent.h => dirent-win32.h} | 0 src/common/makefile.mak | 10 +++++----- src/common/plugin.c | 4 ++++ src/common/util.c | 2 +- src/fe-gtk/about.c | 2 +- src/fe-gtk/fe-gtk.h | 7 ------- src/fe-gtk/setup.c | 2 ++ 15 files changed, 21 insertions(+), 22 deletions(-) rename src/common/{dirent.c => dirent-win32.c} (99%) rename src/common/{dirent.h => dirent-win32.h} (100%) diff --git a/plugins/lua/lua.c b/plugins/lua/lua.c index 9574fd4d..9f29bf08 100644 --- a/plugins/lua/lua.c +++ b/plugins/lua/lua.c @@ -43,12 +43,12 @@ #include #include #include -#include "../../src/common/dirent.h" #include #include #ifdef _WIN32 #include /* for getcwd */ +#include "../../src/common/dirent-win32.h" #endif #if !( defined(_WIN32) || defined(LXC_XCHAT_GETTEXT) ) diff --git a/plugins/lua/makefile.mak b/plugins/lua/makefile.mak index fbc94072..97a7e10b 100644 --- a/plugins/lua/makefile.mak +++ b/plugins/lua/makefile.mak @@ -1,6 +1,6 @@ include "..\..\src\makeinc.mak" -DIRENTLIB = ..\..\src\common\dirent.lib +DIRENTLIB = ..\..\src\common\dirent-win32.lib all: lua.obj lua.def link $(LDFLAGS) $(LIBS) /dll /out:xclua.dll $(LUALIB).lib $(DIRENTLIB) /def:lua.def lua.obj diff --git a/plugins/perl/makefile-512.mak b/plugins/perl/makefile-512.mak index 677c9073..7f2fbe04 100644 --- a/plugins/perl/makefile-512.mak +++ b/plugins/perl/makefile-512.mak @@ -1,6 +1,6 @@ include "..\..\src\makeinc.mak" -DIRENTLIB = ..\..\src\common\dirent.lib +DIRENTLIB = ..\..\src\common\dirent-win32.lib TARGET = $(PERL512OUTPUT) all: $(TARGET) diff --git a/plugins/perl/makefile-514.mak b/plugins/perl/makefile-514.mak index c31a7ec4..4c8d0ebd 100644 --- a/plugins/perl/makefile-514.mak +++ b/plugins/perl/makefile-514.mak @@ -1,6 +1,6 @@ include "..\..\src\makeinc.mak" -DIRENTLIB = ..\..\src\common\dirent.lib +DIRENTLIB = ..\..\src\common\dirent-win32.lib TARGET = $(PERL514OUTPUT) all: $(TARGET) diff --git a/plugins/perl/perl.c b/plugins/perl/perl.c index a2763771..719ef292 100644 --- a/plugins/perl/perl.c +++ b/plugins/perl/perl.c @@ -28,7 +28,7 @@ #ifdef WIN32 #include #define _INC_DIRENT /* disable inclusion of perl's dirent.h, we use an own version for win32 */ -#include "../../src/common/dirent.h" +#include "../../src/common/dirent-win32.h" #else #include #endif diff --git a/plugins/python/makefile.mak b/plugins/python/makefile.mak index 8cbba3f5..bc004577 100644 --- a/plugins/python/makefile.mak +++ b/plugins/python/makefile.mak @@ -1,6 +1,6 @@ include "..\..\src\makeinc.mak" -DIRENTLIB = ..\..\src\common\dirent.lib +DIRENTLIB = ..\..\src\common\dirent-win32.lib TARGET = $(PYTHONOUTPUT) all: $(TARGET) diff --git a/plugins/python/python.c b/plugins/python/python.c index 3c535057..dcf4fc8f 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -57,7 +57,7 @@ #include #ifdef WIN32 -#include "../../src/common/dirent.h" +#include "../../src/common/dirent-win32.h" #include "../../config.h" #else #include diff --git a/src/common/dirent.c b/src/common/dirent-win32.c similarity index 99% rename from src/common/dirent.c rename to src/common/dirent-win32.c index a84f1b65..273c6732 100644 --- a/src/common/dirent.c +++ b/src/common/dirent-win32.c @@ -56,7 +56,7 @@ * First version. *****************************************************************************/ -#include "dirent.h" +#include "dirent-win32.h" /* Use the new safe string functions introduced in Visual Studio 2005 */ #if defined(_MSC_VER) && _MSC_VER >= 1400 diff --git a/src/common/dirent.h b/src/common/dirent-win32.h similarity index 100% rename from src/common/dirent.h rename to src/common/dirent-win32.h diff --git a/src/common/makefile.mak b/src/common/makefile.mak index 8b350efc..f78a6d8d 100644 --- a/src/common/makefile.mak +++ b/src/common/makefile.mak @@ -5,7 +5,7 @@ cfgfiles.obj \ chanopt.obj \ ctcp.obj \ dcc.obj \ -dirent.obj \ +dirent-win32.obj \ history.obj \ ignore.obj \ inbound.obj \ @@ -27,13 +27,13 @@ userlist.obj \ util.obj \ xchat.obj -all: $(COMMON_OBJECTS) xchatcommon.lib dirent.lib +all: $(COMMON_OBJECTS) xchatcommon.lib dirent-win32.lib xchatcommon.lib: $(COMMON_OBJECTS) lib /nologo /out:xchatcommon.lib $(COMMON_OBJECTS) -dirent.lib: dirent.obj - lib /nologo /out:dirent.lib dirent.obj +dirent-win32.lib: dirent-win32.obj + lib /nologo /out:dirent-win32.lib dirent-win32.obj .c.obj:: $(CC) $(CFLAGS) $(GLIB) $< @@ -41,4 +41,4 @@ dirent.lib: dirent.obj clean: @del *.obj @del xchatcommon.lib - @del dirent.lib + @del dirent-win32.lib diff --git a/src/common/plugin.c b/src/common/plugin.c index ccb64e93..5ed20b87 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -1008,7 +1008,11 @@ xchat_get_info (xchat_plugin *ph, const char *id) return XCHATLIBDIR; case 0x14f51cd8: /* version */ +#ifdef WIN32 return XCHAT_RELEASE; +#else + return PACKAGE_VERSION; +#endif case 0xdd9b1abd: /* xchatdir */ return get_xdir_utf8 (); diff --git a/src/common/util.c b/src/common/util.c index ccc48657..51222e40 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -32,7 +32,7 @@ #include #include #include -#include "dirent.h" +#include "dirent-win32.h" #else #include #include diff --git a/src/fe-gtk/about.c b/src/fe-gtk/about.c index 41f3c09b..dc1cbf08 100644 --- a/src/fe-gtk/about.c +++ b/src/fe-gtk/about.c @@ -139,7 +139,7 @@ menu_about (GtkWidget * wid, gpointer sess) (portable_mode () ? "Yes" : "No"), get_cpu_arch () #else - "%s\n\n" + "\n%s\n\n" "%s\n" "Charset: %s " "Renderer: %s\n" diff --git a/src/fe-gtk/fe-gtk.h b/src/fe-gtk/fe-gtk.h index 4183f559..8fffb3cc 100644 --- a/src/fe-gtk/fe-gtk.h +++ b/src/fe-gtk/fe-gtk.h @@ -1,13 +1,6 @@ #include "../../config.h" -#ifdef WIN32 -/* If you're compiling this for Windows, your release is un-official - * and not condoned. Please don't use the XChat name. Make up your - * own name! */ #define DISPLAY_NAME "XChat-WDK" -#else -#define DISPLAY_NAME "XChat" -#endif #ifndef WIN32 #include diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c index 1f1be0b4..cce85d30 100644 --- a/src/fe-gtk/setup.c +++ b/src/fe-gtk/setup.c @@ -1383,7 +1383,9 @@ setup_create_color_page (void) setup_create_other_color (_("New message:"), COL_NEW_MSG, 10, tab); setup_create_other_colorR (_("Away user:"), COL_AWAY, 10, tab); setup_create_other_color (_("Highlight:"), COL_HILIGHT, 11, tab); +#if defined(USE_GTKSPELL) || defined(USE_LIBSEXY) setup_create_other_colorR (_("Spell checker:"), COL_SPELL, 11, tab); +#endif return box; }