min/max definitions converted to inline functions instead of macros

This commit is contained in:
Bahadir Balban
2009-10-20 21:38:15 +03:00
parent 61e41b5fed
commit 224b531de5

View File

@@ -1,8 +1,15 @@
#ifndef __LIB_MATH_H__
#define __LIB_MATH_H__
#define min(x, y) (((x) < (y)) ? (x) : (y))
#define max(x, y) (((x) > (y)) ? (x) : (y))
static inline int min(int x, int y)
{
return x < y ? x : y;
}
static inline int max(int x, int y)
{
return x > y ? x : y;
}
/* Tests if ranges a-b intersect with range c-d */
static inline int set_intersection(unsigned long a, unsigned long b,