From: tomo Date: Thu, 14 Jun 2001 09:02:32 +0000 (+0000) Subject: (XCHARVAL): New implementation for UTF-2000 to support U-60000000 X-Git-Tag: r21-2-38-utf-2000-0_17-1~591 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=707ae753601d8478a5144878367604b6d8222698;p=chise%2Fxemacs-chise.git (XCHARVAL): New implementation for UTF-2000 to support U-60000000 .. U-7FFFFFFF with 32 bits architecture. --- 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)