Skip to content

#define PAL overrides namespace projectNamespace::PAL #1250

Description

@pablo-msft

Problem line: https://github.com/microsoft/cpp_client_telemetry/blame/5068a981e2dc6ebe935e3184c011a1d8edfd6e8a/lib/include/public/ctmacros.hpp#L11

In our project, we have code like:

namespace projectName::PAL {
    class Object {};
}

namespace projectName {
    PAL::Object; // or projectName::PAL::Object - exact same compiler error message
}

When I #include LogManager.hpp, the compiler reports:

error C2039: 'Object': is not a member of 'Microsoft::Applications::Events::PlatformAbstraction'

This telemetry library should try to avoid global namespace conflicts, of which PAL is one, by appending a prefix like MAT_PAL or similar. Additionally, the library should additionally shy away from utilizing macros as namespaces, such as with PAL::getUtcSystemTimeMs() in the library code.

Activity

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions