diff options
author | Jonathan Kew <jfkthame@googlemail.com> | 2007-11-21 12:32:29 +0000 |
---|---|---|
committer | Jonathan Kew <jfkthame@googlemail.com> | 2007-11-21 12:32:29 +0000 |
commit | 17aeed8e129118bdb3b7eb0ef3a18241dcda40eb (patch) | |
tree | d6faebee2c4a64d8e504650b5cb40d78c0c68b56 /Build/source/texk/web2c/lib | |
parent | 952d69f85d43b087ce9fa79d3fc6f1c076000bc7 (diff) |
merged XeTeX 0.997 from SIL repository
git-svn-id: svn://tug.org/texlive/trunk@5537 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/lib')
-rw-r--r-- | Build/source/texk/web2c/lib/texmfmp.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index 09f5f095fae..8a2cc4896d9 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -401,14 +401,7 @@ topenin P1H(void) case 0: ; }; rval -= offsetsFromUTF8[extraBytes]; - /* now rval is a USV; if it's >=64K, we need to put surrogates in the buffer */ - if (rval > 0xFFFF) { - rval -= 0x10000; - buffer[k++] = 0xd800 + rval / 0x0400; - buffer[k++] = 0xdc00 + rval % 0x0400; - } - else - buffer[k++] = rval; + buffer[k++] = rval; } #else char *ptr = &(argv[i][0]); @@ -1810,13 +1803,21 @@ swap_items P3C(char *, p, int, nitems, int, size) OUT_FILE. */ void +#ifdef XeTeX +do_dump P4C(char *, p, int, item_size, int, nitems, gzFile, out_file) +#else do_dump P4C(char *, p, int, item_size, int, nitems, FILE *, out_file) +#endif { #if !defined (WORDS_BIGENDIAN) && !defined (NO_DUMP_SHARE) swap_items (p, nitems, item_size); #endif +#ifdef XeTeX + if (gzwrite (out_file, p, item_size * nitems) != item_size * nitems) +#else if (fwrite (p, item_size, nitems, out_file) != nitems) +#endif { fprintf (stderr, "! Could not write %d %d-byte item(s).\n", nitems, item_size); @@ -1834,9 +1835,17 @@ do_dump P4C(char *, p, int, item_size, int, nitems, FILE *, out_file) /* Here is the dual of the writing routine. */ void +#ifdef XeTeX +do_undump P4C(char *, p, int, item_size, int, nitems, gzFile, in_file) +#else do_undump P4C(char *, p, int, item_size, int, nitems, FILE *, in_file) +#endif { +#ifdef XeTeX + if (gzread (in_file, p, item_size * nitems) != item_size * nitems) +#else if (fread (p, item_size, nitems, in_file) != nitems) +#endif FATAL2 ("Could not undump %d %d-byte item(s)", nitems, item_size); #if !defined (WORDS_BIGENDIAN) && !defined (NO_DUMP_SHARE) |