Skip to content

Commit cb43878

Browse files
committed
glib-sys: ignore some unsupported types
1 parent ce13ff8 commit cb43878

File tree

5 files changed

+17
-37
lines changed

5 files changed

+17
-37
lines changed

glib/sys/Gir.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,25 @@ status = "generate"
7777
name = "get_user_state_dir"
7878
version = "2.72"
7979

80+
[[object]]
81+
name = "GLib.LOG_DOMAIN"
82+
# C-only macro
83+
status = "ignore"
84+
8085
[[object]]
8186
name = "GLib.Pid"
8287
status = "manual"
8388

8489
[[object]]
8590
name = "GLib.PollFD"
8691
status = "manual"
92+
93+
[[object]]
94+
name = "GLib.TestLogMsg"
95+
# layout is broken due to rust having no long double
96+
status = "ignore"
97+
98+
[[object]]
99+
name = "GLib.macro__has_attribute___noreturn__"
100+
# C-only macro
101+
status = "ignore"

glib/sys/src/lib.rs

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,6 @@ pub const G_LITTLE_ENDIAN: c_int = 1234;
752752
pub const G_LN10: c_double = 2.302585;
753753
pub const G_LN2: c_double = 0.693147;
754754
pub const G_LOG_2_BASE_10: c_double = 0.301030;
755-
pub const G_LOG_DOMAIN: c_char = 0;
756755
pub const G_LOG_FATAL_MASK: c_int = 5;
757756
pub const G_LOG_LEVEL_USER_SHIFT: c_int = 8;
758757
pub const G_OPTION_REMAINING: *const c_char = b"\0" as *const u8 as *const c_char;
@@ -789,7 +788,6 @@ pub const G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS: *const c_char =
789788
b"!$&'()*+,;=\0" as *const u8 as *const c_char;
790789
pub const G_USEC_PER_SEC: c_int = 1000000;
791790
pub const G_WIN32_MSG_HANDLE: c_int = 19981206;
792-
pub const g_macro__has_attribute___noreturn__: c_int = 0;
793791

794792
// Flags
795793
pub type GAsciiType = c_uint;
@@ -2185,27 +2183,6 @@ impl ::std::fmt::Debug for GTestLogBuffer {
21852183
}
21862184
}
21872185

2188-
#[repr(C)]
2189-
pub struct GTestLogMsg {
2190-
pub log_type: GTestLogType,
2191-
pub n_strings: c_uint,
2192-
pub strings: *mut *mut c_char,
2193-
pub n_nums: c_uint,
2194-
_truncated_record_marker: c_void,
2195-
// /*Unimplemented*/*mut long double
2196-
}
2197-
2198-
impl ::std::fmt::Debug for GTestLogMsg {
2199-
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
2200-
f.debug_struct(&format!("GTestLogMsg @ {self:p}"))
2201-
.field("log_type", &self.log_type)
2202-
.field("n_strings", &self.n_strings)
2203-
.field("strings", &self.strings)
2204-
.field("n_nums", &self.n_nums)
2205-
.finish()
2206-
}
2207-
}
2208-
22092186
#[repr(C)]
22102187
pub struct _GTestSuite {
22112188
_data: [u8; 0],
@@ -4808,14 +4785,14 @@ extern "C" {
48084785
// GTestLogBuffer
48094786
//=========================================================================
48104787
pub fn g_test_log_buffer_free(tbuffer: *mut GTestLogBuffer);
4811-
pub fn g_test_log_buffer_pop(tbuffer: *mut GTestLogBuffer) -> *mut GTestLogMsg;
4788+
//pub fn g_test_log_buffer_pop(tbuffer: *mut GTestLogBuffer) -> /*Ignored*/*mut GTestLogMsg;
48124789
pub fn g_test_log_buffer_push(tbuffer: *mut GTestLogBuffer, n_bytes: c_uint, bytes: *const u8);
48134790
pub fn g_test_log_buffer_new() -> *mut GTestLogBuffer;
48144791

48154792
//=========================================================================
48164793
// GTestLogMsg
48174794
//=========================================================================
4818-
pub fn g_test_log_msg_free(tmsg: *mut GTestLogMsg);
4795+
//pub fn g_test_log_msg_free(tmsg: /*Ignored*/*mut GTestLogMsg);
48194796

48204797
//=========================================================================
48214798
// GTestSuite

glib/sys/tests/abi.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -750,13 +750,6 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[
750750
alignment: align_of::<GTestLogBuffer>(),
751751
},
752752
),
753-
(
754-
"GTestLogMsg",
755-
Layout {
756-
size: size_of::<GTestLogMsg>(),
757-
alignment: align_of::<GTestLogMsg>(),
758-
},
759-
),
760753
(
761754
"GTestLogType",
762755
Layout {
@@ -1169,7 +1162,6 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
11691162
("G_LN10", "2.302585"),
11701163
("G_LN2", "0.693147"),
11711164
("G_LOG_2_BASE_10", "0.301030"),
1172-
("G_LOG_DOMAIN", "0"),
11731165
("G_LOG_FATAL_MASK", "5"),
11741166
("(guint) G_LOG_FLAG_FATAL", "2"),
11751167
("(guint) G_LOG_FLAG_RECURSION", "1"),
@@ -1809,5 +1801,4 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
18091801
),
18101802
("(gint) G_VARIANT_PARSE_ERROR_VALUE_EXPECTED", "17"),
18111803
("G_WIN32_MSG_HANDLE", "19981206"),
1812-
("g_macro__has_attribute___noreturn__", "0"),
18131804
];

glib/sys/tests/constant.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ int main() {
227227
PRINT_CONSTANT(G_LN10);
228228
PRINT_CONSTANT(G_LN2);
229229
PRINT_CONSTANT(G_LOG_2_BASE_10);
230-
PRINT_CONSTANT(G_LOG_DOMAIN);
231230
PRINT_CONSTANT(G_LOG_FATAL_MASK);
232231
PRINT_CONSTANT((guint) G_LOG_FLAG_FATAL);
233232
PRINT_CONSTANT((guint) G_LOG_FLAG_RECURSION);
@@ -834,6 +833,5 @@ int main() {
834833
PRINT_CONSTANT((gint) G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT);
835834
PRINT_CONSTANT((gint) G_VARIANT_PARSE_ERROR_VALUE_EXPECTED);
836835
PRINT_CONSTANT(G_WIN32_MSG_HANDLE);
837-
PRINT_CONSTANT(g_macro__has_attribute___noreturn__);
838836
return 0;
839837
}

glib/sys/tests/layout.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ int main() {
8686
printf("%s;%zu;%zu\n", "GTestConfig", sizeof(GTestConfig), alignof(GTestConfig));
8787
printf("%s;%zu;%zu\n", "GTestFileType", sizeof(GTestFileType), alignof(GTestFileType));
8888
printf("%s;%zu;%zu\n", "GTestLogBuffer", sizeof(GTestLogBuffer), alignof(GTestLogBuffer));
89-
printf("%s;%zu;%zu\n", "GTestLogMsg", sizeof(GTestLogMsg), alignof(GTestLogMsg));
9089
printf("%s;%zu;%zu\n", "GTestLogType", sizeof(GTestLogType), alignof(GTestLogType));
9190
printf("%s;%zu;%zu\n", "GTestResult", sizeof(GTestResult), alignof(GTestResult));
9291
printf("%s;%zu;%zu\n", "GTestSubprocessFlags", sizeof(GTestSubprocessFlags), alignof(GTestSubprocessFlags));

0 commit comments

Comments
 (0)