Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support MSYS2 UCRT64 environment #308

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions server/autobuild
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,16 @@ os_msys2() {
mingw-w64-i686-toolchain
mingw-w64-i686-openssl
mingw-w64-i686-zlib" ;;
UCRT64)
PACKAGES="base-devel
autoconf
automake
mingw-w64-ucrt-x86_64-libpng
mingw-w64-ucrt-x86_64-poppler
mingw-w64-ucrt-x86_64-imagemagick
mingw-w64-ucrt-x86_64-toolchain
mingw-w64-ucrt-x86_64-openssl
mingw-w64-ucrt-x86_64-zlib" ;;
MSYS)
case $(uname -m) in
x86_64)
Expand Down
2 changes: 1 addition & 1 deletion server/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ AC_COMPILE_IFELSE(
AM_CONDITIONAL(HAVE_W32, [test "$have_w32" = true])

if test "$have_w32" = true; then
if test "$MSYSTEM" = MINGW32 -o "$MSYSTEM" = MINGW64; then
if test "$MSYSTEM" = MINGW32 -o "$MSYSTEM" = MINGW64 -o "$MSYSTEM" = UCRT64; then
# glib won't work properly on msys2 without it.
CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $CFLAGS"
fi
Expand Down
12 changes: 5 additions & 7 deletions server/synctex_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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
Expand Down