# cbe: nan builtins on msvc, fixup C2099 errors in static initializers · gitcafe/zig

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

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

Visibility: public

Requested revision: 7f3bc45772d6af33e0e663ba534eba5653792843

Requested commit: 7f3bc45772d6af33e0e663ba534eba5653792843

Commit: 7f3bc45772d6af33e0e663ba534eba5653792843

Tree: abcb77b390eecffcc1822de31d64c5773429d8e6

Author: kcbanner

Committer: kcbanner

## Message

```
cbe: nan builtins on msvc, fixup C2099 errors in static initializers

- Map the __builtin_nan(f|l)? functions to nan(f|l)? on msvc
- MSVC throws C2099 when initializing a struct with cast syntax
in a global initializer.  Added zig_as_init_  to handle this case,
 and generate it only in static initializers for > 64 bit ints.
- Change float initialization to emit the integer representation
in global initializers to avoid C2099 caused by calling nan.

```

## Parents

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

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