From 56a086484692991a7845425d8023a3650227e4ad Mon Sep 17 00:00:00 2001 From: Bill-Gray Date: Wed, 27 May 2020 21:25:15 -0400 Subject: [PATCH] We can avoid library mislinkages (compiling with, say, 32-bit chtypes and 8-bit characters and linking to a library built with 64-bit chtypes and wide-chars). See issue #133. Implements my 'this _might_ be easier than I thought' approach. --- curses.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/curses.h b/curses.h index 7c13c6b7..e68fb6a2 100644 --- a/curses.h +++ b/curses.h @@ -1338,6 +1338,29 @@ PDCEX int init_color(short, short, short, short); PDCEX int init_extended_color(int, int, int, int); PDCEX int init_extended_pair(int, int, int); PDCEX int init_pair(short, short, short); + +#ifdef PDC_WIDE + #ifdef PDC_FORCE_UTF8 + #ifdef CHTYPE_32 + #define initscr initscr_u32 + #else + #define initscr initscr_u64 + #endif + #else + #ifdef CHTYPE_32 + #define initscr initscr_w32 + #else + #define initscr initscr_w64 + #endif + #endif +#else /* 8-bit chtypes */ + #ifdef CHTYPE_32 + #define initscr initscr_x32 + #else + #define initscr initscr_x64 + #endif +#endif + PDCEX WINDOW *initscr(void); PDCEX int innstr(char *, int); PDCEX int insch(chtype);