remove rust/cargo from compilation

it has become clear that incorperating rust in this project was a
mistake, since I don't understand it well enough for it to be useful,
and at this rate it'd be faster to use GLFW in C than in rust.
This commit is contained in:
Quinn
2025-04-12 20:52:35 +02:00
committed by Quinn
parent 87117931f7
commit 401854002f
5 changed files with 8 additions and 100 deletions

View File

@@ -1,33 +0,0 @@
unsafe extern "C" {
pub fn debug(fmt: *const u8, ...);
pub fn info(fmt: *const u8, ...);
pub fn warn(fmt: *const u8, ...);
pub fn error(fmt: *const u8, ...);
pub fn fatal(fmt: *const u8, ...);
}
#[macro_export]
macro_rules! debug {
($fmt:expr) => {{ $crate::error::debug($fmt.as_ptr()); }};
($fmt:expr, $($arg:expr),*) => {{ $crate::error::debug($fmt.as_ptr(), ($($arg),*)); }};
}
#[macro_export]
macro_rules! info {
($fmt:expr) => {{ $crate::error::info($fmt.as_ptr()); }};
($fmt:expr, $($arg:expr),*) => {{ $crate::error::info($fmt.as_ptr(), ($($arg),*)); }};
}
#[macro_export]
macro_rules! warn {
($fmt:expr) => {{ $crate::error::warn($fmt.as_ptr()); }};
($fmt:expr, $($arg:expr),*) => {{ $crate::error::warn($fmt.as_ptr(), ($($arg),*)); }};
}
#[macro_export]
macro_rules! error {
($fmt:expr) => {{ $crate::error::error($fmt.as_ptr()); }};
($fmt:expr, $($arg:expr),*) => {{ $crate::error::error($fmt.as_ptr(), ($($arg),*)); }};
}
#[macro_export]
macro_rules! fatal {
($fmt:expr) => {{ $crate::error::fatal($fmt.as_ptr()); }};
($fmt:expr, $($arg:expr),*) => {{ $crate::error::fatal($fmt.as_ptr(), ($($arg),*)); }};
}

View File

@@ -1,21 +0,0 @@
#![cfg_attr(not(test), no_std)]
#[cfg(not(test))]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
}
// contains all publicly facing functions
mod error;
pub extern "C" fn test() {
unsafe {
debug!("%s", "hi");
info!("%s", "hi");
warn!("%s", "hi");
error!("%s", "hi");
fatal!("%s", "hi");
}
}

View File

@@ -1,9 +1,10 @@
#include "error.h"
extern void test(void);
int main(int argc, char** argv) {
(void)argc, (void)argv;
test();
debug("owo");
debug("%s", "owo");
info("%s", "owo");
warn("%s", "owo");
error("%s", "owo");
fatal("%s", "owo");
}