LibC: Make makedev()/minor()/major() static

As we've opted to make these inline functions and not macros, let's at
least make sure that the users don't *observe* multiple definitions of
these functions.
This commit is contained in:
Ali Mohammad Pur 2021-07-09 06:27:02 +04:30 committed by Andreas Kling
parent e37f9fa7db
commit 727403746f
Notes: sideshowbarker 2024-07-18 10:00:18 +09:00

View file

@ -89,8 +89,8 @@ typedef struct __pthread_condattr_t {
int clockid; // clockid_t
} pthread_condattr_t;
inline dev_t makedev(unsigned int major, unsigned int minor) { return (minor & 0xffu) | (major << 8u) | ((minor & ~0xffu) << 12u); }
inline unsigned int major(dev_t dev) { return (dev & 0xfff00u) >> 8u; }
inline unsigned int minor(dev_t dev) { return (dev & 0xffu) | ((dev >> 12u) & 0xfff00u); }
static inline dev_t makedev(unsigned int major, unsigned int minor) { return (minor & 0xffu) | (major << 8u) | ((minor & ~0xffu) << 12u); }
static inline unsigned int major(dev_t dev) { return (dev & 0xfff00u) >> 8u; }
static inline unsigned int minor(dev_t dev) { return (dev & 0xffu) | ((dev >> 12u) & 0xfff00u); }
__END_DECLS