summaryrefslogtreecommitdiff
path: root/server/synctex_parser.c
diff options
context:
space:
mode:
authorSundaram Ramaswamy <legends2k@yahoo.com>2025-12-28 22:42:56 +0530
committerGitHub <noreply@github.com>2025-12-28 22:42:56 +0530
commit93b008ac73006119b207ef4e6b96d335c9800b69 (patch)
treeb6b3e63fd340710109362aacbb1a6fa589c2d759 /server/synctex_parser.c
parent22a80257aa34a91d209f5ca9ae4dfcdd13ca8c2e (diff)
feat(server): add MSYS2 UCRT64 environment support
Support the newer UCRT64 MSYS2 environment (recommended default per msys2.org). - Add UCRT64 detection to server/autobuild - Fix vasprintf implicit declaration error on Windows (synctex_parser.c) - Update configure.ac for Windows compatibility Fixes #282, #286 Supersedes #295 Tested by multiple users on Windows 10/11 with MSYS2. Co-authored-by: legends2k
Diffstat (limited to 'server/synctex_parser.c')
-rw-r--r--server/synctex_parser.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/server/synctex_parser.c b/server/synctex_parser.c
index 27be608..865c629 100644
--- a/server/synctex_parser.c
+++ b/server/synctex_parser.c
@@ -8415,7 +8415,8 @@ static int _synctex_updater_print(synctex_updater_p updater, const char * format
}
return result;
}
-#if defined(_MSC_VER)
+#if defined(_WIN32)
+// define vasprintf as it’s available only on Linux and macOS.
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -8424,17 +8425,14 @@ static int vasprintf(char **ret,
const char *format,
va_list ap)
{
- int len;
- len = _vsnprintf(NULL, 0, format, ap);
+ int 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;
+ return vsnprintf(*ret, len + 1, format, ap);
}
-#endif
+#endif // _WIN32
/**
* gzvprintf is not available until OSX 10.10