From 935613d082467928bceff4f7318f5543f6db4f24 Mon Sep 17 00:00:00 2001 From: Greg Haerr Date: Sat, 9 Sep 2023 20:22:23 -0700 Subject: [PATCH] Fixup setup.S build --- elks/include/linuxmt/kdev_t.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/elks/include/linuxmt/kdev_t.h b/elks/include/linuxmt/kdev_t.h index 5c8959b92..07b46a8a2 100644 --- a/elks/include/linuxmt/kdev_t.h +++ b/elks/include/linuxmt/kdev_t.h @@ -4,11 +4,17 @@ /* Some programs want their definitions of MAJOR and MINOR and MKDEV * from the kernel sources. Here we use unsigned short instead of __u16. */ +#ifdef __ASSEMBLER__ +#define _CAST_U16 +#else +#define _CAST_U16 (unsigned short) +#endif + #define MINORBITS 8 #define MINORMASK ((1 << MINORBITS) - 1) -#define MAJOR(dev) ((unsigned short) ((dev) >> MINORBITS)) -#define MINOR(dev) ((unsigned short) ((dev) & MINORMASK)) -#define MKDEV(major,minor) ((unsigned short) (((major) << MINORBITS) | (minor))) +#define MAJOR(dev) (_CAST_U16 ((dev) >> MINORBITS)) +#define MINOR(dev) (_CAST_U16 ((dev) & MINORMASK)) +#define MKDEV(major,minor) (_CAST_U16 (((major) << MINORBITS) | (minor))) #define NODEV MKDEV(0,0) #if defined(__KERNEL__) && !defined(__ASSEMBLER__)