[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: compile break
From: |
Jason Stover |
Subject: |
Re: compile break |
Date: |
Tue, 7 Aug 2007 21:53:51 -0400 |
User-agent: |
Mutt/1.5.10i |
That worked.
On Sun, Aug 05, 2007 at 03:06:59PM -0700, Ben Pfaff wrote:
> Jason Stover <address@hidden> writes:
>
> > On Sat, Aug 04, 2007 at 09:03:52PM -0700, Ben Pfaff wrote:
> >> Jason Stover <address@hidden> writes:
> >> > src/data/settings.c:182: error: conflicting types for `get_safer_mode'
> >> > src/data/settings.h:33: error: previous declaration of
> >> > `get_safer_mode'
> >>
> >> I think that must have something to do with libncurses. There is
> >> some hideous wreckage in curses.h on my system here.
> >>
> >> If you comment out the line "#define HAVE_LIBNCURSES 1" in
> >> config.h, does the problem go away?
> >
> > Yes.
>
> Please un-comment that line from config.h, so that libncurses is
> enabled again, and try it with this patch. I believe that it
> should solve the problem.
>
> Thanks!
>
> Index: merge/src/data/settings.c
> ===================================================================
> --- merge.orig/src/data/settings.c 2007-08-05 14:59:50.000000000 -0700
> +++ merge/src/data/settings.c 2007-08-05 15:05:02.000000000 -0700
> @@ -26,11 +26,6 @@
>
> #include "error.h"
>
> -#ifdef HAVE_LIBNCURSES
> -#include <curses.h>
> -#include <term.h>
> -#endif
> -
> #include "gettext.h"
> #define _(msgid) gettext (msgid)
>
> @@ -80,6 +75,7 @@ static int *algorithm = &global_algorith
> static int syntax = ENHANCED;
>
> static void init_viewport (void);
> +static void get_termcap_viewport (void);
>
> void
> settings_init (void)
> @@ -131,28 +127,6 @@ set_viewwidth (int viewwidth_)
> viewwidth = viewwidth_;
> }
>
> -#if HAVE_LIBNCURSES
> -static void
> -get_termcap_viewport (void)
> -{
> - char term_buffer[16384];
> - if (getenv ("TERM") == NULL)
> - return;
> - else if (tgetent (term_buffer, getenv ("TERM")) <= 0)
> - {
> - error (0,0, _("could not access definition for terminal `%s'"),
> - getenv ("TERM"));
> - return;
> - }
> -
> - if (tgetnum ("li") > 0)
> - viewlength = tgetnum ("li");
> -
> - if (tgetnum ("co") > 1)
> - viewwidth = tgetnum ("co") - 1;
> -}
> -#endif /* HAVE_LIBNCURSES */
> -
> static void
> init_viewport (void)
> {
> @@ -161,9 +135,7 @@ init_viewport (void)
>
> viewwidth = viewlength = -1;
>
> -#if HAVE_LIBNCURSES
> get_termcap_viewport ();
> -#endif /* HAVE_LIBNCURSES */
>
> if (viewwidth < 0 && getenv ("COLUMNS") != NULL)
> viewwidth = atoi (getenv ("COLUMNS"));
> @@ -526,3 +498,38 @@ set_syntax (enum behavior_mode mode)
> {
> syntax = mode;
> }
> +
> +/* Code that interfaces to ncurses. This must be at the very end
> + of this file because curses.h redefines "bool" on some systems
> + (e.g. OpenBSD), causing declaration mismatches with functions
> + that have parameters or return values of type "bool". */
> +#if HAVE_LIBNCURSES
> +#include <curses.h>
> +#include <term.h>
> +
> +static void
> +get_termcap_viewport (void)
> +{
> + char term_buffer[16384];
> + if (getenv ("TERM") == NULL)
> + return;
> + else if (tgetent (term_buffer, getenv ("TERM")) <= 0)
> + {
> + error (0,0, _("could not access definition for terminal `%s'"),
> + getenv ("TERM"));
> + return;
> + }
> +
> + if (tgetnum ("li") > 0)
> + viewlength = tgetnum ("li");
> +
> + if (tgetnum ("co") > 1)
> + viewwidth = tgetnum ("co") - 1;
> +}
> +#else /* !HAVE_LIBNCURSES */
> +static void
> +get_termcap_viewport (void)
> +{
> + /* Nothing to do. */
> +}
> +#endif /* !HAVE_LIBNCURSES */
>
> --
> Ben Pfaff
> http://benpfaff.org