diff options
Diffstat (limited to 'include/common.h')
-rw-r--r-- | include/common.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h index a950cdcc4..d9d5702a9 100644 --- a/include/common.h +++ b/include/common.h @@ -81,6 +81,18 @@ typedef void (interrupt_handler_t)(void *); /* + * General Purpose Utilities + */ +#define min(X, Y) \ + ({ typeof (X) __x = (X), __y = (Y); \ + (__x < __y) ? __x : __y; }) + +#define max(X, Y) \ + ({ typeof (X) __x = (X), __y = (Y); \ + (__x > __y) ? __x : __y; }) + + +/* * Function Prototypes */ |