@@ -22,7 +22,7 @@ static int ngx_http_lua_ngx_req_raw_header(lua_State *L);
2222static int ngx_http_lua_ngx_req_header_set_helper (lua_State * L );
2323static int ngx_http_lua_ngx_resp_get_headers (lua_State * L );
2424static int ngx_http_lua_ngx_req_header_set (lua_State * L );
25- #if nginx_version >= 1011011
25+ #if defined( nginx_version ) && ( nginx_version >= 1011011 )
2626void ngx_http_lua_ngx_raw_header_cleanup (void * data );
2727#endif
2828
@@ -102,7 +102,7 @@ ngx_http_lua_ngx_req_raw_header(lua_State *L)
102102 size_t size ;
103103 ngx_buf_t * b , * first = NULL ;
104104 ngx_int_t i , j ;
105- #if nginx_version >= 1011011
105+ #if defined( nginx_version ) && ( nginx_version >= 1011011 )
106106 ngx_buf_t * * bb ;
107107 ngx_chain_t * cl ;
108108 ngx_http_lua_main_conf_t * lmcf ;
@@ -123,7 +123,7 @@ ngx_http_lua_ngx_req_raw_header(lua_State *L)
123123 return luaL_error (L , "no request object found" );
124124 }
125125
126- #if nginx_version >= 1011011
126+ #if defined( nginx_version ) && ( nginx_version >= 1011011 )
127127 lmcf = ngx_http_get_module_main_conf (r , ngx_http_lua_module );
128128#endif
129129
@@ -143,7 +143,7 @@ ngx_http_lua_ngx_req_raw_header(lua_State *L)
143143 dd ("hc->nbusy: %d" , (int ) hc -> nbusy );
144144
145145 if (hc -> nbusy ) {
146- #if nginx_version >= 1011011
146+ #if defined( nginx_version ) && ( nginx_version >= 1011011 )
147147 dd ("hc->busy: %p %p %p %p" , hc -> busy -> buf -> start , hc -> busy -> buf -> pos ,
148148 hc -> busy -> buf -> last , hc -> busy -> buf -> end );
149149#else
@@ -185,7 +185,7 @@ ngx_http_lua_ngx_req_raw_header(lua_State *L)
185185 dd ("size: %d" , (int ) size );
186186
187187 if (hc -> nbusy ) {
188- #if nginx_version >= 1011011
188+ #if defined( nginx_version ) && ( nginx_version >= 1011011 )
189189 if (hc -> nbusy > lmcf -> busy_buf_ptr_count ) {
190190 if (lmcf -> busy_buf_ptrs ) {
191191 ngx_free (lmcf -> busy_buf_ptrs );
@@ -208,7 +208,7 @@ ngx_http_lua_ngx_req_raw_header(lua_State *L)
208208#endif
209209 b = NULL ;
210210
211- #if nginx_version >= 1011011
211+ #if defined( nginx_version ) && ( nginx_version >= 1011011 )
212212 bb = lmcf -> busy_buf_ptrs ;
213213 for (i = hc -> nbusy ; i > 0 ; i -- ) {
214214 b = bb [i - 1 ];
@@ -291,7 +291,7 @@ ngx_http_lua_ngx_req_raw_header(lua_State *L)
291291
292292 if (hc -> nbusy ) {
293293
294- #if nginx_version >= 1011011
294+ #if defined( nginx_version ) && ( nginx_version >= 1011011 )
295295 bb = lmcf -> busy_buf_ptrs ;
296296 for (i = hc -> nbusy - 1 ; i >= 0 ; i -- ) {
297297 b = bb [i ];
@@ -1138,7 +1138,7 @@ ngx_http_lua_ffi_get_resp_header(ngx_http_request_t *r,
11381138}
11391139
11401140
1141- #if nginx_version >= 1011011
1141+ #if defined( nginx_version ) && ( nginx_version >= 1011011 )
11421142void
11431143ngx_http_lua_ngx_raw_header_cleanup (void * data )
11441144{
0 commit comments