major/minor(3) macros conflict with regular code
Anthony Mallet <[email protected]> Thu, 6 Feb 2025 23:48:48 +0100
| Newsgroups | gmane.os.netbsd.devel.userlevel |
|---|---|
| Organization | LAAS/CNRS - Toulouse - France |
| Message-ID | <[email protected]> |
Hi, I have some code that defines these methods in a C++ class: int32_t major() const int32_t minor() const (for the context: this is in protobuf generated code from a message that has major/minor fields). The generated code fails to compile because it conflicts with major(3) macro and minor(3) macros from sys/types.h: #define major(x) ((devmajor_t)(((uint32_t)(x) & 0x000fff00) >> 8)) #define minor(x) ... Do major(3) and minor(3) really need to be macros? Thanks, Anthony