]> git.kaiwu.me - nginx.git/commitdiff
SSL: fixed MSVC compilation after ebd18ec1812b.
author蕭澧邦 <shou692199@gmail.com>
Sun, 3 Nov 2024 06:36:17 +0000 (14:36 +0800)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Mon, 11 Nov 2024 18:29:55 +0000 (22:29 +0400)
MSVC generates a compilation error in case #if/#endif is used in a macro
parameter.

src/http/modules/ngx_http_grpc_module.c
src/http/modules/ngx_http_proxy_module.c
src/http/modules/ngx_http_ssl_module.c
src/http/modules/ngx_http_uwsgi_module.c
src/mail/ngx_mail_ssl_module.c
src/stream/ngx_stream_proxy_module.c
src/stream/ngx_stream_ssl_module.c

index d9456843dca7caa7c5b0ac9d99c25dd117310816..0a103ac66c520edd27c41e1a22954868d7373368 100644 (file)
@@ -4475,12 +4475,16 @@ ngx_http_grpc_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_conf_merge_value(conf->upstream.ssl_session_reuse,
                               prev->upstream.ssl_session_reuse, 1);
 
+#ifndef SSL_OP_NO_TLSv1_2
     ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
                                  (NGX_CONF_BITMASK_SET
-#ifndef SSL_OP_NO_TLSv1_2
                                   |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
-#endif
                                   |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#else
+    ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
+                                 (NGX_CONF_BITMASK_SET
+                                  |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#endif
 
     ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers,
                              "DEFAULT");
index fe1952748addf9100737fde9f187ab925f4b47f8..73d8ce2a89ad0ed174856bb67a07fe008e6892ee 100644 (file)
@@ -3942,12 +3942,16 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_conf_merge_value(conf->upstream.ssl_session_reuse,
                               prev->upstream.ssl_session_reuse, 1);
 
+#ifndef SSL_OP_NO_TLSv1_2
     ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
                                  (NGX_CONF_BITMASK_SET
-#ifndef SSL_OP_NO_TLSv1_2
                                   |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
-#endif
                                   |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#else
+    ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
+                                 (NGX_CONF_BITMASK_SET
+                                  |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#endif
 
     ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers,
                              "DEFAULT");
index 1fb1e6129beaa8ba8f3fa9481025a3903efc63c1..2ab9b84b714cd4214792d9645dce15a8d36b99f6 100644 (file)
@@ -651,12 +651,16 @@ ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_conf_merge_value(conf->early_data, prev->early_data, 0);
     ngx_conf_merge_value(conf->reject_handshake, prev->reject_handshake, 0);
 
+#ifndef SSL_OP_NO_TLSv1_2
     ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
                          (NGX_CONF_BITMASK_SET
-#ifndef SSL_OP_NO_TLSv1_2
                           |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
-#endif
                           |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#else
+    ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
+                         (NGX_CONF_BITMASK_SET
+                          |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#endif
 
     ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size,
                          NGX_SSL_BUFSIZE);
index f2a8dbe6a083a9e35099a4dd0b744dcae4a80b16..2af5a930a1c7f639ce4fa37d15eea3df590bb471 100644 (file)
@@ -1877,12 +1877,16 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_conf_merge_value(conf->upstream.ssl_session_reuse,
                               prev->upstream.ssl_session_reuse, 1);
 
+#ifndef SSL_OP_NO_TLSv1_2
     ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
                                  (NGX_CONF_BITMASK_SET
-#ifndef SSL_OP_NO_TLSv1_2
                                   |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
-#endif
                                   |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#else
+    ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
+                                 (NGX_CONF_BITMASK_SET
+                                  |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#endif
 
     ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers,
                              "DEFAULT");
index 2fee1adb8db184bad9f09d6d062b18ad150b8596..4c3f41a58db9a829d5b5af476f7cb1e1762bfac3 100644 (file)
@@ -343,12 +343,16 @@ ngx_mail_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_conf_merge_value(conf->prefer_server_ciphers,
                          prev->prefer_server_ciphers, 0);
 
+#ifndef SSL_OP_NO_TLSv1_2
     ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
                          (NGX_CONF_BITMASK_SET
-#ifndef SSL_OP_NO_TLSv1_2
                           |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
-#endif
                           |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#else
+    ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
+                         (NGX_CONF_BITMASK_SET
+                          |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#endif
 
     ngx_conf_merge_uint_value(conf->verify, prev->verify, 0);
     ngx_conf_merge_uint_value(conf->verify_depth, prev->verify_depth, 1);
index 0890a04aeb07a40deaf5973748f725e7e42d4b8d..2b6f9baaf236dbecca983a5e5a07099cef59f7b8 100644 (file)
@@ -2181,12 +2181,16 @@ ngx_stream_proxy_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_conf_merge_value(conf->ssl_session_reuse,
                               prev->ssl_session_reuse, 1);
 
+#ifndef SSL_OP_NO_TLSv1_2
     ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
                               (NGX_CONF_BITMASK_SET
-#ifndef SSL_OP_NO_TLSv1_2
                                |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
-#endif
                                |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#else
+    ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
+                              (NGX_CONF_BITMASK_SET
+                               |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#endif
 
     ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers, "DEFAULT");
 
index 55bc54a44c9c750af5e64bba48839b4de634841a..8177d580fc8d78933cc953c3fb85fbc1153fe032 100644 (file)
@@ -882,12 +882,16 @@ ngx_stream_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
 
     ngx_conf_merge_value(conf->reject_handshake, prev->reject_handshake, 0);
 
+#ifndef SSL_OP_NO_TLSv1_2
     ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
                          (NGX_CONF_BITMASK_SET
-#ifndef SSL_OP_NO_TLSv1_2
                           |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
-#endif
                           |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#else
+    ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
+                         (NGX_CONF_BITMASK_SET
+                          |NGX_SSL_TLSv1_2|NGX_SSL_TLSv1_3));
+#endif
 
     ngx_conf_merge_uint_value(conf->verify, prev->verify, 0);
     ngx_conf_merge_uint_value(conf->verify_depth, prev->verify_depth, 1);