From 707ae753601d8478a5144878367604b6d8222698 Mon Sep 17 00:00:00 2001 From: tomo Date: Thu, 14 Jun 2001 09:02:32 +0000 Subject: [PATCH] (XCHARVAL): New implementation for UTF-2000 to support U-60000000 .. U-7FFFFFFF with 32 bits architecture. --- src/lisp-disunion.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lisp-disunion.h b/src/lisp-disunion.h index be51957..234c344 100644 --- a/src/lisp-disunion.h +++ b/src/lisp-disunion.h @@ -82,7 +82,21 @@ typedef EMACS_INT Lisp_Object; #define VALMASK (((1UL << VALBITS) - 1UL) << GCTYPEBITS) #define XTYPE(x) ((enum Lisp_Type) (((EMACS_UINT)(x)) & ~VALMASK)) #define XPNTRVAL(x) (x) /* This depends on Lisp_Type_Record == 0 */ +#ifdef UTF2000 +INLINE_HEADER int XCHARVAL (Emchar chr); +INLINE_HEADER int +XCHARVAL (Emchar chr) +{ + int code = (EMACS_UINT)(chr) >> GCBITS; + + if (code & 0x20000000) + return code | 0x40000000; + else + return code; +} +#else #define XCHARVAL(x) ((EMACS_UINT)(x) >> GCBITS) +#endif #define XREALINT(x) ((x) >> INT_GCBITS) #define XUINT(x) ((EMACS_UINT)(x) >> INT_GCBITS) #define INTP(x) ((EMACS_UINT)(x) & Lisp_Type_Int_Bit) -- 1.7.10.4