|
2 | 2 | #![allow(non_camel_case_types)]
|
3 | 3 | #![allow(non_snake_case)]
|
4 | 4 |
|
5 |
| -// Set in build.rs |
6 |
| -include!(env!("BINDGEN_RS_FILE")); |
| 5 | +use core::ffi::c_ulong; |
| 6 | + |
| 7 | +// Wrap the bindgen output in a module and re-export it, so we can override it |
| 8 | +// as needed. |
| 9 | +mod bindgen { |
| 10 | + include!(env!("BINDGEN_RS_FILE")); |
| 11 | +} |
| 12 | +pub use bindgen::*; |
| 13 | + |
| 14 | +// bindgen does not handle C constants correctly. See |
| 15 | +// https://github.com/rust-lang/rust-bindgen/issues/923. Work around this bug by |
| 16 | +// redefining some constants with the correct type. Once the bindgen bug has |
| 17 | +// been fixed, remove this. |
| 18 | +pub const ASN1_STRFLGS_ESC_2253: c_ulong = bindgen::ASN1_STRFLGS_ESC_2253 as c_ulong; |
| 19 | +pub const ASN1_STRFLGS_ESC_CTRL: c_ulong = bindgen::ASN1_STRFLGS_ESC_CTRL as c_ulong; |
| 20 | +pub const ASN1_STRFLGS_ESC_MSB: c_ulong = bindgen::ASN1_STRFLGS_ESC_MSB as c_ulong; |
| 21 | +pub const ASN1_STRFLGS_ESC_QUOTE: c_ulong = bindgen::ASN1_STRFLGS_ESC_QUOTE as c_ulong; |
| 22 | +pub const ASN1_STRFLGS_UTF8_CONVERT: c_ulong = bindgen::ASN1_STRFLGS_UTF8_CONVERT as c_ulong; |
| 23 | +pub const ASN1_STRFLGS_IGNORE_TYPE: c_ulong = bindgen::ASN1_STRFLGS_IGNORE_TYPE as c_ulong; |
| 24 | +pub const ASN1_STRFLGS_SHOW_TYPE: c_ulong = bindgen::ASN1_STRFLGS_SHOW_TYPE as c_ulong; |
| 25 | +pub const ASN1_STRFLGS_DUMP_ALL: c_ulong = bindgen::ASN1_STRFLGS_DUMP_ALL as c_ulong; |
| 26 | +pub const ASN1_STRFLGS_DUMP_UNKNOWN: c_ulong = bindgen::ASN1_STRFLGS_DUMP_UNKNOWN as c_ulong; |
| 27 | +pub const ASN1_STRFLGS_DUMP_DER: c_ulong = bindgen::ASN1_STRFLGS_DUMP_DER as c_ulong; |
| 28 | +pub const ASN1_STRFLGS_RFC2253: c_ulong = bindgen::ASN1_STRFLGS_RFC2253 as c_ulong; |
| 29 | +pub const XN_FLAG_COMPAT: c_ulong = bindgen::XN_FLAG_COMPAT as c_ulong; |
| 30 | +pub const XN_FLAG_SEP_MASK: c_ulong = bindgen::XN_FLAG_SEP_MASK as c_ulong; |
| 31 | +pub const XN_FLAG_SEP_COMMA_PLUS: c_ulong = bindgen::XN_FLAG_SEP_COMMA_PLUS as c_ulong; |
| 32 | +pub const XN_FLAG_SEP_CPLUS_SPC: c_ulong = bindgen::XN_FLAG_SEP_CPLUS_SPC as c_ulong; |
| 33 | +pub const XN_FLAG_SEP_SPLUS_SPC: c_ulong = bindgen::XN_FLAG_SEP_SPLUS_SPC as c_ulong; |
| 34 | +pub const XN_FLAG_SEP_MULTILINE: c_ulong = bindgen::XN_FLAG_SEP_MULTILINE as c_ulong; |
| 35 | +pub const XN_FLAG_DN_REV: c_ulong = bindgen::XN_FLAG_DN_REV as c_ulong; |
| 36 | +pub const XN_FLAG_FN_MASK: c_ulong = bindgen::XN_FLAG_FN_MASK as c_ulong; |
| 37 | +pub const XN_FLAG_FN_SN: c_ulong = bindgen::XN_FLAG_FN_SN as c_ulong; |
| 38 | +pub const XN_FLAG_SPC_EQ: c_ulong = bindgen::XN_FLAG_SPC_EQ as c_ulong; |
| 39 | +pub const XN_FLAG_DUMP_UNKNOWN_FIELDS: c_ulong = bindgen::XN_FLAG_DUMP_UNKNOWN_FIELDS as c_ulong; |
| 40 | +pub const XN_FLAG_RFC2253: c_ulong = bindgen::XN_FLAG_RFC2253 as c_ulong; |
| 41 | +pub const XN_FLAG_ONELINE: c_ulong = bindgen::XN_FLAG_ONELINE as c_ulong; |
7 | 42 |
|
8 | 43 | // TODO(crbug.com/boringssl/596): Remove these wrappers.
|
9 | 44 | #[cfg(unsupported_inline_wrappers)]
|
|
0 commit comments