chiark / gitweb /
macro: don't redefine CLAMP if it is already defined by glib or some other library
authorLennart Poettering <lennart@poettering.net>
Tue, 19 Mar 2013 19:00:29 +0000 (20:00 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 20 Mar 2013 21:58:40 +0000 (22:58 +0100)
src/journal/journal-gatewayd.c
src/shared/macro.h

index 7e29c905e2a191087cafa05452c573f52ce3bd13..8161b7e56bffd26a9b77150d45b1238baae540f1 100644 (file)
@@ -110,7 +110,6 @@ static int open_journal(RequestMeta *m) {
         return sd_journal_open(&m->journal, SD_JOURNAL_LOCAL_ONLY|SD_JOURNAL_SYSTEM_ONLY);
 }
 
         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";
 static int respond_oom_internal(struct MHD_Connection *connection) {
         struct MHD_Response *response;
         const char m[] = "Out of memory.\n";
index 90a663b9cee5bcd4639a79aeca83e1eb358a858c..e5c33ce5617653861dc9f53acae848709c75a864 100644 (file)
@@ -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)
 
 #define MIN3(a,b,c)                             \
         MIN(MIN(a,b),c)
 
+#ifndef CLAMP
 #define CLAMP(x, low, high)                                             \
         __extension__ ({                                                \
                         typeof(x) _x = (x);                             \
 #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)); \
                 })
                         typeof(high) _high = (high);                    \
                         ((_x > _high) ? _high : ((_x < _low) ? _low : _x)); \
                 })
+#endif
 
 #define assert_se(expr)                                                 \
         do {                                                            \
 
 #define assert_se(expr)                                                 \
         do {                                                            \