This fixes the Win32 build, and the problem Ilya was seeing with Solaris 2.5
where snprintf is also not available.
NOTE: This patch has been committed.
src/ChangeLog addition:
2006-06-14 Aidan Kehoe <kehoea(a)parhasard.net>
* mule-ccl.c:
Don't declare ccl-program as a symbol here, leave that to
general-slots.h.
* unicode.c (unicode_to_ichar):
Use qxesprintf, not snprintf, change some types to allow
complilation on Win32.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: src/unicode.c src/mule-ccl.c
Index: src/mule-ccl.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/mule-ccl.c,v
retrieving revision 1.29
diff -u -u -r1.29 mule-ccl.c
--- src/mule-ccl.c 2006/06/03 17:50:54 1.29
+++ src/mule-ccl.c 2006/06/14 05:59:27
@@ -39,8 +39,9 @@
Lisp_Object Vfont_ccl_encoder_alist;
/* This symbol is a property which associates with ccl program vector.
- Ex: (get 'ccl-big5-encoder 'ccl-program) returns ccl program vector. */
-Lisp_Object Qccl_program;
+ Ex: (get 'ccl-big5-encoder 'ccl-program) returns ccl program vector.
+ Moved to general-slots.h. */
+/* Lisp_Object Qccl_program; */
/* These symbols are properties which associate with code conversion
map and their ID respectively. */
Index: src/unicode.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unicode.c,v
retrieving revision 1.33
diff -u -u -r1.33 unicode.c
--- src/unicode.c 2006/06/03 17:50:55 1.33
+++ src/unicode.c 2006/06/14 05:59:28
@@ -1112,7 +1112,7 @@
if (NILP (Vcurrent_jit_charset) ||
(-1 == (i = get_free_codepoint(Vcurrent_jit_charset))))
{
- Ascbyte setname[32];
+ Ibyte setname[32];
Lisp_Object charset_descr = build_string
("Mule charset for otherwise unknown Unicode code points.");
Lisp_Object charset_regr = build_string("iso10646-1");
@@ -1125,9 +1125,13 @@
last_jit_charset_final = 0x30;
}
- snprintf(setname, sizeof(setname),
- "jit-ucs-charset-%d", number_of_jit_charsets++);
+ /* Assertion added partly because our Win32 layer doesn't
+ support snprintf; with this, we're sure it won't overflow
+ the buffer. */
+ assert(100 > number_of_jit_charsets);
+ qxesprintf(setname, "jit-ucs-charset-%d", number_of_jit_charsets++);
+
/* Aside: GCPROing here would be overkill according to the FSF's
philosophy. make-charset cannot currently GC, but is intended
to be called from Lisp, with its arguments protected by the
@@ -1136,7 +1140,7 @@
GCPRO2 (charset_descr, charset_regr);
Vcurrent_jit_charset = Fmake_charset
- (intern(setname), charset_descr,
+ (intern((const CIbyte *)setname), charset_descr,
/* Set encode-as-utf-8 to t, to have this character set written
using UTF-8 escapes in escape-quoted and ctext. This
sidesteps the fact that our internal character -> Unicode
--
Aidan Kehoe,
http://www.parhasard.net/