According to the C++ standard those names shouldn't be reserved to the implementation and thus be available.
According to man 3 makedev
:
The makedev(), major(), and minor() functions are not specified in POSIX.1, but are present on many other systems
and
These interfaces are defined as macros. Since glibc 2.3.3, they have been aliases for three GNU-specific functions: gnu_dev_makedev(), gnu_dev_major(), and gnu_dev_minor(). The latter names are exported, but the traditional names are more portable.
It seems that they aren't removed for backward compatibility (e.g. https://bugzilla.redhat.com/show_bug.cgi?id=130601).
I think you could #undef
them without major issues (many projects proceed in this way).
With G++/CLANG/MSVC you could also do something like:
#pragma push_macro("minor")
#undef minor
// do what you need
#pragma pop_macro("minor")
It's ugly, but helps with naming conflicts.
Moreover, depending on how your code is structured, this trick can be useful:
#define minor(dev) gnu_dev_major(dev)
void (minor)(int row, int col) { /* ... */ }
In the function definition line, the character after 'minor' is a close parenthesis, so it is not a macro invocation.