From 7e9161d828524e516c6a2f7726c9ef166907c3b6 Mon Sep 17 00:00:00 2001 From: Siarzhuk Zharski Date: Thu, 21 May 2009 16:25:00 +0000 Subject: [PATCH] - removed some BeOS era workarounds not rewuired by Haiku build. --- app-editors/vim/patches/vim-7.2.patch | 98 +++++++++------------------ 1 file changed, 33 insertions(+), 65 deletions(-) diff --git a/app-editors/vim/patches/vim-7.2.patch b/app-editors/vim/patches/vim-7.2.patch index efeaa27e8..13d223d55 100644 --- a/app-editors/vim/patches/vim-7.2.patch +++ b/app-editors/vim/patches/vim-7.2.patch @@ -247,15 +247,6 @@ diff -Naur vim72/src/gui.c vim72.haiku/src/gui.c # define MAY_FORK int dofork = TRUE; #endif -@@ -626,7 +626,7 @@ - gui_exit(rc) - int rc; - { --#ifndef __BEOS__ -+#if !defined(__BEOS__) && !defined(__HAIKU__) - /* don't free the fonts, it leads to a BUS error - * richard@whitequeen.com Jul 99 */ - free_highlight_fonts(); @@ -1297,7 +1297,11 @@ again: busy = TRUE; @@ -2705,7 +2696,7 @@ diff -Naur vim72/src/gui_beos.cc vim72.haiku/src/gui_beos.cc + gui.vimWindow->Unlock(); +} + -+#define RUN_BAPPLICATION_IN_NEW_THREAD 1 ++#define RUN_BAPPLICATION_IN_NEW_THREAD 0 + +#if RUN_BAPPLICATION_IN_NEW_THREAD + @@ -4643,19 +4634,40 @@ diff -Naur vim72/src/os_beos.c vim72.haiku/src/os_beos.c release_sem(character_present); } -@@ -84,7 +85,10 @@ +@@ -70,13 +71,18 @@ + + #endif + ++#ifdef __BEOS__ ++ + /* + * select() emulation. Hopefully, in DR9 there will be something + * useful supplied by the system. ... Alas, not. Not in AAPR, nor + * in PR or even PR2... R3 then maybe? I don't think so! + */ + +- int ++/* sz: Haiku has finally select() support ++ * and not require this emulation, I hope! */ ++ ++ int + beos_select(int nbits, + struct fd_set *rbits, + struct fd_set *wbits, +@@ -84,7 +90,11 @@ struct timeval *timeout) { bigtime_t tmo; - +// TODO !!!! -+ if(gui.in_use) ++#ifdef FEAT_GUI_BEOS ++ if(gui.in_use) + return select(nbits, rbits, wbits, ebits, timeout); -+ ++#endif if (nbits == 0) { /* select is purely being used for delay */ snooze(timeout->tv_sec * 1e6 + timeout->tv_usec); -@@ -153,13 +157,15 @@ +@@ -153,13 +163,15 @@ acquired = acquire_sem(character_present); if (acquired == B_NO_ERROR) { if (charcount > 0) { @@ -4672,7 +4684,7 @@ diff -Naur vim72/src/os_beos.c vim72.haiku/src/os_beos.c #if !TRY_ABORT release_sem(character_wanted); #endif -@@ -183,7 +189,7 @@ +@@ -183,7 +195,7 @@ if (acquired == B_TIMED_OUT) acquire_sem(character_present); if (charcount > 0) { @@ -4681,7 +4693,7 @@ diff -Naur vim72/src/os_beos.c vim72.haiku/src/os_beos.c return 1; } return 0; -@@ -192,6 +198,17 @@ +@@ -192,6 +204,19 @@ } #endif @@ -4699,6 +4711,8 @@ diff -Naur vim72/src/os_beos.c vim72.haiku/src/os_beos.c return 0; } ++#endif /* __BEOS__ */ ++ diff -Naur vim72/src/os_beos.h vim72.haiku/src/os_beos.h --- vim72/src/os_beos.h 2009-04-19 20:52:33.000000000 +0000 +++ vim72.haiku/src/os_beos.h 2009-04-18 09:16:37.000000000 +0000 @@ -4946,24 +4960,6 @@ diff -Naur vim72/src/os_beos.rdef vim72.haiku/src/os_beos.rdef diff -Naur vim72/src/os_unix.c vim72.haiku/src/os_unix.c --- vim72/src/os_unix.c 2009-04-19 20:53:35.000000000 +0000 +++ vim72.haiku/src/os_unix.c 2009-04-26 20:57:12.000000000 +0000 -@@ -51,7 +51,7 @@ - */ - #ifndef __TANDEM - # undef select --# ifdef __BEOS__ -+# if defined(__BEOS__) || defined(__HAIKU__) - # define select beos_select - # endif - #endif -@@ -155,7 +155,7 @@ - static void may_core_dump __ARGS((void)); - - static int WaitForChar __ARGS((long)); --#if defined(__BEOS__) -+#if defined(__BEOS__) || defined(__HAIKU__) - int RealWaitForChar __ARGS((int, long, int *)); - #else - static int RealWaitForChar __ARGS((int, long, int *)); @@ -1094,7 +1094,7 @@ mch_suspend() { @@ -4990,7 +4986,7 @@ diff -Naur vim72/src/os_unix.c vim72.haiku/src/os_unix.c set_x11_title(title); /* x11 */ #endif -#if defined(FEAT_GUI_GTK) \ -+#if defined(FEAT_GUI_GTK) || defined(__HAIKU__)\ ++#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_BEOS)\ || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) else gui_mch_settitle(title, icon); @@ -5013,15 +5009,6 @@ diff -Naur vim72/src/os_unix.c vim72.haiku/src/os_unix.c beos_cleanup_read_thread(); # endif -@@ -4673,7 +4680,7 @@ - * Or when a Linux GPM mouse event is waiting. - */ - /* ARGSUSED */ --#if defined(__BEOS__) -+#if defined(__BEOS__) || defined(__HAIKU__) - int - #else - static int diff -Naur vim72/src/proto/gui_beos.pro vim72.haiku/src/proto/gui_beos.pro --- vim72/src/proto/gui_beos.pro 1970-01-01 00:00:00.000000000 +0000 +++ vim72.haiku/src/proto/gui_beos.pro 2009-05-04 07:23:00.000000000 +0000 @@ -5251,19 +5238,10 @@ diff -Naur vim72/src/ui.c vim72.haiku/src/ui.c } -#if !defined(UNIX) || !defined(SIGTSTP) || defined(PROTO) || defined(__BEOS__) -+#if !defined(UNIX) || !defined(SIGTSTP) || defined(PROTO) || defined(__BEOS__) || defined(__HAIKU__) ++#if !defined(UNIX) || !defined(SIGTSTP) || defined(PROTO) || defined(__BEOS__) || defined(__HAIKU__) /* * When the OS can't really suspend, call this function to start a shell. * This is never called in the GUI. -@@ -1739,7 +1739,7 @@ - * If we can't get any, and there isn't any in the buffer, we give up and - * exit Vim. - */ --# ifdef __BEOS__ -+# if defined(__BEOS__) || defined(__HAIKU__) - /* - * On the BeBox version (for now), all input is secretly performed within - * beos_select() which is called from RealWaitForChar(). diff -Naur vim72/src/version.c vim72.haiku/src/version.c --- vim72/src/version.c 2009-04-19 20:53:35.000000000 +0000 +++ vim72.haiku/src/version.c 2009-04-23 22:39:10.000000000 +0000 @@ -5305,17 +5283,7 @@ diff -Naur vim72/src/vim.h vim72.haiku/src/vim.h # include "os_beos.h" # define __ARGS(x) x #endif -@@ -1383,6 +1384,9 @@ - #define STRCPY(d, s) strcpy((char *)(d), (char *)(s)) - #define STRNCPY(d, s, n) strncpy((char *)(d), (char *)(s), (size_t)(n)) - #define STRCMP(d, s) strcmp((char *)(d), (char *)(s)) -+//extern void syslog(int, const char*,...); -+//#define STRCMP(d, s) (syslog(6, "%s:%d",__FILE__,__LINE__),strcmp((char *)(d), (char *)(s))) -+ - #define STRNCMP(d, s, n) strncmp((char *)(d), (char *)(s), (size_t)(n)) - #ifdef HAVE_STRCASECMP - # define STRICMP(d, s) strcasecmp((char *)(d), (char *)(s)) -@@ -1789,6 +1793,9 @@ +@@ -1789,6 +1790,9 @@ int_u format; /* Vim's own special clipboard format */ int_u format_raw; /* Vim's raw text clipboard format */ # endif