From 044c0afdf2e3a6cd24eec40c16949f6f25baaa23 Mon Sep 17 00:00:00 2001 From: neuecc Date: Mon, 4 Sep 2023 20:44:27 +0900 Subject: [PATCH] generate arg1, arg2, arg3 --- csbindgen-tests/build.rs | 3 +- csbindgen-tests/src/lib.rs | 8 + csbindgen-tests/src/lz4.rs | 920 ++++++++++---------------------- csbindgen/src/type_meta.rs | 10 +- dotnet-sandbox/NativeMethods.cs | 48 +- dotnet-sandbox/lz4_bindgen.cs | 41 +- 6 files changed, 356 insertions(+), 674 deletions(-) diff --git a/csbindgen-tests/build.rs b/csbindgen-tests/build.rs index 5b70059..1c27da7 100644 --- a/csbindgen-tests/build.rs +++ b/csbindgen-tests/build.rs @@ -87,7 +87,8 @@ fn main() -> Result<(), Box> { //.input_extern_files(&["src/lib.rs"]) .csharp_class_name("NativeMethods") .csharp_dll_name("csbindgen_tests") - .csharp_use_function_pointer(true) + // .csharp_use_function_pointer(true) + .csharp_use_function_pointer(false) .csharp_generate_const(true) .generate_csharp_file("../dotnet-sandbox/NativeMethods.cs") .unwrap(); diff --git a/csbindgen-tests/src/lib.rs b/csbindgen-tests/src/lib.rs index b2bbb99..38e4ca5 100644 --- a/csbindgen-tests/src/lib.rs +++ b/csbindgen-tests/src/lib.rs @@ -170,6 +170,14 @@ pub extern "C" fn event(event: event) { println!("{:?}", event); } +#[no_mangle] +pub extern "C" fn test_func_issue_39(f: extern "C" fn(i32)){ +} + +#[no_mangle] +pub extern "C" fn test_func_issue_39_variation1(f: extern "C" fn(i32, i32, i32)){ +} + #[no_mangle] pub extern "C" fn nest_test( _f: ::std::option::Option< diff --git a/csbindgen-tests/src/lz4.rs b/csbindgen-tests/src/lz4.rs index 7aace4b..ab61181 100644 --- a/csbindgen-tests/src/lz4.rs +++ b/csbindgen-tests/src/lz4.rs @@ -1,5 +1,34 @@ /* automatically generated by rust-bindgen 0.64.0 */ +pub const _VCRT_COMPILER_PREPROCESSOR: u32 = 1; +pub const _SAL_VERSION: u32 = 20; +pub const __SAL_H_VERSION: u32 = 180000000; +pub const _USE_DECLSPECS_FOR_SAL: u32 = 0; +pub const _USE_ATTRIBUTES_FOR_SAL: u32 = 0; +pub const _CRT_PACKING: u32 = 8; +pub const _HAS_EXCEPTIONS: u32 = 1; +pub const _STL_LANG: u32 = 0; +pub const _HAS_CXX17: u32 = 0; +pub const _HAS_CXX20: u32 = 0; +pub const _HAS_CXX23: u32 = 0; +pub const _HAS_NODISCARD: u32 = 0; +pub const _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE: u32 = 1; +pub const _CRT_BUILD_DESKTOP_APP: u32 = 1; +pub const _ARGMAX: u32 = 100; +pub const _CRT_INT_MAX: u32 = 2147483647; +pub const _CRT_FUNCTIONS_REQUIRED: u32 = 1; +pub const _CRT_HAS_CXX17: u32 = 0; +pub const _CRT_HAS_C11: u32 = 1; +pub const _CRT_INTERNAL_NONSTDC_NAMES: u32 = 1; +pub const __STDC_SECURE_LIB__: u32 = 200411; +pub const __GOT_SECURE_LIB__: u32 = 200411; +pub const __STDC_WANT_SECURE_LIB__: u32 = 1; +pub const _SECURECRT_FILL_BUFFER_PATTERN: u32 = 254; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES: u32 = 1; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY: u32 = 0; pub const LZ4_FREESTANDING: u32 = 0; pub const LZ4_VERSION_MAJOR: u32 = 1; pub const LZ4_VERSION_MINOR: u32 = 9; @@ -13,80 +42,10 @@ pub const LZ4_MAX_INPUT_SIZE: u32 = 2113929216; pub const LZ4_HASHLOG: u32 = 12; pub const LZ4_HASHTABLESIZE: u32 = 16384; pub const LZ4_HASH_SIZE_U32: u32 = 4096; -pub const __WORDSIZE: u32 = 64; -pub const __DARWIN_ONLY_64_BIT_INO_T: u32 = 1; -pub const __DARWIN_ONLY_UNIX_CONFORMANCE: u32 = 1; -pub const __DARWIN_ONLY_VERS_1050: u32 = 1; -pub const __DARWIN_UNIX03: u32 = 1; -pub const __DARWIN_64_BIT_INO_T: u32 = 1; -pub const __DARWIN_VERS_1050: u32 = 1; -pub const __DARWIN_NON_CANCELABLE: u32 = 0; -pub const __DARWIN_SUF_EXTSN: &[u8; 14usize] = b"$DARWIN_EXTSN\0"; -pub const __DARWIN_C_ANSI: u32 = 4096; -pub const __DARWIN_C_FULL: u32 = 900000; -pub const __DARWIN_C_LEVEL: u32 = 900000; -pub const __STDC_WANT_LIB_EXT1__: u32 = 1; -pub const __DARWIN_NO_LONG_LONG: u32 = 0; -pub const _DARWIN_FEATURE_64_BIT_INODE: u32 = 1; -pub const _DARWIN_FEATURE_ONLY_64_BIT_INODE: u32 = 1; -pub const _DARWIN_FEATURE_ONLY_VERS_1050: u32 = 1; -pub const _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE: u32 = 1; -pub const _DARWIN_FEATURE_UNIX_CONFORMANCE: u32 = 3; -pub const __has_ptrcheck: u32 = 0; -pub const __PTHREAD_SIZE__: u32 = 8176; -pub const __PTHREAD_ATTR_SIZE__: u32 = 56; -pub const __PTHREAD_MUTEXATTR_SIZE__: u32 = 8; -pub const __PTHREAD_MUTEX_SIZE__: u32 = 56; -pub const __PTHREAD_CONDATTR_SIZE__: u32 = 8; -pub const __PTHREAD_COND_SIZE__: u32 = 40; -pub const __PTHREAD_ONCE_SIZE__: u32 = 8; -pub const __PTHREAD_RWLOCK_SIZE__: u32 = 192; -pub const __PTHREAD_RWLOCKATTR_SIZE__: u32 = 16; -pub const INT8_MAX: u32 = 127; -pub const INT16_MAX: u32 = 32767; -pub const INT32_MAX: u32 = 2147483647; -pub const INT64_MAX: u64 = 9223372036854775807; -pub const INT8_MIN: i32 = -128; -pub const INT16_MIN: i32 = -32768; -pub const INT32_MIN: i32 = -2147483648; -pub const INT64_MIN: i64 = -9223372036854775808; -pub const UINT8_MAX: u32 = 255; -pub const UINT16_MAX: u32 = 65535; -pub const UINT32_MAX: u32 = 4294967295; -pub const UINT64_MAX: i32 = -1; -pub const INT_LEAST8_MIN: i32 = -128; -pub const INT_LEAST16_MIN: i32 = -32768; -pub const INT_LEAST32_MIN: i32 = -2147483648; -pub const INT_LEAST64_MIN: i64 = -9223372036854775808; -pub const INT_LEAST8_MAX: u32 = 127; -pub const INT_LEAST16_MAX: u32 = 32767; -pub const INT_LEAST32_MAX: u32 = 2147483647; -pub const INT_LEAST64_MAX: u64 = 9223372036854775807; -pub const UINT_LEAST8_MAX: u32 = 255; -pub const UINT_LEAST16_MAX: u32 = 65535; -pub const UINT_LEAST32_MAX: u32 = 4294967295; -pub const UINT_LEAST64_MAX: i32 = -1; -pub const INT_FAST8_MIN: i32 = -128; -pub const INT_FAST16_MIN: i32 = -32768; -pub const INT_FAST32_MIN: i32 = -2147483648; -pub const INT_FAST64_MIN: i64 = -9223372036854775808; -pub const INT_FAST8_MAX: u32 = 127; -pub const INT_FAST16_MAX: u32 = 32767; -pub const INT_FAST32_MAX: u32 = 2147483647; -pub const INT_FAST64_MAX: u64 = 9223372036854775807; -pub const UINT_FAST8_MAX: u32 = 255; -pub const UINT_FAST16_MAX: u32 = 65535; -pub const UINT_FAST32_MAX: u32 = 4294967295; -pub const UINT_FAST64_MAX: i32 = -1; -pub const INTPTR_MAX: u64 = 9223372036854775807; -pub const INTPTR_MIN: i64 = -9223372036854775808; -pub const UINTPTR_MAX: i32 = -1; -pub const SIZE_MAX: i32 = -1; -pub const RSIZE_MAX: i32 = -1; -pub const WINT_MIN: i32 = -2147483648; -pub const WINT_MAX: u32 = 2147483647; -pub const SIG_ATOMIC_MIN: i32 = -2147483648; -pub const SIG_ATOMIC_MAX: u32 = 2147483647; +pub const WCHAR_MIN: u32 = 0; +pub const WCHAR_MAX: u32 = 65535; +pub const WINT_MIN: u32 = 0; +pub const WINT_MAX: u32 = 65535; pub const LZ4_STREAM_MINSIZE: u32 = 16416; pub const LZ4_STREAMDECODE_MINSIZE: u32 = 32; pub const LZ4HC_CLEVEL_MIN: u32 = 3; @@ -114,8 +73,211 @@ pub const XXH_VERSION_MAJOR: u32 = 0; pub const XXH_VERSION_MINOR: u32 = 6; pub const XXH_VERSION_RELEASE: u32 = 5; pub const XXH_VERSION_NUMBER: u32 = 605; -pub type wchar_t = ::std::os::raw::c_int; -pub type max_align_t = f64; +pub type va_list = *mut ::std::os::raw::c_char; +extern "C" { + pub fn __va_start(arg1: *mut *mut ::std::os::raw::c_char, ...); +} +pub type __vcrt_bool = bool; +pub type wchar_t = ::std::os::raw::c_ushort; +extern "C" { + pub fn __security_init_cookie(); +} +extern "C" { + pub fn __security_check_cookie(_StackCookie: usize); +} +extern "C" { + pub fn __report_gsfailure(_StackCookie: usize) -> !; +} +extern "C" { + pub static mut __security_cookie: usize; +} +pub type __crt_bool = bool; +extern "C" { + pub fn _invalid_parameter_noinfo(); +} +extern "C" { + pub fn _invalid_parameter_noinfo_noreturn() -> !; +} +extern "C" { + pub fn _invoke_watson( + _Expression: *const wchar_t, + _FunctionName: *const wchar_t, + _FileName: *const wchar_t, + _LineNo: ::std::os::raw::c_uint, + _Reserved: usize, + ) -> !; +} +pub type errno_t = ::std::os::raw::c_int; +pub type wint_t = ::std::os::raw::c_ushort; +pub type wctype_t = ::std::os::raw::c_ushort; +pub type __time32_t = ::std::os::raw::c_long; +pub type __time64_t = ::std::os::raw::c_longlong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __crt_locale_data_public { + pub _locale_pctype: *const ::std::os::raw::c_ushort, + pub _locale_mb_cur_max: ::std::os::raw::c_int, + pub _locale_lc_codepage: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout___crt_locale_data_public() { + const UNINIT: ::std::mem::MaybeUninit<__crt_locale_data_public> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__crt_locale_data_public>(), + 16usize, + concat!("Size of: ", stringify!(__crt_locale_data_public)) + ); + assert_eq!( + ::std::mem::align_of::<__crt_locale_data_public>(), + 8usize, + concat!("Alignment of ", stringify!(__crt_locale_data_public)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._locale_pctype) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_data_public), + "::", + stringify!(_locale_pctype) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._locale_mb_cur_max) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_data_public), + "::", + stringify!(_locale_mb_cur_max) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._locale_lc_codepage) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_data_public), + "::", + stringify!(_locale_lc_codepage) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __crt_locale_pointers { + pub locinfo: *mut __crt_locale_data, + pub mbcinfo: *mut __crt_multibyte_data, +} +#[test] +fn bindgen_test_layout___crt_locale_pointers() { + const UNINIT: ::std::mem::MaybeUninit<__crt_locale_pointers> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<__crt_locale_pointers>(), + 16usize, + concat!("Size of: ", stringify!(__crt_locale_pointers)) + ); + assert_eq!( + ::std::mem::align_of::<__crt_locale_pointers>(), + 8usize, + concat!("Alignment of ", stringify!(__crt_locale_pointers)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).locinfo) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_pointers), + "::", + stringify!(locinfo) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mbcinfo) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__crt_locale_pointers), + "::", + stringify!(mbcinfo) + ) + ); +} +pub type _locale_t = *mut __crt_locale_pointers; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _Mbstatet { + pub _Wchar: ::std::os::raw::c_ulong, + pub _Byte: ::std::os::raw::c_ushort, + pub _State: ::std::os::raw::c_ushort, +} +#[test] +fn bindgen_test_layout__Mbstatet() { + const UNINIT: ::std::mem::MaybeUninit<_Mbstatet> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::<_Mbstatet>(), + 8usize, + concat!("Size of: ", stringify!(_Mbstatet)) + ); + assert_eq!( + ::std::mem::align_of::<_Mbstatet>(), + 4usize, + concat!("Alignment of ", stringify!(_Mbstatet)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._Wchar) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_Mbstatet), + "::", + stringify!(_Wchar) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._Byte) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(_Mbstatet), + "::", + stringify!(_Byte) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._State) as usize - ptr as usize }, + 6usize, + concat!( + "Offset of field: ", + stringify!(_Mbstatet), + "::", + stringify!(_State) + ) + ); +} +pub type mbstate_t = _Mbstatet; +pub type time_t = __time64_t; +pub type rsize_t = usize; +extern "C" { + pub fn _errno() -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn _set_errno(_Value: ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn _get_errno(_Value: *mut ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn __threadid() -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn __threadhandle() -> usize; +} extern "C" { pub fn LZ4_versionNumber() -> ::std::os::raw::c_int; } @@ -277,571 +439,24 @@ extern "C" { dictSize: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -pub type int_least8_t = i8; -pub type int_least16_t = i16; -pub type int_least32_t = i32; -pub type int_least64_t = i64; -pub type uint_least8_t = u8; -pub type uint_least16_t = u16; -pub type uint_least32_t = u32; -pub type uint_least64_t = u64; -pub type int_fast8_t = i8; -pub type int_fast16_t = i16; -pub type int_fast32_t = i32; -pub type int_fast64_t = i64; -pub type uint_fast8_t = u8; -pub type uint_fast16_t = u16; -pub type uint_fast32_t = u32; -pub type uint_fast64_t = u64; -pub type __int8_t = ::std::os::raw::c_schar; -pub type __uint8_t = ::std::os::raw::c_uchar; -pub type __int16_t = ::std::os::raw::c_short; -pub type __uint16_t = ::std::os::raw::c_ushort; -pub type __int32_t = ::std::os::raw::c_int; -pub type __uint32_t = ::std::os::raw::c_uint; -pub type __int64_t = ::std::os::raw::c_longlong; -pub type __uint64_t = ::std::os::raw::c_ulonglong; -pub type __darwin_intptr_t = ::std::os::raw::c_long; -pub type __darwin_natural_t = ::std::os::raw::c_uint; -pub type __darwin_ct_rune_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union __mbstate_t { - pub __mbstate8: [::std::os::raw::c_char; 128usize], - pub _mbstateL: ::std::os::raw::c_longlong, -} -#[test] -fn bindgen_test_layout___mbstate_t() { - const UNINIT: ::std::mem::MaybeUninit<__mbstate_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__mbstate_t>(), - 128usize, - concat!("Size of: ", stringify!(__mbstate_t)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t>(), - 8usize, - concat!("Alignment of ", stringify!(__mbstate_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__mbstate8) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__mbstate8) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._mbstateL) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(_mbstateL) - ) - ); -} -pub type __darwin_mbstate_t = __mbstate_t; -pub type __darwin_ptrdiff_t = ::std::os::raw::c_long; -pub type __darwin_size_t = ::std::os::raw::c_ulong; -pub type __darwin_va_list = __builtin_va_list; -pub type __darwin_wchar_t = ::std::os::raw::c_int; -pub type __darwin_rune_t = __darwin_wchar_t; -pub type __darwin_wint_t = ::std::os::raw::c_int; -pub type __darwin_clock_t = ::std::os::raw::c_ulong; -pub type __darwin_socklen_t = __uint32_t; -pub type __darwin_ssize_t = ::std::os::raw::c_long; -pub type __darwin_time_t = ::std::os::raw::c_long; -pub type __darwin_blkcnt_t = __int64_t; -pub type __darwin_blksize_t = __int32_t; -pub type __darwin_dev_t = __int32_t; -pub type __darwin_fsblkcnt_t = ::std::os::raw::c_uint; -pub type __darwin_fsfilcnt_t = ::std::os::raw::c_uint; -pub type __darwin_gid_t = __uint32_t; -pub type __darwin_id_t = __uint32_t; -pub type __darwin_ino64_t = __uint64_t; -pub type __darwin_ino_t = __darwin_ino64_t; -pub type __darwin_mach_port_name_t = __darwin_natural_t; -pub type __darwin_mach_port_t = __darwin_mach_port_name_t; -pub type __darwin_mode_t = __uint16_t; -pub type __darwin_off_t = __int64_t; -pub type __darwin_pid_t = __int32_t; -pub type __darwin_sigset_t = __uint32_t; -pub type __darwin_suseconds_t = __int32_t; -pub type __darwin_uid_t = __uint32_t; -pub type __darwin_useconds_t = __uint32_t; -pub type __darwin_uuid_t = [::std::os::raw::c_uchar; 16usize]; -pub type __darwin_uuid_string_t = [::std::os::raw::c_char; 37usize]; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __darwin_pthread_handler_rec { - pub __routine: ::std::option::Option, - pub __arg: *mut ::std::os::raw::c_void, - pub __next: *mut __darwin_pthread_handler_rec, -} -#[test] -fn bindgen_test_layout___darwin_pthread_handler_rec() { - const UNINIT: ::std::mem::MaybeUninit<__darwin_pthread_handler_rec> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__darwin_pthread_handler_rec>(), - 24usize, - concat!("Size of: ", stringify!(__darwin_pthread_handler_rec)) - ); - assert_eq!( - ::std::mem::align_of::<__darwin_pthread_handler_rec>(), - 8usize, - concat!("Alignment of ", stringify!(__darwin_pthread_handler_rec)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__routine) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__darwin_pthread_handler_rec), - "::", - stringify!(__routine) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__arg) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__darwin_pthread_handler_rec), - "::", - stringify!(__arg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__darwin_pthread_handler_rec), - "::", - stringify!(__next) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_attr_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 56usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_attr_t() { - const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_attr_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_attr_t>(), - 64usize, - concat!("Size of: ", stringify!(_opaque_pthread_attr_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_attr_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_attr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_attr_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_attr_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_cond_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 40usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_cond_t() { - const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_cond_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_cond_t>(), - 48usize, - concat!("Size of: ", stringify!(_opaque_pthread_cond_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_cond_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_cond_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_cond_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_cond_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_condattr_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 8usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_condattr_t() { - const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_condattr_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_condattr_t>(), - 16usize, - concat!("Size of: ", stringify!(_opaque_pthread_condattr_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_condattr_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_condattr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_condattr_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_condattr_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_mutex_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 56usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_mutex_t() { - const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_mutex_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_mutex_t>(), - 64usize, - concat!("Size of: ", stringify!(_opaque_pthread_mutex_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_mutex_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_mutex_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_mutex_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_mutex_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_mutexattr_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 8usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_mutexattr_t() { - const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_mutexattr_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_mutexattr_t>(), - 16usize, - concat!("Size of: ", stringify!(_opaque_pthread_mutexattr_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_mutexattr_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_mutexattr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_mutexattr_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_mutexattr_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_once_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 8usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_once_t() { - const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_once_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_once_t>(), - 16usize, - concat!("Size of: ", stringify!(_opaque_pthread_once_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_once_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_once_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_once_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_once_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_rwlock_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 192usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_rwlock_t() { - const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_rwlock_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_rwlock_t>(), - 200usize, - concat!("Size of: ", stringify!(_opaque_pthread_rwlock_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_rwlock_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_rwlock_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_rwlock_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_rwlock_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_rwlockattr_t { - pub __sig: ::std::os::raw::c_long, - pub __opaque: [::std::os::raw::c_char; 16usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_rwlockattr_t() { - const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_rwlockattr_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_rwlockattr_t>(), - 24usize, - concat!("Size of: ", stringify!(_opaque_pthread_rwlockattr_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_rwlockattr_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_rwlockattr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_rwlockattr_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_rwlockattr_t), - "::", - stringify!(__opaque) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _opaque_pthread_t { - pub __sig: ::std::os::raw::c_long, - pub __cleanup_stack: *mut __darwin_pthread_handler_rec, - pub __opaque: [::std::os::raw::c_char; 8176usize], -} -#[test] -fn bindgen_test_layout__opaque_pthread_t() { - const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_opaque_pthread_t>(), - 8192usize, - concat!("Size of: ", stringify!(_opaque_pthread_t)) - ); - assert_eq!( - ::std::mem::align_of::<_opaque_pthread_t>(), - 8usize, - concat!("Alignment of ", stringify!(_opaque_pthread_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_t), - "::", - stringify!(__sig) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_stack) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_t), - "::", - stringify!(__cleanup_stack) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_opaque_pthread_t), - "::", - stringify!(__opaque) - ) - ); -} -pub type __darwin_pthread_attr_t = _opaque_pthread_attr_t; -pub type __darwin_pthread_cond_t = _opaque_pthread_cond_t; -pub type __darwin_pthread_condattr_t = _opaque_pthread_condattr_t; -pub type __darwin_pthread_key_t = ::std::os::raw::c_ulong; -pub type __darwin_pthread_mutex_t = _opaque_pthread_mutex_t; -pub type __darwin_pthread_mutexattr_t = _opaque_pthread_mutexattr_t; -pub type __darwin_pthread_once_t = _opaque_pthread_once_t; -pub type __darwin_pthread_rwlock_t = _opaque_pthread_rwlock_t; -pub type __darwin_pthread_rwlockattr_t = _opaque_pthread_rwlockattr_t; -pub type __darwin_pthread_t = *mut _opaque_pthread_t; -pub type u_int8_t = ::std::os::raw::c_uchar; -pub type u_int16_t = ::std::os::raw::c_ushort; -pub type u_int32_t = ::std::os::raw::c_uint; -pub type u_int64_t = ::std::os::raw::c_ulonglong; -pub type register_t = i64; -pub type user_addr_t = u_int64_t; -pub type user_size_t = u_int64_t; -pub type user_ssize_t = i64; -pub type user_long_t = i64; -pub type user_ulong_t = u_int64_t; -pub type user_time_t = i64; -pub type user_off_t = i64; -pub type syscall_arg_t = u_int64_t; -pub type intmax_t = ::std::os::raw::c_long; -pub type uintmax_t = ::std::os::raw::c_ulong; +pub type int_least8_t = ::std::os::raw::c_schar; +pub type int_least16_t = ::std::os::raw::c_short; +pub type int_least32_t = ::std::os::raw::c_int; +pub type int_least64_t = ::std::os::raw::c_longlong; +pub type uint_least8_t = ::std::os::raw::c_uchar; +pub type uint_least16_t = ::std::os::raw::c_ushort; +pub type uint_least32_t = ::std::os::raw::c_uint; +pub type uint_least64_t = ::std::os::raw::c_ulonglong; +pub type int_fast8_t = ::std::os::raw::c_schar; +pub type int_fast16_t = ::std::os::raw::c_int; +pub type int_fast32_t = ::std::os::raw::c_int; +pub type int_fast64_t = ::std::os::raw::c_longlong; +pub type uint_fast8_t = ::std::os::raw::c_uchar; +pub type uint_fast16_t = ::std::os::raw::c_uint; +pub type uint_fast32_t = ::std::os::raw::c_uint; +pub type uint_fast64_t = ::std::os::raw::c_ulonglong; +pub type intmax_t = ::std::os::raw::c_longlong; +pub type uintmax_t = ::std::os::raw::c_ulonglong; pub type LZ4_i8 = i8; pub type LZ4_byte = u8; pub type LZ4_u16 = u16; @@ -1631,19 +1246,19 @@ pub const LZ4F_blockSizeID_t_LZ4F_max64KB: LZ4F_blockSizeID_t = 4; pub const LZ4F_blockSizeID_t_LZ4F_max256KB: LZ4F_blockSizeID_t = 5; pub const LZ4F_blockSizeID_t_LZ4F_max1MB: LZ4F_blockSizeID_t = 6; pub const LZ4F_blockSizeID_t_LZ4F_max4MB: LZ4F_blockSizeID_t = 7; -pub type LZ4F_blockSizeID_t = ::std::os::raw::c_uint; +pub type LZ4F_blockSizeID_t = ::std::os::raw::c_int; pub const LZ4F_blockMode_t_LZ4F_blockLinked: LZ4F_blockMode_t = 0; pub const LZ4F_blockMode_t_LZ4F_blockIndependent: LZ4F_blockMode_t = 1; -pub type LZ4F_blockMode_t = ::std::os::raw::c_uint; +pub type LZ4F_blockMode_t = ::std::os::raw::c_int; pub const LZ4F_contentChecksum_t_LZ4F_noContentChecksum: LZ4F_contentChecksum_t = 0; pub const LZ4F_contentChecksum_t_LZ4F_contentChecksumEnabled: LZ4F_contentChecksum_t = 1; -pub type LZ4F_contentChecksum_t = ::std::os::raw::c_uint; +pub type LZ4F_contentChecksum_t = ::std::os::raw::c_int; pub const LZ4F_blockChecksum_t_LZ4F_noBlockChecksum: LZ4F_blockChecksum_t = 0; pub const LZ4F_blockChecksum_t_LZ4F_blockChecksumEnabled: LZ4F_blockChecksum_t = 1; -pub type LZ4F_blockChecksum_t = ::std::os::raw::c_uint; +pub type LZ4F_blockChecksum_t = ::std::os::raw::c_int; pub const LZ4F_frameType_t_LZ4F_frame: LZ4F_frameType_t = 0; pub const LZ4F_frameType_t_LZ4F_skippableFrame: LZ4F_frameType_t = 1; -pub type LZ4F_frameType_t = ::std::os::raw::c_uint; +pub type LZ4F_frameType_t = ::std::os::raw::c_int; #[doc = " LZ4F_frameInfo_t :\n makes it possible to set or read frame parameters.\n Structure must be first init to 0, using memset() or LZ4F_INIT_FRAMEINFO,\n setting all parameters to default.\n It's then possible to update selectively some parameters"] #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2051,7 +1666,7 @@ extern "C" { } pub const XXH_errorcode_XXH_OK: XXH_errorcode = 0; pub const XXH_errorcode_XXH_ERROR: XXH_errorcode = 1; -pub type XXH_errorcode = ::std::os::raw::c_uint; +pub type XXH_errorcode = ::std::os::raw::c_int; extern "C" { pub fn XXH_versionNumber() -> ::std::os::raw::c_uint; } @@ -2205,4 +1820,13 @@ extern "C" { extern "C" { pub fn XXH64_hashFromCanonical(src: *const XXH64_canonical_t) -> XXH64_hash_t; } -pub type __builtin_va_list = *mut ::std::os::raw::c_char; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __crt_locale_data { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __crt_multibyte_data { + pub _address: u8, +} diff --git a/csbindgen/src/type_meta.rs b/csbindgen/src/type_meta.rs index 9e2146a..5466f00 100644 --- a/csbindgen/src/type_meta.rs +++ b/csbindgen/src/type_meta.rs @@ -451,10 +451,12 @@ pub fn build_method_delegate_if_required( method_name, parameter_name, ); - // a is ascii for 97 - let parameter_name = char::from_u32(index as u32 + 97) - .unwrap_or('?') - .to_string(); + let parameter_name = if p.name == "" { + format!("arg{}", index + 1) + } else { + p.name.clone() + }; + format!("{} {}", cs, escape_name(parameter_name.as_str())) }) .collect::>() diff --git a/dotnet-sandbox/NativeMethods.cs b/dotnet-sandbox/NativeMethods.cs index 2072554..b23e5e5 100644 --- a/dotnet-sandbox/NativeMethods.cs +++ b/dotnet-sandbox/NativeMethods.cs @@ -46,8 +46,23 @@ namespace CsBindgen [DllImport(__DllName, EntryPoint = "@event", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void @event(@event @event); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void test_func_issue_39_f_delegate(int arg1); + + [DllImport(__DllName, EntryPoint = "test_func_issue_39", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void test_func_issue_39(test_func_issue_39_f_delegate f); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void test_func_issue_39_variation1_f_delegate(int arg1, int arg2, int arg3); + + [DllImport(__DllName, EntryPoint = "test_func_issue_39_variation1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void test_func_issue_39_variation1(test_func_issue_39_variation1_f_delegate f); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int nest_test__f_delegate(nest_test__f_delegate* pxFunc); + [DllImport(__DllName, EntryPoint = "nest_test", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void nest_test(delegate* unmanaged[Cdecl]*, int> _f); + public static extern void nest_test(nest_test__f_delegate _f); [DllImport(__DllName, EntryPoint = "alias_test1", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void alias_test1(long* _a); @@ -67,14 +82,23 @@ namespace CsBindgen [DllImport(__DllName, EntryPoint = "csharp_to_rust_bytes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void csharp_to_rust_bytes(byte* bytes, int len); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int callback_test_cb_delegate(int a); + [DllImport(__DllName, EntryPoint = "callback_test", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int callback_test(delegate* unmanaged[Cdecl] cb); + public static extern int callback_test(callback_test_cb_delegate cb); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int csharp_to_rust_cb_delegate(int x, int y); [DllImport(__DllName, EntryPoint = "csharp_to_rust", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void csharp_to_rust(delegate* unmanaged[Cdecl] cb); + public static extern void csharp_to_rust(csharp_to_rust_cb_delegate cb); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int rust_to_csharp_return_delegate(int x, int y); [DllImport(__DllName, EntryPoint = "rust_to_csharp", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern delegate* unmanaged[Cdecl] rust_to_csharp(); + public static extern rust_to_csharp_return_delegate rust_to_csharp(); [DllImport(__DllName, EntryPoint = "sum", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int sum(int x, int y); @@ -82,14 +106,20 @@ namespace CsBindgen [DllImport(__DllName, EntryPoint = "cbt", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void cbt(CallbackTable _cb); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int nullable_callback_test_cb_delegate(int a); + [DllImport(__DllName, EntryPoint = "nullable_callback_test", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int nullable_callback_test(delegate* unmanaged[Cdecl] cb); + public static extern int nullable_callback_test(nullable_callback_test_cb_delegate cb); [DllImport(__DllName, EntryPoint = "types_iroiro", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void types_iroiro(nint _i, nuint _u, CLong _cl, CULong _cul); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int callback_test2_return_delegate(int a); + [DllImport(__DllName, EntryPoint = "callback_test2", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern delegate* unmanaged[Cdecl] callback_test2(); + public static extern callback_test2_return_delegate callback_test2(); [DllImport(__DllName, EntryPoint = "callback", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int callback(int a); @@ -184,7 +214,7 @@ namespace CsBindgen [StructLayout(LayoutKind.Sequential)] internal unsafe partial struct NfcCard { - public delegate* unmanaged[Cdecl] @delegate; + public void* @delegate; } [StructLayout(LayoutKind.Sequential)] @@ -238,8 +268,8 @@ namespace CsBindgen [StructLayout(LayoutKind.Sequential)] internal unsafe partial struct CallbackTable { - public delegate* unmanaged[Cdecl] foo; - public delegate* unmanaged[Cdecl] foobar; + public void* foo; + public void* foobar; } diff --git a/dotnet-sandbox/lz4_bindgen.cs b/dotnet-sandbox/lz4_bindgen.cs index 2becd1e..e75bf0d 100644 --- a/dotnet-sandbox/lz4_bindgen.cs +++ b/dotnet-sandbox/lz4_bindgen.cs @@ -19,6 +19,35 @@ namespace CsBindgen #endif + public const uint _VCRT_COMPILER_PREPROCESSOR = 1; + public const uint _SAL_VERSION = 20; + public const uint __SAL_H_VERSION = 180000000; + public const uint _USE_DECLSPECS_FOR_SAL = 0; + public const uint _USE_ATTRIBUTES_FOR_SAL = 0; + public const uint _CRT_PACKING = 8; + public const uint _HAS_EXCEPTIONS = 1; + public const uint _STL_LANG = 0; + public const uint _HAS_CXX17 = 0; + public const uint _HAS_CXX20 = 0; + public const uint _HAS_CXX23 = 0; + public const uint _HAS_NODISCARD = 0; + public const uint _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE = 1; + public const uint _CRT_BUILD_DESKTOP_APP = 1; + public const uint _ARGMAX = 100; + public const uint _CRT_INT_MAX = 2147483647; + public const uint _CRT_FUNCTIONS_REQUIRED = 1; + public const uint _CRT_HAS_CXX17 = 0; + public const uint _CRT_HAS_C11 = 1; + public const uint _CRT_INTERNAL_NONSTDC_NAMES = 1; + public const uint __STDC_SECURE_LIB__ = 200411; + public const uint __GOT_SECURE_LIB__ = 200411; + public const uint __STDC_WANT_SECURE_LIB__ = 1; + public const uint _SECURECRT_FILL_BUFFER_PATTERN = 254; + public const uint _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES = 0; + public const uint _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT = 0; + public const uint _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES = 1; + public const uint _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY = 0; + public const uint _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY = 0; public const uint LZ4_FREESTANDING = 0; public const uint LZ4_VERSION_MAJOR = 1; public const uint LZ4_VERSION_MINOR = 9; @@ -32,18 +61,6 @@ namespace CsBindgen public const uint LZ4_HASHLOG = 12; public const uint LZ4_HASHTABLESIZE = 16384; public const uint LZ4_HASH_SIZE_U32 = 4096; - public const uint _VCRT_COMPILER_PREPROCESSOR = 1; - public const uint _SAL_VERSION = 20; - public const uint __SAL_H_VERSION = 180000000; - public const uint _USE_DECLSPECS_FOR_SAL = 0; - public const uint _USE_ATTRIBUTES_FOR_SAL = 0; - public const uint _CRT_PACKING = 8; - public const uint _HAS_EXCEPTIONS = 1; - public const uint _STL_LANG = 0; - public const uint _HAS_CXX17 = 0; - public const uint _HAS_CXX20 = 0; - public const uint _HAS_CXX23 = 0; - public const uint _HAS_NODISCARD = 0; public const uint WCHAR_MIN = 0; public const uint WCHAR_MAX = 65535; public const uint WINT_MIN = 0;