From 87536b4e2868b873b2db60d70db35aa3c93372db Mon Sep 17 00:00:00 2001 From: no92 Date: Fri, 29 Mar 2024 14:02:24 +0100 Subject: [PATCH 1/2] scripts/rust-libc: update config to work with current master --- scripts/rust-libc-config.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/rust-libc-config.yml b/scripts/rust-libc-config.yml index 660f44e40d..7df21e6328 100644 --- a/scripts/rust-libc-config.yml +++ b/scripts/rust-libc-config.yml @@ -82,6 +82,9 @@ ignored_structs: - "epoll_event" - "ifreq" - "ifconf" + - "stat64" + - "statfs64" + - "statvfs64" # unix/linux_like/mod.rs - "in_addr" - "ip_mreq" @@ -164,6 +167,9 @@ ignored_var_declarations: - "error_print_progname" ignored_macros: + - "e_exit" + - "e_termination" + - "stat64" - "CHARBITS" - "CHAR_MAX" - "CHAR_MIN" @@ -335,6 +341,9 @@ ignored_macros: - "major" - "makedev" - "minor" + - "msqid_ds" + - "statvfs64" + - "ipc_perm" - "roundup" - "s6_addr" - "s6_addr16" @@ -1976,6 +1985,13 @@ force_macro_type: - "TIOCGWINSZ" - "TIOCSCTTY" - "TIOCSWINSZ" + - "SA_NOCLDSTOP" + - "SA_NOCLDWAIT" + - "SA_NODEFER" + - "SA_ONSTACK" + - "SA_RESETHAND" + - "SA_RESTART" + - "SA_SIGINFO" "::c_uint": - "IGNBRK" - "BRKINT" From 611f94ef84cce9a374e922ea77608030a95ecde5 Mon Sep 17 00:00:00 2001 From: no92 Date: Fri, 29 Mar 2024 14:02:47 +0100 Subject: [PATCH 2/2] scripts/rust-libc: search configuration in script directory --- scripts/rust-libc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/rust-libc.py b/scripts/rust-libc.py index 92eb323385..8496c35bef 100644 --- a/scripts/rust-libc.py +++ b/scripts/rust-libc.py @@ -17,6 +17,7 @@ import argparse import io +import os import pathlib import string import sys @@ -667,12 +668,12 @@ def parse(file: pathlib.Path, base_dir: pathlib.Path): colorama.just_fix_windows_console() - with io.open("scripts/rust-libc-config.yml", "r") as f: + with io.open(os.path.join(os.path.dirname(__file__), "rust-libc-config.yml"), "r") as f: config = yaml.load(f, yaml.CSafeLoader) path = pathlib.Path(args.path) - with io.open("scripts/rust-libc-header.rs", "r") as f: + with io.open(os.path.join(os.path.dirname(__file__), "rust-libc-header.rs"), "r") as f: emit(f.read()) state = State()