From: Lennart Poettering Date: Tue, 19 Mar 2013 19:00:29 +0000 (+0100) Subject: macro: don't redefine CLAMP if it is already defined by glib or some other library X-Git-Tag: v199~140 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=907809fc6a9867869b8a237663af2eda335d333e macro: don't redefine CLAMP if it is already defined by glib or some other library --- diff --git a/src/journal/journal-gatewayd.c b/src/journal/journal-gatewayd.c index 7e29c905e..8161b7e56 100644 --- a/src/journal/journal-gatewayd.c +++ b/src/journal/journal-gatewayd.c @@ -110,7 +110,6 @@ static int open_journal(RequestMeta *m) { return sd_journal_open(&m->journal, SD_JOURNAL_LOCAL_ONLY|SD_JOURNAL_SYSTEM_ONLY); } - static int respond_oom_internal(struct MHD_Connection *connection) { struct MHD_Response *response; const char m[] = "Out of memory.\n"; diff --git a/src/shared/macro.h b/src/shared/macro.h index 90a663b9c..e5c33ce56 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 { \