diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-03-19 20:00:29 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-03-20 22:58:40 +0100 |
commit | 907809fc6a9867869b8a237663af2eda335d333e (patch) | |
tree | 1e163c43cd4869947f575ce78c9fab0e4c8beda5 /src/shared/macro.h | |
parent | d34cd374905a40e65769351a2808b741b5418bf1 (diff) |
macro: don't redefine CLAMP if it is already defined by glib or some other library
Diffstat (limited to 'src/shared/macro.h')
-rw-r--r-- | src/shared/macro.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/macro.h b/src/shared/macro.h index 90a663b9ce..e5c33ce561 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -92,6 +92,7 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) { #define MIN3(a,b,c) \ MIN(MIN(a,b),c) +#ifndef CLAMP #define CLAMP(x, low, high) \ __extension__ ({ \ typeof(x) _x = (x); \ @@ -99,6 +100,7 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) { typeof(high) _high = (high); \ ((_x > _high) ? _high : ((_x < _low) ? _low : _x)); \ }) +#endif #define assert_se(expr) \ do { \ |