Skip to content

quickjs is not compatible with ucrt of Windows SDK 26100  #622

Closed
@twinstar6980

Description

@twinstar6980

The macro definition NAN is used in quickjs.c.
https://github.com/quickjs-ng/quickjs/blob/0c8aeb1d5093869479e914980ef5588020bce64a/quickjs.c#L40297

For Windows platform, NAN is defined in ucrt/corecrt_math.h.
In Windows SDK 22621:

#define NAN ((float)(INFINITY * 0.0F))

In this case, the compiler can complete the compilation, but Microsoft has made changes in Windows SDK 26100:

#define _UCRT_NAN (__ucrt_int_to_float(0x7FC00000))
#define NAN _UCRT_NAN

When using SDK 26100, the compiler (msvc-cl 19.41 or clang-cl 19.1) will report an error: C2099 initializer is not a constant.

Is there any way to solve this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions