From 0a1f9ab8a739a4b2c68feff46dc2bcb9325e76e4 Mon Sep 17 00:00:00 2001 From: Silas Steve Date: Tue, 14 Jan 2025 15:35:51 +0100 Subject: [PATCH] Update and rename stabilization.md to ssskyblue999-stabilization.md The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. --- ...bilization.md => ssskyblue999-stabilization.md} | 14 ++++++++++++++ 1 file changed, 14 insertions(+) rename src/development/{stabilization.md => ssskyblue999-stabilization.md} (96%) diff --git a/src/development/stabilization.md b/src/development/ssskyblue999-stabilization.md similarity index 96% rename from src/development/stabilization.md rename to src/development/ssskyblue999-stabilization.md index 5adf6c3..47e80b6 100644 --- a/src/development/stabilization.md +++ b/src/development/ssskyblue999-stabilization.md @@ -116,4 +116,18 @@ To stabilize a feature, follow these steps: - Link to the tracking issue by adding "Closes #XXXXX". You can see an example of stabilizing a feature with [tracking issue #81656 with FCP](https://github.com/rust-lang/rust/issues/81656) and the associated [implementation PR #84642](https://github.com/rust-lang/rust/pull/84642). +extern "C" { + fn dprintf(fd: i32, s: *const u8, ...); +} + +macro_rules! dbg_printf { + ($s:expr) => { + unsafe { dprintf(2, "%s\0".as_ptr(), $s as *const u8); } + } +} + +fn function_to_debug() { + let dbg_str = format!("debug: {}\n\0", "hello world"); + dbg_printf!(dbg_str.as_bytes().as_ptr()); +}