Merge branch 'stdio-bits' into 'master'

move stdio bits to cbindgen

See merge request redox-os/relibc!1145
This commit is contained in:
Jeremy Soller
2026-04-01 08:40:50 -06:00
3 changed files with 15 additions and 19 deletions
-17
View File
@@ -1,17 +0,0 @@
#ifndef _BITS_STDIO_H
#define _BITS_STDIO_H
// XXX: this is only here because cbindgen can't handle string constants
#define P_tmpdir "/tmp"
typedef struct FILE FILE;
// A typedef doesn't suffice, because libgmp uses this definition to check if
// STDIO was loaded.
#define FILE FILE
// Likewise, stdin, stdout, and stderr are expected to be macros.
#define stdin stdin
#define stdout stdout
#define stderr stderr
#endif /* _BITS_STDIO_H */
+14 -1
View File
@@ -1,6 +1,19 @@
sys_includes = ["stdarg.h", "stddef.h", "stdint.h", "sys/types.h", "features.h"]
include_guard = "_RELIBC_STDIO_H"
trailer = "#include <bits/stdio.h>"
trailer = """
// XXX: this is only here because cbindgen can't handle string constants
#define P_tmpdir "/tmp"
typedef struct FILE FILE;
// A typedef doesn't suffice, because libgmp uses this definition to check if
// STDIO was loaded.
#define FILE FILE
// Likewise, stdin, stdout, and stderr are expected to be macros.
#define stdin stdin
#define stdout stdout
#define stderr stderr
"""
language = "C"
style = "Type"
no_includes = true
+1 -1
View File
@@ -41,7 +41,7 @@ pub const L_tmpnam: c_int = 7;
// 36^6 (26 letters + 10 digits) is larger than i32::MAX, so just set to that
// for now
pub const TMP_MAX: int32_t = 2_147_483_647;
// XXX: defined manually in bits/stdio.h as well because cbindgen can't handle
// XXX: defined manually in cbindgen as well because it can't handle
// string constants in any form AFAICT
pub const P_tmpdir: &[u8; 5] = b"/tmp\0";