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

MSVC build error,maybe conflict with math.h #67

Open
EruditePig opened this issue Apr 28, 2020 · 0 comments
Open

MSVC build error,maybe conflict with math.h #67

EruditePig opened this issue Apr 28, 2020 · 0 comments

Comments

@EruditePig
Copy link

First, Thank you for your effort, It is a great repo~ :)

I compile in windows 10 + Chocolate winbisonflex3 + Cmake. Build sln is OK, but compile has error

C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(963): error C2059: synax error constant

I thought the reason is "HUGE"is a token defined in parser.c and parser.h. However, in math.h it has code below which define HUGE a variable.

#if !__STDC__

    // Non-ANSI names for compatibility
    #define DOMAIN      _DOMAIN
    #define SING        _SING
    #define OVERFLOW    _OVERFLOW
    #define UNDERFLOW   _UNDERFLOW
    #define TLOSS       _TLOSS
    #define PLOSS       _PLOSS

    #define matherr     _matherr

    #ifndef __assembler
        #ifndef _M_CEE_PURE
            extern double HUGE;
        #else
            double const HUGE = _HUGE;
        #endif

        _CRT_NONSTDC_DEPRECATE(_j0) _Check_return_ _ACRTIMP double __cdecl j0(_In_ double _X);
        _CRT_NONSTDC_DEPRECATE(_j1) _Check_return_ _ACRTIMP double __cdecl j1(_In_ double _X);
        _CRT_NONSTDC_DEPRECATE(_jn) _Check_return_ _ACRTIMP double __cdecl jn(_In_ int _X, _In_ double _Y);
        _CRT_NONSTDC_DEPRECATE(_y0) _Check_return_ _ACRTIMP double __cdecl y0(_In_ double _X);
        _CRT_NONSTDC_DEPRECATE(_y1) _Check_return_ _ACRTIMP double __cdecl y1(_In_ double _X);
        _CRT_NONSTDC_DEPRECATE(_yn) _Check_return_ _ACRTIMP double __cdecl yn(_In_ int _X, _In_ double _Y);
    #endif // !__assembler
#endif // !__STDC__

I fix this problem by adding #define STDC 1 in the top of lexer.c file. I don't know whether it is correct way to fix it. So I post a issue to you, Hope can do a little help.

Thank you Again!

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

No branches or pull requests

1 participant