Skip to content

Avoid creating constants and macros in the global namespace #315

Open
@alranel

Description

@alranel

This library defines some constants in the global namespace, such as the following ones:

typedef enum
{
READ = 0x01,
WRITE = 0x02,
READWRITE = READ | WRITE
} permissionType;

This generates errors whenever they are also defined by other libraries, preventing their coexistence. For instance, the ArduinoBLE library defines both READ and WRITE (not anymore, constants were renamed in ArduinoBLE) and in general it is very likely to find constants named like this.

It would be nice to avoid polluting the global namespace, obviously in a retrocompatible way...

Additional context

Additional reports

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions