diff options
author | Alex Richardson <arichardson@FreeBSD.org> | 2020-08-07 16:03:55 +0000 |
---|---|---|
committer | Alex Richardson <arichardson@FreeBSD.org> | 2020-08-07 16:03:55 +0000 |
commit | ec4deee4e4f2aef1b97d9424f25d04e91fd7dc10 (patch) | |
tree | 3febc852497d63cfd3b5951bb9df06bc36cc6c6d /sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h | |
parent | 88d241831d991f7c79242bf0bfe034541d373951 (diff) | |
download | src-ec4deee4e4f2aef1b97d9424f25d04e91fd7dc10.tar.gz src-ec4deee4e4f2aef1b97d9424f25d04e91fd7dc10.zip |
Fix cddl tools bootstrapping on macOS and Linux
Reviewed By: brooks
Differential Revision: https://reviews.freebsd.org/D25979
Notes
Notes:
svn path=/head/; revision=364022
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h b/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h index 675e4893aa1d..7b738c8b0d13 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h @@ -46,8 +46,12 @@ extern "C" { /* * Disk blocks (sectors) and bytes. */ +#ifndef dtob #define dtob(DD) ((DD) << DEV_BSHIFT) +#endif +#ifndef btod #define btod(BB) (((BB) + DEV_BSIZE - 1) >> DEV_BSHIFT) +#endif #define btodt(BB) ((BB) >> DEV_BSHIFT) #define lbtod(BB) (((offset_t)(BB) + DEV_BSIZE - 1) >> DEV_BSHIFT) @@ -220,9 +224,12 @@ extern unsigned char bcd_to_byte[256]; /* * Macros for counting and rounding. */ +#ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) +#endif +#ifndef roundup #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) - +#endif /* * Macro to determine if value is a power of 2 */ |