Skip to content

Build with latest GSL fails in Visual Studio Community 2022 due to defines and namespaces #1034

@peterdell

Description

@peterdell

Using the latest version of GSL results in errors because VS truncates the names of defines:
Workaround defines are too long for MS Visual Studio Community 2022

#define GSL_MSVC_USE_STL_NOEXCEPTION_WORKAROUND

must be shorted to GSL_MSVC_USE_STL_NOEXCEPTION_WO
Likewise

#if defined(GSL_USE_STATIC_CONSTEXPR_WORKAROUND)

must be shortened. I've used #if defined(GSL_USE_STATIC_CONSTEXPR_WO).

Still then the build warns about with
1>lib\gsl/util(28): warning RC4067: unexpected characters following '#if/#elif' directive; newline expected
1>
1>lib\gsl/util(28): warning RC4067: unexpected characters following '#if/#elif' directive; newline expected
1>
#if defined(__has_include) && __has_include()

and then fails with

1>lib\gsl/assert(92): error RC2104: undefined keyword or key name: namespace

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