Skip to content

standalone: c++ usage in preprocessor evaluation #677

Closed

Description

Compiling for windows on arm64 in standalone mode, I get an error fatal error C1012: unmatched parenthesis: missing ')' at

#if BOOST_MATH_ENDIAN_BIG_BYTE
static constexpr int offset_ = 0;
#elif BOOST_MATH_ENDIAN_LITTLE_BYTE
static constexpr int offset_ = 4;
#else
static_assert(sizeof(double_precision) == 0, "Endian type could not be identified");
#endif
, causing the preprocessor to evaluate a c++ expression from
#elif (__cplusplus > 202000L || _MSVC_LANG > 202000L)
#if __has_include(<bit>)
#include <bit>
#define BOOST_MATH_ENDIAN_BIG_BYTE (std::endian::native == std::endian::big)
#define BOOST_MATH_ENDIAN_LITTLE_BYTE (std::endian::native == std::endian::little)
#endif

I use the arm64 compiler shipped with Visual Studi 2022 Preview 3: Microsoft (R) C/C++ Optimizing Compiler Version 19.30.30423 for ARM64. To reproduce the error one may compile using the STL version including the <bit> header, see github. To reproduce the error it is sufficient to include the corresponding header

#include "boost/math/special_functions/detail/fp_traits.hpp"
int main() { return 0; }

and compile it from the arm64 development environment (ie. cl /nologo -DBOOST_MATH_STANDALONE=1 -Istl\inc -Iboost-math\include /std:c++latest boost-math.cpp).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        翻译: