[Python-checkins] closes bpo-39953: Generate ifdefs around library code definitions. (GH-19490)

Benjamin Peterson webhook-mailer at python.org
Sun Apr 12 14:59:35 EDT 2020


https://github.com/python/cpython/commit/909b87d2bb3d6330d39c48e43f7f50f4d086cc41
commit: 909b87d2bb3d6330d39c48e43f7f50f4d086cc41
branch: master
author: Benjamin Peterson <benjamin at python.org>
committer: GitHub <noreply at github.com>
date: 2020-04-12T13:59:31-05:00
summary:

closes bpo-39953: Generate ifdefs around library code definitions. (GH-19490)

files:
M Modules/_ssl_data.h
M Tools/ssl/make_ssl_data.py

diff --git a/Modules/_ssl_data.h b/Modules/_ssl_data.h
index f01c019c45b19..e22f827032042 100644
--- a/Modules/_ssl_data.h
+++ b/Modules/_ssl_data.h
@@ -1,33 +1,85 @@
 /* File generated by Tools/ssl/make_ssl_data.py */
-/* Generated on 2020-04-11T14:59:43.709585 */
+/* Generated on 2020-04-12T13:38:13.871723 */
 
 static struct py_ssl_library_code library_codes[] = {
+#ifdef ERR_LIB_ASN1
     {"ASN1", ERR_LIB_ASN1},
+#endif
+#ifdef ERR_LIB_ASYNC
     {"ASYNC", ERR_LIB_ASYNC},
+#endif
+#ifdef ERR_LIB_BIO
     {"BIO", ERR_LIB_BIO},
+#endif
+#ifdef ERR_LIB_BN
     {"BN", ERR_LIB_BN},
+#endif
+#ifdef ERR_LIB_CMS
     {"CMS", ERR_LIB_CMS},
+#endif
+#ifdef ERR_LIB_COMP
     {"COMP", ERR_LIB_COMP},
+#endif
+#ifdef ERR_LIB_CONF
     {"CONF", ERR_LIB_CONF},
+#endif
+#ifdef ERR_LIB_CRYPTO
     {"CRYPTO", ERR_LIB_CRYPTO},
+#endif
+#ifdef ERR_LIB_CT
     {"CT", ERR_LIB_CT},
+#endif
+#ifdef ERR_LIB_DH
     {"DH", ERR_LIB_DH},
+#endif
+#ifdef ERR_LIB_DSA
     {"DSA", ERR_LIB_DSA},
+#endif
+#ifdef ERR_LIB_EC
     {"EC", ERR_LIB_EC},
+#endif
+#ifdef ERR_LIB_ENGINE
     {"ENGINE", ERR_LIB_ENGINE},
+#endif
+#ifdef ERR_LIB_EVP
     {"EVP", ERR_LIB_EVP},
+#endif
+#ifdef ERR_LIB_KDF
     {"KDF", ERR_LIB_KDF},
+#endif
+#ifdef ERR_LIB_OCSP
     {"OCSP", ERR_LIB_OCSP},
+#endif
+#ifdef ERR_LIB_PEM
     {"PEM", ERR_LIB_PEM},
+#endif
+#ifdef ERR_LIB_PKCS12
     {"PKCS12", ERR_LIB_PKCS12},
+#endif
+#ifdef ERR_LIB_PKCS7
     {"PKCS7", ERR_LIB_PKCS7},
+#endif
+#ifdef ERR_LIB_RAND
     {"RAND", ERR_LIB_RAND},
+#endif
+#ifdef ERR_LIB_RSA
     {"RSA", ERR_LIB_RSA},
+#endif
+#ifdef ERR_LIB_SSL
     {"SSL", ERR_LIB_SSL},
+#endif
+#ifdef ERR_LIB_TS
     {"TS", ERR_LIB_TS},
+#endif
+#ifdef ERR_LIB_UI
     {"UI", ERR_LIB_UI},
+#endif
+#ifdef ERR_LIB_X509
     {"X509", ERR_LIB_X509},
+#endif
+#ifdef ERR_LIB_X509V3
     {"X509V3", ERR_LIB_X509V3},
+#endif
     { NULL }
 };
 
diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py
index 1c7a5a9fb28e3..a8562a225d256 100755
--- a/Tools/ssl/make_ssl_data.py
+++ b/Tools/ssl/make_ssl_data.py
@@ -76,7 +76,9 @@ def w(l):
 
     w("static struct py_ssl_library_code library_codes[] = {")
     for mnemo, (libcode, _, _) in sorted(error_libraries.items()):
+        w(f'#ifdef {libcode}')
         w('    {"%s", %s},' % (mnemo, libcode))
+        w('#endif')
     w('    { NULL }')
     w('};')
     w("")



More information about the Python-checkins mailing list