Skip to content
Browse files

Fix compile error on OSX

OSX defines a macro MIN which conflicts with our private one.

Reported by Erkki Eilonen
  • Loading branch information...
1 parent 530cbb4 commit 0414a9c5fbd552282b316e5afb619cb3480f1670 @gnosek committed Jan 17, 2008
Showing with 3 additions and 3 deletions.
  1. +3 −3 ngx_http_upstream_fair_module.c
View
6 ngx_http_upstream_fair_module.c
@@ -419,7 +419,7 @@ ngx_http_upstream_fair_update_nreq(ngx_http_upstream_fair_peer_data_t *fp, int d
#define SCHED_NREQ_MAX ((~0UL) >> SCHED_TIME_BITS)
#define SCHED_TIME_MAX ((1 << SCHED_TIME_BITS) - 1)
#define SCHED_SCORE(nreq,delta) (((nreq) << SCHED_TIME_BITS) | (~(delta)))
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#define ngx_upstream_fair_min(a,b) (((a) < (b)) ? (a) : (b))
static ngx_uint_t
ngx_http_upstream_fair_sched_score(ngx_peer_connection_t *pc,
@@ -445,8 +445,8 @@ ngx_http_upstream_fair_sched_score(ngx_peer_connection_t *pc,
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0, "[upstream_fair] nreq = %i, last_active_delta = %ui", fs->nreq, last_active_delta);
return SCHED_SCORE(
- MIN(fs->nreq, SCHED_NREQ_MAX),
- MIN(last_active_delta, SCHED_TIME_MAX));
+ ngx_upstream_fair_min(fs->nreq, SCHED_NREQ_MAX),
+ ngx_upstream_fair_min(last_active_delta, SCHED_TIME_MAX));
}
/*

0 comments on commit 0414a9c

Please sign in to comment.
Something went wrong with that request. Please try again.