Changeset 9907acfc7422d52b0fd174f7a20cc41d7896f9a2

Show
Ignore:
Timestamp:
30/10/07 04:42:18 (1 year ago)
Author:
Rafaël Carré <funman@videolan.org>
git-committer:
Rafaël Carré <funman@videolan.org> 1193715738 +0000
git-parent:

[a7cc6c93be03fe91fcc8f06498bf44b032fbddaa]

git-author:
Rafaël Carré <funman@videolan.org> 1193715738 +0000
Message:

ncurses: base detection of wide characters support on the presence of libncursesw, and use the same header wether it's present or not

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • configure.ac

    r632c854 r9907acf  
    53545354dnl 
    53555355AC_ARG_ENABLE(ncurses, 
    5356   [  --disable-ncurses       ncurses interface support (default enabled)], 
     5356  [  --disable-ncurses       ncurses interface support (default auto)], 
    53575357  [if test "${enable_ncurses}" != "no"; then 
    5358      AC_CHECK_HEADERS(ncursesw/curses.h, 
    5359        [AC_CHECK_LIB( ncursesw, mvprintw, 
    5360          [VLC_ADD_PLUGINS([ncurses]) 
    5361          VLC_ADD_LIBS([ncurses],[-lncursesw])]) 
    5362        ], 
    5363        [AC_CHECK_HEADER(curses.h, 
    5364          [AC_CHECK_LIB(ncurses, mvprintw, 
    5365            [VLC_ADD_PLUGINS([ncurses]) 
    5366            VLC_ADD_LIBS([ncurses],[-lncurses])] 
    5367          )] 
    5368        )] 
    5369      )   
    5370    fi]) 
     5358    AC_CHECK_HEADER(ncurses.h, 
     5359      [AC_CHECK_LIB(ncursesw, mvprintw, 
     5360        [VLC_ADD_PLUGINS([ncurses]) 
     5361        VLC_ADD_LIBS([ncurses],[-lncursesw]) 
     5362        AC_DEFINE([HAVE_NCURSESW], 1, [Define to 1 if you have libncursesw.]) 
     5363        ], 
     5364        [AC_CHECK_LIB( ncurses, mvprintw, 
     5365          [VLC_ADD_PLUGINS([ncurses]) 
     5366          VLC_ADD_LIBS([ncurses],[-lncurses])], 
     5367          [AS_IF([test "x${enable_ncurses}" != "x"], [ 
     5368            AC_MSG_ERROR([libncurses not found])])] 
     5369        )] 
     5370      )] 
     5371    ) 
     5372  fi] 
     5373
    53715374 
    53725375dnl 
  • modules/gui/ncurses.c

    rc101253 r9907acf  
    3333#include <time.h> 
    3434 
    35 #ifdef HAVE_NCURSESW_CURSES_H 
    36 #include <ncursesw/curses.h> 
    37 #else 
    38 #include <curses.h> 
     35#ifdef HAVE_NCURSESW 
     36#   define _XOPEN_SOURCE_EXTENDED 1 
    3937#endif 
     38 
     39#include <ncurses.h> 
    4040 
    4141#include <vlc_interface.h> 
     
    438438    psz_part[len] = (char)i_key; 
    439439 
    440 #ifdef HAVE_NCURSESW_CURSES_H 
     440#ifdef HAVE_NCURSESW 
    441441    psz_utf8 = strdup( psz_part ); 
    442442#else 
     
    11521152    char    *p_buf = NULL; 
    11531153    int      i_len; 
    1154 #ifdef HAVE_NCURSESW_CURSES_H 
     1154#ifdef HAVE_NCURSESW 
    11551155    size_t   i_char_len;    /* UCS character length */ 
    11561156    size_t   i_width;       /* Display width */ 
     
    11671167 
    11681168    i_len = strlen( p_buf ); 
    1169 #ifdef HAVE_NCURSESW_CURSES_H 
     1169#ifdef HAVE_NCURSESW 
    11701170    psz_wide = (wchar_t *) malloc( sizeof( wchar_t ) * ( i_len + 1 ) ); 
    11711171 
     
    12001200            p_buf[w/2+1] = '.'; 
    12011201        } 
    1202 #ifdef HAVE_NCURSESW_CURSES_H 
     1202#ifdef HAVE_NCURSESW 
    12031203        mvprintw( y, x, "%s", p_buf ); 
    12041204#else 
     
    12101210    else 
    12111211    { 
    1212 #ifdef HAVE_NCURSESW_CURSES_H 
     1212#ifdef HAVE_NCURSESW 
    12131213        mvprintw( y, x, "%s", p_buf ); 
    12141214        mvhline( y, x + i_width, ' ', w - i_width );