]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/curses.priv.h
ncurses 5.9 - patch 20121222
[ncurses.git] / ncurses / curses.priv.h
index e04b22710b488959c8db1df16b198e6b5a5c86ed..cebf4ad655373f9bf76d526a5f9cc9b8f296a7cd 100644 (file)
@@ -34,7 +34,7 @@
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.507 2012/10/27 21:23:14 tom Exp $
+ * $Id: curses.priv.h,v 1.515 2012/12/22 21:20:22 tom Exp $
  *
  *     curses.priv.h
  *
@@ -184,17 +184,6 @@ extern int errno;
 extern NCURSES_EXPORT(int) _nc_env_access (void);
 #endif
 
-/*
- * Not all platforms have memmove; some have an equivalent bcopy.  (Some may
- * have neither).
- */
-#if USE_OK_BCOPY
-#define memmove(d,s,n) bcopy(s,d,n)
-#elif USE_MY_MEMMOVE
-#define memmove(d,s,n) _nc_memmove(d,s,n)
-extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t);
-#endif
-
 /*
  * If we have va_copy(), use it for assigning va_list's.
  */
@@ -1219,6 +1208,7 @@ struct screen {
         * UTF-8, but do not permit ACS at the same time (see tty_update.c).
         */
        bool            _screen_acs_fix;
+       bool            _screen_unicode;
 #endif
 
        bool            _use_tioctl;
@@ -1429,7 +1419,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
                                AttrOf(dst) |= (attr_t) (ext + 1)
 
 #define if_WIDEC(code)  code
-#define Charable(ch)   ((SP_PARM != 0 && SP_PARM->_legacy_coding)      \
+#define Charable(ch)   ((SP_PARM->_legacy_coding)                      \
                         || (AttrOf(ch) & A_ALTCHARSET)                 \
                         || (!isWidecExt(ch) &&                         \
                             (ch).chars[1] == L'\0' &&                  \
@@ -2049,6 +2039,24 @@ extern NCURSES_EXPORT(int) _nc_eventlist_timeout(_nc_eventlist *);
  * Wide-character macros to hide some platform-differences.
  */
 #if USE_WIDEC_SUPPORT
+
+#if defined(__MINGW32__)
+/*
+ * MinGW has wide-character functions, but they do not work correctly.
+ */
+
+extern int __MINGW_NOTHROW _nc_wctomb(char *, wchar_t);
+#define wctomb(s,wc) _nc_wctomb(s,wc)
+#define wcrtomb(s,wc,n) _nc_wctomb(s,wc)
+
+extern int __MINGW_NOTHROW _nc_mbtowc(wchar_t *, const char *, size_t);
+#define mbtowc(pwc,s,n) _nc_mbtowc(pwc,s,n)
+
+extern int __MINGW_NOTHROW _nc_mblen(const char *, size_t);
+#define mblen(s,n) _nc_mblen(s, n)
+
+#endif /* __MINGW32__ */
+
 #if HAVE_MBTOWC && HAVE_MBLEN
 #define reset_mbytes(state) IGNORE_RC(mblen(NULL, (size_t) 0)), IGNORE_RC(mbtowc(NULL, NULL, (size_t) 0))
 #define count_mbytes(buffer,length,state) mblen(buffer,length)
@@ -2063,7 +2071,8 @@ extern NCURSES_EXPORT(int) _nc_eventlist_timeout(_nc_eventlist *);
 #else
 make an error
 #endif
-#endif
+
+#endif /* USE_WIDEC_SUPPORT */
 
 /*
  * Not everyone has vsscanf(), but we'd like to use it for scanw().
@@ -2152,9 +2161,9 @@ extern NCURSES_EXPORT(int) _nc_get_tty_mode(TTY *);
 
 #define SetSafeOutcWrapper(outc)           \
     SCREEN* sp = CURRENT_SCREEN;            \
+    struct screen outc_wrapper;                    \
     if (sp==0) {                            \
-       struct screen dummy;                \
-       sp = &dummy;                        \
+       sp = &outc_wrapper;                 \
        memset(sp,0,sizeof(struct screen)); \
        sp->_outch = _nc_outc_wrapper;      \
     }\