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

This commit is contained in:
Benjamin Peterson 2020-04-12 13:59:31 -05:00 committed by GitHub
parent 41d5b94af4
commit 909b87d2bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 1 deletions

View File

@ -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 }
};

View File

@ -76,7 +76,9 @@ if __name__ == "__main__":
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("")