# mingw-w64: pass \-D\_\_USE_MINGW_ANSI_STDIO=0 for crt files · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b020d83265b10544f4f1f4da1502dba0ebb445d6)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b020d83265b10544f4f1f4da1502dba0ebb445d6

Requested commit: b020d83265b10544f4f1f4da1502dba0ebb445d6

Commit: b020d83265b10544f4f1f4da1502dba0ebb445d6

Tree: f87585d7728cf310b227dd9a89e2a52a5e88e126

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
mingw-w64: pass -D__USE_MINGW_ANSI_STDIO=0 for crt files

Thanks to Martin Storsjö for explaining this to me on IRC:

__USE_MINGW_ANSI_STDIO redirects stdio functions towards mingw-w64
reimplementations of them (since msvcrt.dll lacks lots of things). For
x86 with "long double", this is also needed to get long doubles
formatted properly. It's enabled by default by headers when building in
C99 mode, unless you're targeting UCRT. The headers normally enable this
automatically - or you can request it enabled with
-D__USE_MINGW_ANSI_STDIO=1. However, the mingw-w64-crt files are
expected to be built with this explicitly turned off. Since there's a
half dozen various ways of configuring the CRT and various features, the
mingw-w64-crt files specifically need to be built in a very hardcoded
configuration, which is different from how end user source files are
compiled.

This commit removes a patch that we were carrying previously.

See #7356

```

## Parents

- [3108b8010ecfd9fc7bc9734af357700b8b913f71](https://git.cafe/gitcafe/zig/commit/3108b8010ecfd9fc7bc9734af357700b8b913f71?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b020d83265b10544f4f1f4da1502dba0ebb445d6?format=markdown)
