Merge branch 'stdio-guards' into 'master'

add include guards for stdio bits in cbindgen

See merge request redox-os/relibc!1217
This commit is contained in:
Jeremy Soller
2026-04-22 06:33:40 -06:00
2 changed files with 6 additions and 2 deletions
+5 -2
View File
@@ -1,11 +1,12 @@
sys_includes = ["stdarg.h", "stddef.h", "stdint.h", "sys/types.h", "features.h"]
include_guard = "_RELIBC_STDIO_H"
trailer = """
#ifndef _RELIBC_BITS_STDIO_H
#define _RELIBC_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
@@ -13,6 +14,8 @@ typedef struct FILE FILE;
#define stdin stdin
#define stdout stdout
#define stderr stderr
#endif // _RELIBC_BITS_STDIO_H
"""
language = "C"
style = "Type"
+1
View File
@@ -43,6 +43,7 @@ pub const L_tmpnam: c_int = 7;
pub const TMP_MAX: int32_t = 2_147_483_647;
// XXX: defined manually in cbindgen as well because it can't handle
// string constants in any form AFAICT
/// cbindgen:ignore
pub const P_tmpdir: &[u8; 5] = b"/tmp\0";
#[allow(non_camel_case_types)]