From 80db4127fd0d55df323aeb82535cfb06108ce9ec Mon Sep 17 00:00:00 2001 From: auronandace Date: Sun, 29 Mar 2026 07:44:55 +0100 Subject: [PATCH] move errno bits from C to cbindgen --- include/bits/errno.h | 16 ---------------- src/header/errno/cbindgen.toml | 7 ++++++- 2 files changed, 6 insertions(+), 17 deletions(-) delete mode 100644 include/bits/errno.h diff --git a/include/bits/errno.h b/include/bits/errno.h deleted file mode 100644 index 92f4a1fad7..0000000000 --- a/include/bits/errno.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _BITS_ERRNO_H -#define _BITS_ERRNO_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define errno (*__errno_location()) -#define program_invocation_name (*__program_invocation_name()) -#define program_invocation_short_name (*__program_invocation_short_name()) - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif /* _BITS_ERRNO_H */ diff --git a/src/header/errno/cbindgen.toml b/src/header/errno/cbindgen.toml index 3898b53db4..93f418381d 100644 --- a/src/header/errno/cbindgen.toml +++ b/src/header/errno/cbindgen.toml @@ -1,7 +1,12 @@ # POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/errno.h.html # # There are no spec quotations relating to includes -sys_includes = ["bits/errno.h"] +sys_includes = [] +after_includes = """ +#define errno (*__errno_location()) +#define program_invocation_name (*__program_invocation_name()) +#define program_invocation_short_name (*__program_invocation_short_name()) +""" include_guard = "_RELIBC_ERRNO_H" language = "C" style = "Tag"