[DVIPDFMx] recent changes in xdvipdfmx

Peter Breitenlohner peb at mppmu.mpg.de
Wed Mar 31 18:45:06 KST 2010


On Tue, 30 Mar 2010, Karl Berry wrote:

>    the recent changes in xdvipdfmx (from mathias?)
>
> ChoF sent me the patch.  I don't know whether he or Matthias actually
> wrote the code.
>
>   #define strdup(s1) (char *) MEM_ADD(strdup(s1))
>
> Clearly a bad mistake.
>
>    Actually strdup() is only used three times in src/dpxfile.c, thus I'd
>    suggest to replace these with mystrdup(), defined similarly as mstrdup()
>    in fontmap.c. Wdyt?
>
> Definitely.  And please send the diff back
> To: dvipdfmx at ktug.or.kr, jonathan at jfkew.plus.com

Hi,

the recent xdvipdfmx changes have caused lots of compiler warnings, because
you #define strdup, redefining a #define in the GNU C lib system headers. 
Attached is the additional change I have applied (TL SVN r17640) to avoid
this.

Would it be possible to have a ChangeLog entry for your mods?

Shouldn't analogous mods be applied to dvipdfmx?  As long as this is kept I'd
prefer that dvipdfmx and xdvipdfmx don't diverge any further.

Regards
Peter Breitenlohner <peb at mppmu.mpg.de>
-------------- next part --------------
diff -ur TeXlive-trunk/Build/source/texk/xdvipdfmx/src/dpxfile.c Work/New/tex-live-2010-02-01/texk/xdvipdfmx/src/dpxfile.c
--- TeXlive-trunk/Build/source/texk/xdvipdfmx/src/dpxfile.c	2009-11-10 11:30:09.000000000 +0100
+++ Work/New/tex-live-2010-02-01/texk/xdvipdfmx/src/dpxfile.c	2010-03-31 10:20:07.162200849 +0200
@@ -44,6 +44,8 @@
 }
 
 
+#define mystrdup(s1)              (char *) MEM_ADD(strdup(s1))
+
 /* Kpathsea library does not check file type. */
 static int qcheck_filetype (const char *fqpn, int type);
 
@@ -538,7 +540,7 @@
   char  *fqpn = NULL;
 
   if (is_absolute_path(filename))
-    fqpn = strdup(filename);
+    fqpn = mystrdup(filename);
   else
     fqpn = kpse_find_file(filename, kpse_type1_format, 0);
   if (fqpn && !qcheck_filetype(fqpn, DPX_RES_TYPE_T1FONT)) {
@@ -556,7 +558,7 @@
   char  *fqpn = NULL;
 
   if (is_absolute_path(filename))
-    fqpn = strdup(filename);
+    fqpn = mystrdup(filename);
   else
     fqpn = kpse_find_file(filename, kpse_truetype_format, 0);
   if (fqpn && !qcheck_filetype(fqpn, DPX_RES_TYPE_TTFONT)) {
@@ -577,7 +579,7 @@
   q = ensuresuffix(filename, ".otf");
 #ifndef MIKTEX
   if (is_absolute_path(q))
-    fqpn = strdup(q);
+    fqpn = mystrdup(q);
   else
     fqpn = kpse_find_file(q, kpse_opentype_format, 0);
   if (!fqpn) {
diff -ur TeXlive-trunk/Build/source/texk/xdvipdfmx/src/mem.h Work/New/tex-live-2010-02-01/texk/xdvipdfmx/src/mem.h
--- TeXlive-trunk/Build/source/texk/xdvipdfmx/src/mem.h	2010-03-31 10:08:56.000000000 +0200
+++ Work/New/tex-live-2010-02-01/texk/xdvipdfmx/src/mem.h	2010-03-31 10:09:31.783578350 +0200
@@ -63,5 +63,4 @@
 #define kpse_find_file(x,y,z)     (char *) MEM_ADD(kpse_find_file(x,y,z))
 #define kpse_find_glyph(x,y,z,w)  (char *) MEM_ADD(kpse_find_glyph(x,y,z,w))
 
-#define strdup(s1)                (char *) MEM_ADD(strdup(s1))
 #endif /* _MEM_H_ */


More information about the dvipdfmx mailing list