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

Conversation

legends2k
Copy link

UCRT64 is the newer MSYS2 environment compared to MINGW{32,64}. This
is the recommended default 1.

If you are unsure, go with UCRT64.

MinGW’s compiler (GCC 14.2.0) errors out compiling `synctex_parser.c`.

```
synctex_parser.c: In function '_synctex_updater_print_gz':
synctex_parser.c:8448:13: error: implicit declaration of function
'vasprintf'; did you mean 'vsprintf'?
  8448 |     if (vasprintf(&buffer, format, va) < 0) {
    |       ^~~~~~~~~
    |       vsprintf
```

`vasprintf` is a custom function (not the standard `vsprintf`) that’s
defined in the same translation unit a few lines above.

However its definition is wrapped within a `if defined(_MSC_VER)`
i.e. it’s only enabled when compiled with MSVC compiler.  This fix
enables it also for MinGW compilers.
`vasprintf` is a function available on Linux and macOS but not in
Windows.  Instead of restricting it for MSVC and MinGW, enable it for
all compilers using standard C library function `vsnprintf`.
UCRT64 is the newer MSYS2 environment compared to MINGW{32,64}.  This
is the recommended default [1].

> If you are unsure, go with UCRT64.

[1]: https://www.msys2.org/docs/environments/
@legends2k
Copy link
Author

Note: This PR is a superset of #295.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant