summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-07-14 23:11:06 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-07-14 23:11:06 +0000
commit669ba1738d22ab82992dcd0acffb750658dbe285 (patch)
treeb1eead7578e2ca21465806a3614d52f6bb7a9d56 /Build/source/texk/web2c
parent30a4991ffa9520c61759398d2991bce1d8b3c88c (diff)
synctexdir: Support Visual Studio 2015
git-svn-id: svn://tug.org/texlive/trunk@44800 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r--Build/source/texk/web2c/synctexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser.c29
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex_parser_utils.c12
3 files changed, 40 insertions, 6 deletions
diff --git a/Build/source/texk/web2c/synctexdir/ChangeLog b/Build/source/texk/web2c/synctexdir/ChangeLog
index bf216d4c8bf..d5985f1f45e 100644
--- a/Build/source/texk/web2c/synctexdir/ChangeLog
+++ b/Build/source/texk/web2c/synctexdir/ChangeLog
@@ -1,3 +1,8 @@
+2017-07-14 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * synctex_parser.c, synctex_parser_util.c: Support
+ Visual Studio 2015.
+
2017-04-24 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
* synctex-ep-mem.ch0, synctex-p-mem.ch0,
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser.c b/Build/source/texk/web2c/synctexdir/synctex_parser.c
index 6ba424a272a..5f044a5ffa3 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser.c
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser.c
@@ -537,7 +537,7 @@ typedef struct synctex_reader_t {
int size;
int lastv;
int line_number;
- SYNCTEX_DECLARE_CHAR_OFFSET;
+ SYNCTEX_DECLARE_CHAR_OFFSET
} synctex_reader_s;
typedef synctex_reader_s * synctex_reader_p;
@@ -783,7 +783,7 @@ synctex_reader_p synctex_reader_init_with_output_file(synctex_reader_p reader, c
}
# if defined(SYNCTEX_USE_HANDLE)
-# define SYNCTEX_DECLARE_HANDLE synctex_node_p handle
+# define SYNCTEX_DECLARE_HANDLE synctex_node_p handle;
# else
# define SYNCTEX_DECLARE_HANDLE
# endif
@@ -799,8 +799,8 @@ synctex_reader_p synctex_reader_init_with_output_file(synctex_reader_p reader, c
*/
struct synctex_scanner_t {
synctex_reader_p reader;
- SYNCTEX_DECLARE_NODE_COUNT;
- SYNCTEX_DECLARE_HANDLE;
+ SYNCTEX_DECLARE_NODE_COUNT
+ SYNCTEX_DECLARE_HANDLE
char * output_fmt; /* dvi or pdf, not yet used */
synctex_iterator_p iterator;/* result iterator */
int version; /* 1, not yet used */
@@ -8160,6 +8160,27 @@ static int _synctex_updater_print(synctex_updater_p updater, const char * format
}
return result;
}
+#if defined(_MSC_VER)
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+static int vasprintf(char **ret,
+ const char *format,
+ va_list ap)
+{
+ int len;
+ len = _vsnprintf(NULL, 0, format, ap);
+ if (len < 0) return -1;
+ *ret = malloc(len + 1);
+ if (!*ret) return -1;
+ _vsnprintf(*ret, len+1, format, ap);
+ (*ret)[len] = '\0';
+ return len;
+}
+
+#endif
+
/**
* gzvprintf is not available until OSX 10.10
*/
diff --git a/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c b/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c
index 95a4df5dc55..4016df0d0cf 100644
--- a/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c
+++ b/Build/source/texk/web2c/synctexdir/synctex_parser_utils.c
@@ -60,9 +60,7 @@
#define SYNCTEX_OS2 1
#endif
-#ifdef _WIN32_WINNT_WINXP
#define SYNCTEX_RECENT_WINDOWS 1
-#endif
#ifdef SYNCTEX_WINDOWS
#include <windows.h>
@@ -83,7 +81,9 @@ void _synctex_free(void * ptr) {
}
}
+#if !defined(_MSC_VER)
# include <syslog.h>
+#endif
int _synctex_log(int level, const char * prompt, const char * reason,va_list arg) {
int result;
@@ -135,7 +135,11 @@ int _synctex_error(const char * reason,...) {
va_list arg;
int result;
va_start (arg, reason);
+#if defined(SYNCTEX_RECENT_WINDOWS) /* LOG_ERR is not used */
+ result = _synctex_log(0, "! SyncTeX Error : ", reason, arg);
+#else
result = _synctex_log(LOG_ERR, "! SyncTeX Error : ", reason, arg);
+#endif
va_end (arg);
return result;
}
@@ -144,7 +148,11 @@ int _synctex_debug(const char * reason,...) {
va_list arg;
int result;
va_start (arg, reason);
+#if defined(SYNCTEX_RECENT_WINDOWS) /* LOG_DEBUG is not used */
+ result = _synctex_log(0, "! SyncTeX Error : ", reason, arg);
+#else
result = _synctex_log(LOG_DEBUG, "! SyncTeX Error : ", reason, arg);
+#endif
va_end (arg);
return result;
}