From 41ab295654f4c314da384f62e7765cd29fba7cfa Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Fri, 24 Aug 2012 17:54:07 +0200 Subject: [PATCH] hide block_t behind _MINIX (for gcc) --- include/sys/types.h | 2 ++ kernel/Makefile | 2 +- sys/arch/i386/stand/boot/biosboot/Makefile | 2 ++ sys/arch/i386/stand/bootxx/bootxx_ext2fs/Makefile | 1 + usr.sbin/mkfs.mfs/Makefile | 2 ++ 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/sys/types.h b/include/sys/types.h index 9dcf4fd9d..4e645f4e4 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -114,12 +114,14 @@ typedef u32_t big_nlink_t; typedef u32_t big_uid_t; +#ifdef _MINIX /* some Minix specific types that do not conflict with posix */ typedef u32_t zone_t; /* zone number */ typedef u32_t block_t; /* block number */ typedef u32_t bit_t; /* bit number in a bit map */ typedef u16_t zone1_t; /* zone number for V1 file systems */ typedef u32_t bitchunk_t; /* collection of bits in a bitmap */ +#endif /* ANSI C makes writing down the promotion of unsigned types very messy. When * sizeof(short) == sizeof(int), there is no promotion, so the type stays diff --git a/kernel/Makefile b/kernel/Makefile index d385c26d4..26fef605e 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -15,7 +15,7 @@ LDADD+= -ltimers -lsys -lexec CFLAGS += -D__kernel__ -CPPFLAGS+= -fno-stack-protector -D_NETBSD_SOURCE +CPPFLAGS+= -fno-stack-protector -D_NETBSD_SOURCE -D_MINIX LDFLAGS+= -T $(LINKERSCRIPT) LDFLAGS+= -nostdlib -L${DESTDIR}/${LIBDIR} LDADD+= -lminlib diff --git a/sys/arch/i386/stand/boot/biosboot/Makefile b/sys/arch/i386/stand/boot/biosboot/Makefile index 2d3c99888..7d697f331 100644 --- a/sys/arch/i386/stand/boot/biosboot/Makefile +++ b/sys/arch/i386/stand/boot/biosboot/Makefile @@ -3,4 +3,6 @@ PROG= boot_monitor CLEANFILES= lib +CPPFLAGS+= -D_MINIX + .include <../Makefile.boot> diff --git a/sys/arch/i386/stand/bootxx/bootxx_ext2fs/Makefile b/sys/arch/i386/stand/bootxx/bootxx_ext2fs/Makefile index 6110228d9..2a6418aa3 100644 --- a/sys/arch/i386/stand/bootxx/bootxx_ext2fs/Makefile +++ b/sys/arch/i386/stand/bootxx/bootxx_ext2fs/Makefile @@ -2,5 +2,6 @@ FS=ext2fs CLEANFILES= lib +CPPFLAGS+= -D_MINIX .include <../Makefile.bootxx> diff --git a/usr.sbin/mkfs.mfs/Makefile b/usr.sbin/mkfs.mfs/Makefile index 169888e6b..c9a462e83 100644 --- a/usr.sbin/mkfs.mfs/Makefile +++ b/usr.sbin/mkfs.mfs/Makefile @@ -3,6 +3,8 @@ SRCS= mkfs.c BINDIR= /sbin MAN= +CPPFLAGS+= -D_MINIX + LDADD?= -lminlib -lcompat_minix .include