Consolidate XChar2b macros for the X, W32, and NS
Suggested by Jan Djärv in:
https://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00203.html
- * w32gui.h (XChar2b, STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2):
- Move the fallback definitions to dispextern.h.
- * nsgui.h (XChar2b, STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2):
- Likewise. Share the same definition with W32.
+ * w32gui.h (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): Move the
+ fallback definitions to dispextern.h.
+ * nsgui.h (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): Likewise.
+ Share the same definition with W32.
* xterm.h (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2): Move to ...
* dispextern.h (STORE_XCHAR2B, XCHAR2B_BYTE1, XCHAR2B_BYTE2):
... here for the consistency with W32 and NS.
char pad;
} XColor;
-typedef unsigned short XChar2b;
-
#define STORE_XCHAR2B(chp, b1, b2) \
(*(chp) = ((XChar2b)((((b1) & 0x00ff) << 8) | ((b2) & 0x00ff))))
int descent;
} XCharStruct;
+/* Fake structure from Xlib.h to represent two-byte characters. */
+#ifdef HAVE_NS
+#ifndef __OBJC__
+typedef unsigned short unichar;
+#endif
+typedef unichar XChar2b;
+#endif
+
/* XXX: xfaces requires these structures, but the question is are we
forced to use them? */