Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 6f94abe

Browse files
authored
nginx-1.13.4: use preprocessor define instead of const for comparison (#1483)
Address a mistake I made in #1458 While testing the draft for 1.12.34.3 I noticed that older nginx versions would fail to compile. Switch kNginx13_1_4 to a #define so we can use it to properly compare.
1 parent 662c1e1 commit 6f94abe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ngx_pagespeed.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ extern ngx_module_t ngx_pagespeed;
8484

8585
// Needed for SystemRewriteDriverFactory to use shared memory.
8686
#define PAGESPEED_SUPPORT_POSIX_SHARED_MEM
87+
#define NGINX_1_13_4 1013004
8788

8889
net_instaweb::NgxRewriteDriverFactory* active_driver_factory = NULL;
8990

9091
namespace net_instaweb {
9192

9293
const char* kInternalEtagName = "@psol-etag";
93-
const int kNginx1_13_4 = 1013004;
9494
// The process context takes care of proactively initialising
9595
// a few libraries for us, some of which are not thread-safe
9696
// when they are initialized lazily.
@@ -3022,7 +3022,7 @@ ngx_int_t ps_preaccess_handler(ngx_http_request_t* r) {
30223022

30233023
// move handlers before try_files && content phase
30243024
// As of nginx 1.13.4 we will be right before the try_files module
3025-
#if (nginx_version < kNginx1_13_4)
3025+
#if (nginx_version < NGINX_1_13_4)
30263026
while (ph[i + 1].checker != ngx_http_core_try_files_phase &&
30273027
ph[i + 1].checker != ngx_http_core_content_phase) {
30283028
ph[i] = ph[i + 1];
@@ -3089,7 +3089,7 @@ ngx_int_t ps_init(ngx_conf_t* cf) {
30893089

30903090
// As of nginx 1.13.4, try_files has changed.
30913091
// https://github.com/nginx/nginx/commit/129b06dc5dfab7b4513a4f274b3778cd9b8a6a22
3092-
#if (nginx_version >= kNginx1_13_4)
3092+
#if (nginx_version >= NGINX_1_13_4)
30933093
phase = NGX_HTTP_PRECONTENT_PHASE;
30943094
#endif
30953095

0 commit comments

Comments
 (0)