texlive[59914] Build/source/texk: pdftexdir, chktex: Avoid MSVC

commits+hironobu at tug.org commits+hironobu at tug.org
Tue Jul 13 12:59:14 CEST 2021


Revision: 59914
          http://tug.org/svn/texlive?view=revision&revision=59914
Author:   hironobu
Date:     2021-07-13 12:59:14 +0200 (Tue, 13 Jul 2021)
Log Message:
-----------
pdftexdir, chktex: Avoid MSVC compiler error C2059 for regex/regexec.c

Modified Paths:
--------------
    trunk/Build/source/texk/chktex/ChangeLog
    trunk/Build/source/texk/chktex/regex/regexec.c
    trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
    trunk/Build/source/texk/web2c/pdftexdir/regex/regexec.c

Modified: trunk/Build/source/texk/chktex/ChangeLog
===================================================================
--- trunk/Build/source/texk/chktex/ChangeLog	2021-07-13 10:52:31 UTC (rev 59913)
+++ trunk/Build/source/texk/chktex/ChangeLog	2021-07-13 10:59:14 UTC (rev 59914)
@@ -1,5 +1,14 @@
 2021-07-13  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
+	* regex/regexec.c: Avoid MSVC compiler error.
+	-> error C2059: syntax error: ':'
+	MSVC does not allow empty expression for ternary
+	conditional operator (?:) which is a GNU C extension.
+	https://gcc.gnu.org/onlinedocs/gcc/Conditionals.html
+	https://stackoverflow.com/questions/3319075/
+
+2021-07-13  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
 	* regex/regex_internal.h: sync with pdftexdir/regex 2017-02-16.
 
 2017-03-27  Karl Berry  <karl at freefriends.org>

Modified: trunk/Build/source/texk/chktex/regex/regexec.c
===================================================================
--- trunk/Build/source/texk/chktex/regex/regexec.c	2021-07-13 10:52:31 UTC (rev 59913)
+++ trunk/Build/source/texk/chktex/regex/regexec.c	2021-07-13 10:59:14 UTC (rev 59914)
@@ -2866,7 +2866,11 @@
 	      sizeof (re_dfastate_t *) * (path->alloc - old_alloc));
     }
 
+#ifdef _MSC_VER
+  str_idx = path->next_idx ? path->next_idx : top_str;
+#else
   str_idx = path->next_idx ?: top_str;
+#endif
 
   /* Temporary modify MCTX.  */
   backup_state_log = mctx->state_log;

Modified: trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2021-07-13 10:52:31 UTC (rev 59913)
+++ trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2021-07-13 10:59:14 UTC (rev 59914)
@@ -1,3 +1,12 @@
+2021-07-13  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* regex/regexec.c: Avoid MSVC compiler error.
+	-> error C2059: syntax error: ':'
+	MSVC does not allow empty expression for ternary
+	conditional operator (?:) which is a GNU C extension.
+	https://gcc.gnu.org/onlinedocs/gcc/Conditionals.html
+	https://stackoverflow.com/questions/3319075/
+
 2021-02-17  Karl Berry  <karl at tug.org>
 
         * NEWS,

Modified: trunk/Build/source/texk/web2c/pdftexdir/regex/regexec.c
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/regex/regexec.c	2021-07-13 10:52:31 UTC (rev 59913)
+++ trunk/Build/source/texk/web2c/pdftexdir/regex/regexec.c	2021-07-13 10:59:14 UTC (rev 59914)
@@ -2866,7 +2866,11 @@
 	      sizeof (re_dfastate_t *) * (path->alloc - old_alloc));
     }
 
+#ifdef _MSC_VER
+  str_idx = path->next_idx ? path->next_idx : top_str;
+#else
   str_idx = path->next_idx ?: top_str;
+#endif
 
   /* Temporary modify MCTX.  */
   backup_state_log = mctx->state_log;



More information about the tex-live-commits mailing list.