From d7f366bbd6165f743d507912dfcfeb10f2a304ac Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sat, 17 Nov 2018 07:32:49 +0000 Subject: Support some primitives from pdfTeX in XeTeX (Joseph Wright) git-svn-id: svn://tug.org/texlive/trunk@49176 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/lib/ChangeLog | 4 ++++ Build/source/texk/web2c/lib/texmfmp.c | 40 +++++++++++++++-------------------- 2 files changed, 21 insertions(+), 23 deletions(-) (limited to 'Build/source/texk/web2c/lib') diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog index 37002a0a0f5..823ef735157 100644 --- a/Build/source/texk/web2c/lib/ChangeLog +++ b/Build/source/texk/web2c/lib/ChangeLog @@ -1,3 +1,7 @@ +2018-11-17 Joseph Wright + + * texmfmp.c: Support some primitives from pdfTeX in XeTeX. + 2018-11-14 Andreas Scherer * printversion.c: free xmalloc'd prog_name. diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index 3b5e1ddb235..7a253cf7373 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -151,7 +151,22 @@ char *generic_synctex_get_current_name (void) #if !IS_pTeX FILE *Poptr; #endif -#endif +#undef fopen +#undef xfopen +#define fopen fsyscp_fopen +#define xfopen fsyscp_xfopen +#include +int fsyscp_stat(const char *path, struct stat *buffer) +{ + wchar_t *wpath; + int ret; + wpath = get_wstring_from_mbstring(file_system_codepage, + path, wpath = NULL); + ret = _wstat(wpath, buffer); + free(wpath); + return ret; +} +#endif /* WIN32 */ #if defined(TeX) || (defined(MF) && defined(WIN32)) static int @@ -1379,24 +1394,6 @@ tcx_get_num (int upb, /* FIXME: A new format ought to be introduced for these files. */ -#ifdef _WIN32 -#undef fopen -#undef xfopen -#define fopen fsyscp_fopen -#define xfopen fsyscp_xfopen -#include -int fsyscp_stat(const char *path, struct stat *buffer) -{ - wchar_t *wpath; - int ret; - wpath = get_wstring_from_mbstring(file_system_codepage, - path, wpath = NULL); - ret = _wstat(wpath, buffer); - free(wpath); - return ret; -} -#endif /* WIN32 */ - void readtcxfile (void) { @@ -2322,7 +2319,7 @@ WARNING1 ("invalid value (expected 0 or 1) for environment variable $FORCE_SOURC } } -#if defined(pdfTeX) || defined(epTeX) || defined(eupTeX) +#if defined(pdfTeX) || defined(epTeX) || defined(eupTeX) || defined(XeTeX) /* Getting a high resolution time. */ @@ -3010,8 +3007,6 @@ void pdftex_fail(const char *fmt, ...) } #endif /* not pdfTeX */ -#if !defined(XeTeX) - #define TIME_STR_SIZE 30 char start_time_str[TIME_STR_SIZE]; static char time_str[TIME_STR_SIZE]; @@ -3280,7 +3275,6 @@ void getfiledump(integer s, int offset, int length) } xfree(file_name); } -#endif /* not XeTeX */ /* Converts any given string in into an allowed PDF string which is * hexadecimal encoded; -- cgit v1.2.3