]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/widechar/charable.c
ncurses 6.1 - patch 20191012
[ncurses.git] / ncurses / widechar / charable.c
index cf7240780883da3081747c8281f8144bedcb52c0..104f59dd8560e37bf2eecc798d83ed4a5a8ded57 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2003-2004,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 2003-2008,2018 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: charable.c,v 1.4 2005/04/16 18:08:56 tom Exp $")
+MODULE_ID("$Id: charable.c,v 1.7 2018/06/30 20:46:25 tom Exp $")
 
 NCURSES_EXPORT(bool) _nc_is_charable(wchar_t ch)
 {
     bool result;
 #if HAVE_WCTOB
-    result = (wctob((wint_t) ch) == ch);
+    result = (wctob((wint_t) ch) == (int) ch);
 #else
     result = (_nc_to_char(ch) >= 0);
 #endif
@@ -57,6 +57,8 @@ NCURSES_EXPORT(int) _nc_to_char(wint_t ch)
        result = UChar(temp[0]);
     else
        result = -1;
+#else
+#error expected either wctob/wctomb
 #endif
     return result;
 }
@@ -75,6 +77,8 @@ NCURSES_EXPORT(wint_t) _nc_to_widechar(int ch)
        result = convert;
     else
        result = WEOF;
+#else
+#error expected either btowc/mbtowc
 #endif
     return result;
 }