diff --git a/src/header/stdio/cbindgen.toml b/src/header/stdio/cbindgen.toml index 540f3775b6..dd80d4e7b9 100644 --- a/src/header/stdio/cbindgen.toml +++ b/src/header/stdio/cbindgen.toml @@ -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" diff --git a/src/header/stdio/constants.rs b/src/header/stdio/constants.rs index d8caa0ca34..ff19da78e2 100644 --- a/src/header/stdio/constants.rs +++ b/src/header/stdio/constants.rs @@ -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)]