qulogic/libgnt

cross-win32: fix finch build

2014-04-20, Tomasz Wasilczyk
ad4a87a62ce7
Parents 8b9d2e9c38c9
Children 27d2daa91e89
cross-win32: fix finch build
  • +14 -0
    gnt.h
  • +0 -1
    gntbindable.h
  • +0 -4
    gntcolors.c
  • +3 -1
    gntinternal.h
  • +0 -1
    gntkeys.h
  • +11 -1
    gntmain.c
  • +0 -1
    gntwidget.c
  • +0 -1
    gntwidget.h
  • --- a/gnt.h Thu Apr 17 01:29:28 2014 +0200
    +++ b/gnt.h Sun Apr 20 18:13:36 2014 +0200
    @@ -30,6 +30,20 @@
    */
    #include <glib.h>
    +
    +#ifdef HAVE_CONFIG_H
    +# include <config.h>
    +#endif
    +#ifdef _WIN32
    +# undef KEY_EVENT
    +#endif
    +#ifdef NO_WIDECHAR
    +# define NCURSES_WIDECHAR 0
    +#else
    +# define NCURSES_WIDECHAR 1
    +#endif
    +#include <ncurses.h>
    +
    #include "gntwidget.h"
    #include "gntclipboard.h"
    #include "gntcolors.h"
    --- a/gntbindable.h Thu Apr 17 01:29:28 2014 +0200
    +++ b/gntbindable.h Sun Apr 20 18:13:36 2014 +0200
    @@ -32,7 +32,6 @@
    #include <stdio.h>
    #include <glib.h>
    #include <glib-object.h>
    -#include <ncurses.h>
    #define GNT_TYPE_BINDABLE (gnt_bindable_get_type())
    #define GNT_BINDABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_BINDABLE, GntBindable))
    --- a/gntcolors.c Thu Apr 17 01:29:28 2014 +0200
    +++ b/gntcolors.c Sun Apr 20 18:13:36 2014 +0200
    @@ -20,10 +20,6 @@
    * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
    */
    -#include "config.h"
    -
    -#include <ncurses.h>
    -
    #include "gntinternal.h"
    #undef GNT_LOG_DOMAIN
    #define GNT_LOG_DOMAIN "Colors"
    --- a/gntinternal.h Thu Apr 17 01:29:28 2014 +0200
    +++ b/gntinternal.h Sun Apr 20 18:13:36 2014 +0200
    @@ -19,7 +19,9 @@
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
    */
    -#include <glib.h>
    +
    +#include "gnt.h"
    +
    #undef G_LOG_DOMAIN
    #define G_LOG_DOMAIN "Gnt"
    --- a/gntkeys.h Thu Apr 17 01:29:28 2014 +0200
    +++ b/gntkeys.h Sun Apr 20 18:13:36 2014 +0200
    @@ -29,7 +29,6 @@
    * @title: Keys API
    */
    -#include <curses.h>
    #include <term.h>
    /*
    --- a/gntmain.c Thu Apr 17 01:29:28 2014 +0200
    +++ b/gntmain.c Sun Apr 20 18:13:36 2014 +0200
    @@ -30,7 +30,9 @@
    #include <gmodule.h>
    #include <sys/types.h>
    +#ifndef _WIN32
    #include <sys/wait.h>
    +#endif
    #include "gntinternal.h"
    #undef GNT_LOG_DOMAIN
    @@ -339,6 +341,7 @@
    return FALSE;
    }
    +#ifndef _WIN32
    /* Xerox */
    static void
    clean_pid(void)
    @@ -356,6 +359,7 @@
    perror(errmsg);
    }
    }
    +#endif
    static void
    exit_confirmed(gpointer null)
    @@ -425,10 +429,12 @@
    signal(SIGWINCH, sighandler);
    break;
    #endif
    +#ifndef _WIN32
    case SIGCHLD:
    clean_pid();
    signal(SIGCHLD, sighandler);
    break;
    +#endif
    case SIGINT:
    ask_before_exit();
    signal(SIGINT, sighandler);
    @@ -508,9 +514,11 @@
    #ifdef SIGWINCH
    org_winch_handler = signal(SIGWINCH, sighandler);
    #endif
    +#ifndef _WIN32
    signal(SIGCHLD, sighandler);
    + signal(SIGPIPE, SIG_IGN);
    +#endif
    signal(SIGINT, sighandler);
    - signal(SIGPIPE, SIG_IGN);
    #if !GLIB_CHECK_VERSION(2, 36, 0)
    /* GLib type system is automaticaly initialized since 2.36. */
    @@ -696,7 +704,9 @@
    cp->callback(status, cp->data);
    }
    g_free(cp);
    +#ifndef _WIN32
    clean_pid();
    +#endif
    wm->mode = GNT_KP_MODE_NORMAL;
    endwin();
    setup_io();
    --- a/gntwidget.c Thu Apr 17 01:29:28 2014 +0200
    +++ b/gntwidget.c Sun Apr 20 18:13:36 2014 +0200
    @@ -27,7 +27,6 @@
    #include "gntstyle.h"
    #include "gntmarshal.h"
    #include "gntutils.h"
    -#include "gnt.h"
    enum
    {
    --- a/gntwidget.h Thu Apr 17 01:29:28 2014 +0200
    +++ b/gntwidget.h Sun Apr 20 18:13:36 2014 +0200
    @@ -31,7 +31,6 @@
    #include <stdio.h>
    #include <glib.h>
    -#include <ncurses.h>
    #include "gntbindable.h"