Open
Description
No macro in the core headers are prefixed! This leads to macro errors in user-made libraries.
For example, instead of
#define TEST_MODE 2
in the USBCore.h, something like
#define ARDUINO_TEST_MODE 2
should have been used.
Real life example. I wrote a library with a scope enum like:
enum class Test
{
TEST_MODE = 0x80
}
TEST_MODE
is the name of the variable as defined in the documentations of the device that needed programming.
No errors were reported from the GCC Compiler on other Arduino except on the Nano, which supports the USB. The USBCore.h header gets included automatically overlapping the #define TEST_MODE 2
as mentioned before with the enum TEST_MODE
.
Prefixing macros and types are considered good practices, and should be a required considering the number of user-made libraries that the Arduino has.
Metadata
Metadata
Assignees
Labels
No labels