To: [email protected]
Subject: patch 5.4n.24
Fcc: outbox
From: Bram Moolenaar <[email protected]>
------------

Patch 5.4n.24
Problem:    BeOS: configure never enabled the GUI, because $with_x was "no".
           Unix prototypes caused problems, because Display and Widget are
           undefined.
           Freeing fonts on exit caused a crash.
Solution:   Only disable the GUI when $with_x is "no" and  $BEOS is not "yes".
           Add dummy defines for Display and Widget in proto.h.
           Don't free the fonts in gui_exit() for BeOS.
Files:      src/configure.in, src/configure, src/proto.h, src/structs.h,
           src/gui.c.


*** ../vim-5.4n/src/configure.in        Sun Jul  4 20:35:45 1999
--- src/configure.in    Mon Jul  5 20:26:11 1999
***************
*** 481,487 ****

 fi

! test "x$with_x" = xno && enable_gui=no

 AC_MSG_CHECKING(--enable-gui argument)
 AC_ARG_ENABLE(gui,
--- 481,487 ----

 fi

! test "x$with_x" = xno -a "x$BEOS" != "xyes" && enable_gui=no

 AC_MSG_CHECKING(--enable-gui argument)
 AC_ARG_ENABLE(gui,
*** ../vim-5.4n/src/configure   Sun Jul  4 20:35:45 1999
--- src/configure       Mon Jul  5 20:36:51 1999
***************
*** 2717,2723 ****

 fi

! test "x$with_x" = xno && enable_gui=no

 echo $ac_n "checking --enable-gui argument""... $ac_c" 1>&6
 echo "configure:2724: checking --enable-gui argument" >&5
--- 2717,2723 ----

 fi

! test "x$with_x" = xno -a "x$BEOS" != "xyes" && enable_gui=no

 echo $ac_n "checking --enable-gui argument""... $ac_c" 1>&6
 echo "configure:2724: checking --enable-gui argument" >&5
*** ../vim-5.4n/src/proto.h     Sun Jul  4 20:35:38 1999
--- src/proto.h Sun Jul 11 12:23:07 1999
***************
*** 23,28 ****
--- 23,32 ----
 #  include "os_amiga.pro"
 # endif
 # if defined(UNIX) || defined(__EMX__)
+ #  if (!defined(HAVE_X11) || !defined(WANT_X11)) && !defined(USE_GUI_GTK)
+ #   define Display int        /* avoid errors in function prototypes */
+ #   define Widget int
+ #  endif
 #  include "os_unix.pro"
 # endif
 # ifdef MSDOS
*** ../vim-5.4n/src/structs.h   Sun Jul  4 20:35:41 1999
--- src/structs.h       Sun Jul 11 12:18:46 1999
***************
*** 40,51 ****
 #else
 # ifdef XTERM_CLIP
 #  include <X11/Intrinsic.h>
- # else
- #  define Window int      /* avoid error in prototypes */
- #  define Display int
- #  define Widget int
 # endif
! # define GuiColor int     /* avoid error message for undefined struct */
 #endif

 /*
--- 40,47 ----
 #else
 # ifdef XTERM_CLIP
 #  include <X11/Intrinsic.h>
 # endif
! # define GuiColor int             /* avoid error in prototypes */
 #endif

 /*
*** ../vim-5.4n/src/gui.c       Sun Jul  4 20:35:37 1999
--- src/gui.c   Sat Jul 10 14:23:16 1999
***************
*** 483,489 ****
--- 483,493 ----
 gui_exit(rc)
     int               rc;
 {
+ #ifndef __BEOS__
+     /* don't free the fonts, it leads to a BUS error
+      * [email protected] Jul 99 */
     free_highlight_fonts();
+ #endif
     gui.in_use = FALSE;
     gui_mch_exit(rc);
 }


--
hundred-and-one symptoms of being an internet addict:
34. You laugh at people with 14400 baud modems.

--/-/---- Bram Moolenaar ---- [email protected] ---- [email protected] ---\-\--
 \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /