Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jul 2024 10:04:46 GMT
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 2d13700f31cb - main - databases/diesel: fix build on powerpc64*
Message-ID:  <202407091004.469A4kWT005231@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2d13700f31cb2320100c7feb990e2c9b5911a02c

commit 2d13700f31cb2320100c7feb990e2c9b5911a02c
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2024-07-05 22:23:48 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2024-07-09 10:03:43 +0000

    databases/diesel: fix build on powerpc64*
---
 databases/diesel/Makefile                          |    4 +
 .../files/bindings_8_0_35_powerpc64_freebsd.rs     | 4186 ++++++++++++++++++++
 ...tch-cargo-crates_mysqlclient-sys-0.4.0_build.rs |   10 +
 3 files changed, 4200 insertions(+)

diff --git a/databases/diesel/Makefile b/databases/diesel/Makefile
index 89b2a0fe2763..6f59b5a5e418 100644
--- a/databases/diesel/Makefile
+++ b/databases/diesel/Makefile
@@ -215,6 +215,10 @@ CARGO_CRATES=	aho-corasick-1.1.3 \
 
 PLIST_FILES=	bin/${PORTNAME}
 
+post-patch:
+	${CP} ${FILESDIR}/bindings_8_0_35_powerpc64_freebsd.rs \
+		${WRKSRC}/cargo-crates/mysqlclient-sys-0.4.0/bindings/
+
 post-install:
 	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
 
diff --git a/databases/diesel/files/bindings_8_0_35_powerpc64_freebsd.rs b/databases/diesel/files/bindings_8_0_35_powerpc64_freebsd.rs
new file mode 100644
index 000000000000..a7842e0f8dd9
--- /dev/null
+++ b/databases/diesel/files/bindings_8_0_35_powerpc64_freebsd.rs
@@ -0,0 +1,4186 @@
+/* automatically generated by rust-bindgen 0.69.4 */
+
+pub const MYSQL_AUTODETECT_CHARSET_NAME: &[u8; 5] = b"auto\0";
+pub const MYSQL_ERRMSG_SIZE: u32 = 512;
+pub const MYSQL_STMT_HEADER: u32 = 4;
+pub const MYSQL_LONG_DATA_HEADER: u32 = 6;
+pub const MYSQL_CLIENT_reserved1: u32 = 0;
+pub const MYSQL_CLIENT_reserved2: u32 = 1;
+pub const MYSQL_CLIENT_AUTHENTICATION_PLUGIN: u32 = 2;
+pub const MYSQL_CLIENT_TRACE_PLUGIN: u32 = 3;
+pub const MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION: u32 = 512;
+pub const MYSQL_CLIENT_TRACE_PLUGIN_INTERFACE_VERSION: u32 = 512;
+pub const MYSQL_CLIENT_MAX_PLUGINS: u32 = 4;
+pub const MYSQL_CLIENT_PLUGIN_AUTHOR_ORACLE: &[u8; 19] = b"Oracle Corporation\0";
+pub const MYSQL_USERNAME_LENGTH: u32 = 96;
+pub const MYSQL_SERVER_VERSION: &[u8; 7] = b"8.0.35\0";
+pub const MYSQL_BASE_VERSION: &[u8; 11] = b"mysqld-8.0\0";
+pub const MYSQL_SERVER_SUFFIX_DEF: &[u8; 1] = b"\0";
+pub const MYSQL_VERSION_ID: u32 = 80035;
+pub const MYSQL_VERSION_STABILITY: &[u8; 4] = b"LTS\0";
+pub const MYSQL_PORT: u32 = 3306;
+pub const MYSQL_ADMIN_PORT: u32 = 33062;
+pub const MYSQL_PORT_DEFAULT: u32 = 0;
+pub const MYSQL_UNIX_ADDR: &[u8; 16] = b"/tmp/mysql.sock\0";
+pub const MYSQL_CONFIG_NAME: &[u8; 3] = b"my\0";
+pub const MYSQL_PERSIST_CONFIG_NAME: &[u8; 12] = b"mysqld-auto\0";
+pub const MYSQL_COMPILATION_COMMENT: &[u8; 20] = b"Source distribution\0";
+pub const MYSQL_COMPILATION_COMMENT_SERVER: &[u8; 20] = b"Source distribution\0";
+pub const MYSQL_RPL_GTID: u32 = 65536;
+pub const MYSQL_RPL_SKIP_HEARTBEAT: u32 = 131072;
+pub const MYSQL_NO_DATA: u32 = 100;
+pub const MYSQL_DATA_TRUNCATED: u32 = 101;
+pub type __va_list = __builtin_va_list;
+pub type my_socket = ::std::os::raw::c_int;
+#[repr(u32)]
+#[non_exhaustive]
+#[doc = "Column types for MySQL"]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum enum_field_types {
+    MYSQL_TYPE_DECIMAL = 0,
+    MYSQL_TYPE_TINY = 1,
+    MYSQL_TYPE_SHORT = 2,
+    MYSQL_TYPE_LONG = 3,
+    MYSQL_TYPE_FLOAT = 4,
+    MYSQL_TYPE_DOUBLE = 5,
+    MYSQL_TYPE_NULL = 6,
+    MYSQL_TYPE_TIMESTAMP = 7,
+    MYSQL_TYPE_LONGLONG = 8,
+    MYSQL_TYPE_INT24 = 9,
+    MYSQL_TYPE_DATE = 10,
+    MYSQL_TYPE_TIME = 11,
+    MYSQL_TYPE_DATETIME = 12,
+    MYSQL_TYPE_YEAR = 13,
+    #[doc = "< Internal to MySQL. Not used in protocol"]
+    MYSQL_TYPE_NEWDATE = 14,
+    MYSQL_TYPE_VARCHAR = 15,
+    MYSQL_TYPE_BIT = 16,
+    MYSQL_TYPE_TIMESTAMP2 = 17,
+    #[doc = "< Internal to MySQL. Not used in protocol"]
+    MYSQL_TYPE_DATETIME2 = 18,
+    #[doc = "< Internal to MySQL. Not used in protocol"]
+    MYSQL_TYPE_TIME2 = 19,
+    #[doc = "< Used for replication only"]
+    MYSQL_TYPE_TYPED_ARRAY = 20,
+    MYSQL_TYPE_INVALID = 243,
+    #[doc = "< Currently just a placeholder"]
+    MYSQL_TYPE_BOOL = 244,
+    MYSQL_TYPE_JSON = 245,
+    MYSQL_TYPE_NEWDECIMAL = 246,
+    MYSQL_TYPE_ENUM = 247,
+    MYSQL_TYPE_SET = 248,
+    MYSQL_TYPE_TINY_BLOB = 249,
+    MYSQL_TYPE_MEDIUM_BLOB = 250,
+    MYSQL_TYPE_LONG_BLOB = 251,
+    MYSQL_TYPE_BLOB = 252,
+    MYSQL_TYPE_VAR_STRING = 253,
+    MYSQL_TYPE_STRING = 254,
+    MYSQL_TYPE_GEOMETRY = 255,
+}
+#[doc = "@file include/my_list.h"]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct LIST {
+    pub prev: *mut LIST,
+    pub next: *mut LIST,
+    pub data: *mut ::std::os::raw::c_void,
+}
+#[test]
+fn bindgen_test_layout_LIST() {
+    const UNINIT: ::std::mem::MaybeUninit<LIST> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
+    assert_eq!(
+        ::std::mem::size_of::<LIST>(),
+        24usize,
+        concat!("Size of: ", stringify!(LIST))
+    );
+    assert_eq!(
+        ::std::mem::align_of::<LIST>(),
+        8usize,
+        concat!("Alignment of ", stringify!(LIST))
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(LIST),
+            "::",
+            stringify!(prev)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize },
+        8usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(LIST),
+            "::",
+            stringify!(next)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
+        16usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(LIST),
+            "::",
+            stringify!(data)
+        )
+    );
+}
+#[repr(u32)]
+#[non_exhaustive]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum enum_compression_algorithm {
+    MYSQL_UNCOMPRESSED = 1,
+    MYSQL_ZLIB = 2,
+    MYSQL_ZSTD = 3,
+    MYSQL_INVALID = 4,
+}
+#[doc = "Compress context information. relating to zlib compression."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct mysql_zlib_compress_context {
+    #[doc = "Compression level to use in zlib compression."]
+    pub compression_level: ::std::os::raw::c_uint,
+}
+#[test]
+fn bindgen_test_layout_mysql_zlib_compress_context() {
+    const UNINIT: ::std::mem::MaybeUninit<mysql_zlib_compress_context> =
+        ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
+    assert_eq!(
+        ::std::mem::size_of::<mysql_zlib_compress_context>(),
+        4usize,
+        concat!("Size of: ", stringify!(mysql_zlib_compress_context))
+    );
+    assert_eq!(
+        ::std::mem::align_of::<mysql_zlib_compress_context>(),
+        4usize,
+        concat!("Alignment of ", stringify!(mysql_zlib_compress_context))
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).compression_level) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(mysql_zlib_compress_context),
+            "::",
+            stringify!(compression_level)
+        )
+    );
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct ZSTD_CCtx_s {
+    _unused: [u8; 0],
+}
+pub type ZSTD_CCtx = ZSTD_CCtx_s;
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct ZSTD_DCtx_s {
+    _unused: [u8; 0],
+}
+pub type ZSTD_DCtx = ZSTD_DCtx_s;
+#[doc = "Compress context information relating to zstd compression."]
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct mysql_zstd_compress_context {
+    #[doc = "Pointer to compressor context."]
+    pub cctx: *mut ZSTD_CCtx,
+    #[doc = "Pointer to decompressor context."]
+    pub dctx: *mut ZSTD_DCtx,
+    #[doc = "Compression level to use in zstd compression."]
+    pub compression_level: ::std::os::raw::c_uint,
+}
+#[test]
+fn bindgen_test_layout_mysql_zstd_compress_context() {
+    const UNINIT: ::std::mem::MaybeUninit<mysql_zstd_compress_context> =
+        ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
+    assert_eq!(
+        ::std::mem::size_of::<mysql_zstd_compress_context>(),
+        24usize,
+        concat!("Size of: ", stringify!(mysql_zstd_compress_context))
+    );
+    assert_eq!(
+        ::std::mem::align_of::<mysql_zstd_compress_context>(),
+        8usize,
+        concat!("Alignment of ", stringify!(mysql_zstd_compress_context))
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).cctx) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(mysql_zstd_compress_context),
+            "::",
+            stringify!(cctx)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).dctx) as usize - ptr as usize },
+        8usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(mysql_zstd_compress_context),
+            "::",
+            stringify!(dctx)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).compression_level) as usize - ptr as usize },
+        16usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(mysql_zstd_compress_context),
+            "::",
+            stringify!(compression_level)
+        )
+    );
+}
+#[doc = "Compression context information.\nIt encapsulate the context information based on compression method and\npresents a generic struct."]
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub struct mysql_compress_context {
+    #[doc = "< Compression algorithm name."]
+    pub algorithm: enum_compression_algorithm,
+    pub u: mysql_compress_context__bindgen_ty_1,
+}
+#[repr(C)]
+#[derive(Copy, Clone)]
+pub union mysql_compress_context__bindgen_ty_1 {
+    #[doc = "< Context information of zlib."]
+    pub zlib_ctx: mysql_zlib_compress_context,
+    #[doc = "< Context information of zstd."]
+    pub zstd_ctx: mysql_zstd_compress_context,
+}
+#[test]
+fn bindgen_test_layout_mysql_compress_context__bindgen_ty_1() {
+    const UNINIT: ::std::mem::MaybeUninit<mysql_compress_context__bindgen_ty_1> =
+        ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
+    assert_eq!(
+        ::std::mem::size_of::<mysql_compress_context__bindgen_ty_1>(),
+        24usize,
+        concat!(
+            "Size of: ",
+            stringify!(mysql_compress_context__bindgen_ty_1)
+        )
+    );
+    assert_eq!(
+        ::std::mem::align_of::<mysql_compress_context__bindgen_ty_1>(),
+        8usize,
+        concat!(
+            "Alignment of ",
+            stringify!(mysql_compress_context__bindgen_ty_1)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).zlib_ctx) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(mysql_compress_context__bindgen_ty_1),
+            "::",
+            stringify!(zlib_ctx)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).zstd_ctx) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(mysql_compress_context__bindgen_ty_1),
+            "::",
+            stringify!(zstd_ctx)
+        )
+    );
+}
+#[test]
+fn bindgen_test_layout_mysql_compress_context() {
+    const UNINIT: ::std::mem::MaybeUninit<mysql_compress_context> =
+        ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
+    assert_eq!(
+        ::std::mem::size_of::<mysql_compress_context>(),
+        32usize,
+        concat!("Size of: ", stringify!(mysql_compress_context))
+    );
+    assert_eq!(
+        ::std::mem::align_of::<mysql_compress_context>(),
+        8usize,
+        concat!("Alignment of ", stringify!(mysql_compress_context))
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).algorithm) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(mysql_compress_context),
+            "::",
+            stringify!(algorithm)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize },
+        8usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(mysql_compress_context),
+            "::",
+            stringify!(u)
+        )
+    );
+}
+extern "C" {
+    #[doc = "Get default compression level corresponding to a given compression method.\n\n@param algorithm Compression Method. Possible values are zlib or zstd.\n\n@return an unsigned int representing default compression level.\n6 is the default compression level for zlib and 3 is the\ndefault compression level for zstd."]
+    pub fn mysql_default_compression_level(
+        algorithm: enum_compression_algorithm,
+    ) -> ::std::os::raw::c_uint;
+}
+extern "C" {
+    #[doc = "Initialize a compress context object to be associated with a NET object.\n\n@param cmp_ctx Pointer to compression context.\n@param algorithm Compression algorithm.\n@param compression_level Compression level corresponding to the compression\nalgorithm."]
+    pub fn mysql_compress_context_init(
+        cmp_ctx: *mut mysql_compress_context,
+        algorithm: enum_compression_algorithm,
+        compression_level: ::std::os::raw::c_uint,
+    );
+}
+extern "C" {
+    #[doc = "Deinitialize the compression context allocated.\n\n@param mysql_compress_ctx Pointer to Compression context."]
+    pub fn mysql_compress_context_deinit(mysql_compress_ctx: *mut mysql_compress_context);
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct Vio {
+    _unused: [u8; 0],
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct NET {
+    pub vio: *mut Vio,
+    pub buff: *mut ::std::os::raw::c_uchar,
+    pub buff_end: *mut ::std::os::raw::c_uchar,
+    pub write_pos: *mut ::std::os::raw::c_uchar,
+    pub read_pos: *mut ::std::os::raw::c_uchar,
+    pub fd: my_socket,
+    #[doc = "Set if we are doing several queries in one\ncommand ( as in LOAD TABLE ... FROM MASTER ),\nand do not want to confuse the client with OK at the wrong time"]
+    pub remain_in_buf: ::std::os::raw::c_ulong,
+    #[doc = "Set if we are doing several queries in one\ncommand ( as in LOAD TABLE ... FROM MASTER ),\nand do not want to confuse the client with OK at the wrong time"]
+    pub length: ::std::os::raw::c_ulong,
+    #[doc = "Set if we are doing several queries in one\ncommand ( as in LOAD TABLE ... FROM MASTER ),\nand do not want to confuse the client with OK at the wrong time"]
+    pub buf_length: ::std::os::raw::c_ulong,
+    #[doc = "Set if we are doing several queries in one\ncommand ( as in LOAD TABLE ... FROM MASTER ),\nand do not want to confuse the client with OK at the wrong time"]
+    pub where_b: ::std::os::raw::c_ulong,
+    pub max_packet: ::std::os::raw::c_ulong,
+    pub max_packet_size: ::std::os::raw::c_ulong,
+    pub pkt_nr: ::std::os::raw::c_uint,
+    pub compress_pkt_nr: ::std::os::raw::c_uint,
+    pub write_timeout: ::std::os::raw::c_uint,
+    pub read_timeout: ::std::os::raw::c_uint,
+    pub retry_count: ::std::os::raw::c_uint,
+    pub fcntl: ::std::os::raw::c_int,
+    pub return_status: *mut ::std::os::raw::c_uint,
+    pub reading_or_writing: ::std::os::raw::c_uchar,
+    pub save_char: ::std::os::raw::c_uchar,
+    pub compress: bool,
+    pub last_errno: ::std::os::raw::c_uint,
+    pub error: ::std::os::raw::c_uchar,
+    #[doc = " Client library error message buffer. Actually belongs to struct MYSQL."]
+    pub last_error: [::std::os::raw::c_char; 512usize],
+    #[doc = " Client library sqlstate buffer. Set along with the error message."]
+    pub sqlstate: [::std::os::raw::c_char; 6usize],
+    #[doc = "Extension pointer, for the caller private use.\nAny program linking with the networking library can use this pointer,\nwhich is handy when private connection specific data needs to be\nmaintained.\nThe mysqld server process uses this pointer internally,\nto maintain the server internal instrumentation for the connection."]
+    pub extension: *mut ::std::os::raw::c_void,
+}
+#[test]
+fn bindgen_test_layout_NET() {
+    const UNINIT: ::std::mem::MaybeUninit<NET> = ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
+    assert_eq!(
+        ::std::mem::size_of::<NET>(),
+        664usize,
+        concat!("Size of: ", stringify!(NET))
+    );
+    assert_eq!(
+        ::std::mem::align_of::<NET>(),
+        8usize,
+        concat!("Alignment of ", stringify!(NET))
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).vio) as usize - ptr as usize },
+        0usize,
+        concat!("Offset of field: ", stringify!(NET), "::", stringify!(vio))
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).buff) as usize - ptr as usize },
+        8usize,
+        concat!("Offset of field: ", stringify!(NET), "::", stringify!(buff))
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).buff_end) as usize - ptr as usize },
+        16usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(buff_end)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).write_pos) as usize - ptr as usize },
+        24usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(write_pos)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).read_pos) as usize - ptr as usize },
+        32usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(read_pos)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).fd) as usize - ptr as usize },
+        40usize,
+        concat!("Offset of field: ", stringify!(NET), "::", stringify!(fd))
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).remain_in_buf) as usize - ptr as usize },
+        48usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(remain_in_buf)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize },
+        56usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(length)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).buf_length) as usize - ptr as usize },
+        64usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(buf_length)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).where_b) as usize - ptr as usize },
+        72usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(where_b)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).max_packet) as usize - ptr as usize },
+        80usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(max_packet)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).max_packet_size) as usize - ptr as usize },
+        88usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(max_packet_size)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).pkt_nr) as usize - ptr as usize },
+        96usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(pkt_nr)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).compress_pkt_nr) as usize - ptr as usize },
+        100usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(compress_pkt_nr)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).write_timeout) as usize - ptr as usize },
+        104usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(write_timeout)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).read_timeout) as usize - ptr as usize },
+        108usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(read_timeout)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).retry_count) as usize - ptr as usize },
+        112usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(retry_count)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).fcntl) as usize - ptr as usize },
+        116usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(fcntl)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).return_status) as usize - ptr as usize },
+        120usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(return_status)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).reading_or_writing) as usize - ptr as usize },
+        128usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(reading_or_writing)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).save_char) as usize - ptr as usize },
+        129usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(save_char)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).compress) as usize - ptr as usize },
+        130usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(compress)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).last_errno) as usize - ptr as usize },
+        132usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(last_errno)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).error) as usize - ptr as usize },
+        136usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(error)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).last_error) as usize - ptr as usize },
+        137usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(last_error)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).sqlstate) as usize - ptr as usize },
+        649usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(sqlstate)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).extension) as usize - ptr as usize },
+        656usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(NET),
+            "::",
+            stringify!(extension)
+        )
+    );
+}
+#[repr(u32)]
+#[non_exhaustive]
+#[doc = "We want levels to be in growing order of hardness (because we use number\ncomparisons).\n\n@note ::SHUTDOWN_DEFAULT does not respect the growing property, but it's ok."]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum mysql_enum_shutdown_level {
+    SHUTDOWN_DEFAULT = 0,
+    #[doc = " Wait for existing connections to finish"]
+    SHUTDOWN_WAIT_CONNECTIONS = 1,
+    #[doc = " Wait for existing transactons to finish"]
+    SHUTDOWN_WAIT_TRANSACTIONS = 2,
+    #[doc = " Wait for existing updates to finish (=> no partial MyISAM update)"]
+    SHUTDOWN_WAIT_UPDATES = 8,
+    #[doc = " Flush InnoDB buffers and other storage engines' buffers"]
+    SHUTDOWN_WAIT_ALL_BUFFERS = 16,
+    #[doc = " Don't flush InnoDB buffers, flush other storage engines' buffers"]
+    SHUTDOWN_WAIT_CRITICAL_BUFFERS = 17,
+    #[doc = " Query level of the KILL command"]
+    KILL_QUERY = 254,
+    #[doc = " Connection level of the KILL command"]
+    KILL_CONNECTION = 255,
+}
+#[repr(u32)]
+#[non_exhaustive]
+#[doc = " @}"]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum enum_resultset_metadata {
+    #[doc = " No metadata will be sent."]
+    RESULTSET_METADATA_NONE = 0,
+    #[doc = " The server will send all metadata."]
+    RESULTSET_METADATA_FULL = 1,
+}
+#[repr(u32)]
+#[non_exhaustive]
+#[doc = " options for ::mysql_options()"]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum enum_mysql_set_option {
+    MYSQL_OPTION_MULTI_STATEMENTS_ON = 0,
+    MYSQL_OPTION_MULTI_STATEMENTS_OFF = 1,
+}
+#[repr(u32)]
+#[non_exhaustive]
+#[doc = "Type of state change information that the server can include in the Ok\npacket.\n\n@note\n- session_state_type shouldn't go past 255 (i.e. 1-byte boundary).\n- Modify the definition of ::SESSION_TRACK_END when a new member is added."]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum enum_session_state_type {
+    #[doc = "< Session system variables"]
+    SESSION_TRACK_SYSTEM_VARIABLES = 0,
+    #[doc = "< Current schema"]
+    SESSION_TRACK_SCHEMA = 1,
+    #[doc = "< track session state changes"]
+    SESSION_TRACK_STATE_CHANGE = 2,
+    #[doc = "< See also: session_track_gtids"]
+    SESSION_TRACK_GTIDS = 3,
+    #[doc = "< Transaction chistics"]
+    SESSION_TRACK_TRANSACTION_CHARACTERISTICS = 4,
+    #[doc = "< Transaction state"]
+    SESSION_TRACK_TRANSACTION_STATE = 5,
+}
+extern "C" {
+    pub fn mysql_errno_to_sqlstate(
+        mysql_errno: ::std::os::raw::c_uint,
+    ) -> *const ::std::os::raw::c_char;
+}
+pub type va_list = __va_list;
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct st_mysql_client_plugin {
+    pub type_: ::std::os::raw::c_int,
+    pub interface_version: ::std::os::raw::c_uint,
+    pub name: *const ::std::os::raw::c_char,
+    pub author: *const ::std::os::raw::c_char,
+    pub desc: *const ::std::os::raw::c_char,
+    pub version: [::std::os::raw::c_uint; 3usize],
+    pub license: *const ::std::os::raw::c_char,
+    pub mysql_api: *mut ::std::os::raw::c_void,
+    pub init: ::std::option::Option<
+        unsafe extern "C" fn(
+            arg1: *mut ::std::os::raw::c_char,
+            arg2: usize,
+            arg3: ::std::os::raw::c_int,
+            arg4: va_list,
+        ) -> ::std::os::raw::c_int,
+    >,
+    pub deinit: ::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_int>,
+    pub options: ::std::option::Option<
+        unsafe extern "C" fn(
+            option: *const ::std::os::raw::c_char,
+            arg1: *const ::std::os::raw::c_void,
+        ) -> ::std::os::raw::c_int,
+    >,
+    pub get_options: ::std::option::Option<
+        unsafe extern "C" fn(
+            option: *const ::std::os::raw::c_char,
+            arg1: *mut ::std::os::raw::c_void,
+        ) -> ::std::os::raw::c_int,
+    >,
+}
+#[test]
+fn bindgen_test_layout_st_mysql_client_plugin() {
+    const UNINIT: ::std::mem::MaybeUninit<st_mysql_client_plugin> =
+        ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
+    assert_eq!(
+        ::std::mem::size_of::<st_mysql_client_plugin>(),
+        96usize,
+        concat!("Size of: ", stringify!(st_mysql_client_plugin))
+    );
+    assert_eq!(
+        ::std::mem::align_of::<st_mysql_client_plugin>(),
+        8usize,
+        concat!("Alignment of ", stringify!(st_mysql_client_plugin))
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(st_mysql_client_plugin),
+            "::",
+            stringify!(type_)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).interface_version) as usize - ptr as usize },
+        4usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(st_mysql_client_plugin),
+            "::",
+            stringify!(interface_version)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
+        8usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(st_mysql_client_plugin),
+            "::",
+            stringify!(name)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).author) as usize - ptr as usize },
+        16usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(st_mysql_client_plugin),
+            "::",
+            stringify!(author)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).desc) as usize - ptr as usize },
+        24usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(st_mysql_client_plugin),
+            "::",
+            stringify!(desc)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
+        32usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(st_mysql_client_plugin),
+            "::",
+            stringify!(version)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).license) as usize - ptr as usize },
+        48usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(st_mysql_client_plugin),
+            "::",
+            stringify!(license)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).mysql_api) as usize - ptr as usize },
+        56usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(st_mysql_client_plugin),
+            "::",
+            stringify!(mysql_api)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).init) as usize - ptr as usize },
+        64usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(st_mysql_client_plugin),
+            "::",
+            stringify!(init)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).deinit) as usize - ptr as usize },
+        72usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(st_mysql_client_plugin),
+            "::",
+            stringify!(deinit)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize },
+        80usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(st_mysql_client_plugin),
+            "::",
+            stringify!(options)
+        )
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).get_options) as usize - ptr as usize },
+        88usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(st_mysql_client_plugin),
+            "::",
+            stringify!(get_options)
+        )
+    );
+}
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct MYSQL_PLUGIN_VIO_INFO {
+    pub protocol: MYSQL_PLUGIN_VIO_INFO__bindgen_ty_1,
+    #[doc = "< it's set, if the protocol is SOCKET or TCP"]
+    pub socket: ::std::os::raw::c_int,
+}
+pub const MYSQL_PLUGIN_VIO_INFO_MYSQL_VIO_INVALID: MYSQL_PLUGIN_VIO_INFO__bindgen_ty_1 =
+    MYSQL_PLUGIN_VIO_INFO__bindgen_ty_1::MYSQL_VIO_INVALID;
+pub const MYSQL_PLUGIN_VIO_INFO_MYSQL_VIO_TCP: MYSQL_PLUGIN_VIO_INFO__bindgen_ty_1 =
+    MYSQL_PLUGIN_VIO_INFO__bindgen_ty_1::MYSQL_VIO_TCP;
+pub const MYSQL_PLUGIN_VIO_INFO_MYSQL_VIO_SOCKET: MYSQL_PLUGIN_VIO_INFO__bindgen_ty_1 =
+    MYSQL_PLUGIN_VIO_INFO__bindgen_ty_1::MYSQL_VIO_SOCKET;
+pub const MYSQL_PLUGIN_VIO_INFO_MYSQL_VIO_PIPE: MYSQL_PLUGIN_VIO_INFO__bindgen_ty_1 =
+    MYSQL_PLUGIN_VIO_INFO__bindgen_ty_1::MYSQL_VIO_PIPE;
+pub const MYSQL_PLUGIN_VIO_INFO_MYSQL_VIO_MEMORY: MYSQL_PLUGIN_VIO_INFO__bindgen_ty_1 =
+    MYSQL_PLUGIN_VIO_INFO__bindgen_ty_1::MYSQL_VIO_MEMORY;
+#[repr(u32)]
+#[non_exhaustive]
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub enum MYSQL_PLUGIN_VIO_INFO__bindgen_ty_1 {
+    MYSQL_VIO_INVALID = 0,
+    MYSQL_VIO_TCP = 1,
+    MYSQL_VIO_SOCKET = 2,
+    MYSQL_VIO_PIPE = 3,
+    MYSQL_VIO_MEMORY = 4,
+}
+#[test]
+fn bindgen_test_layout_MYSQL_PLUGIN_VIO_INFO() {
+    const UNINIT: ::std::mem::MaybeUninit<MYSQL_PLUGIN_VIO_INFO> =
+        ::std::mem::MaybeUninit::uninit();
+    let ptr = UNINIT.as_ptr();
+    assert_eq!(
+        ::std::mem::size_of::<MYSQL_PLUGIN_VIO_INFO>(),
+        8usize,
+        concat!("Size of: ", stringify!(MYSQL_PLUGIN_VIO_INFO))
+    );
+    assert_eq!(
+        ::std::mem::align_of::<MYSQL_PLUGIN_VIO_INFO>(),
+        4usize,
+        concat!("Alignment of ", stringify!(MYSQL_PLUGIN_VIO_INFO))
+    );
+    assert_eq!(
+        unsafe { ::std::ptr::addr_of!((*ptr).protocol) as usize - ptr as usize },
+        0usize,
+        concat!(
+            "Offset of field: ",
+            stringify!(MYSQL_PLUGIN_VIO_INFO),
*** 3254 LINES SKIPPED ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202407091004.469A4kWT005231>