mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
Make it harder to call by accident
This commit is contained in:
parent
040ff2eb0c
commit
6d8d72077f
|
@ -77,7 +77,7 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
|
||||||
#[export_name = "main"]
|
#[export_name = "main"]
|
||||||
#(#attrs)*
|
#(#attrs)*
|
||||||
pub fn #fn_name() -> ! {
|
pub fn #fn_name() -> ! {
|
||||||
let #mutable #argument_name = #argument_type ::new();
|
let #mutable #argument_name = unsafe { #argument_type ::new_in_entry() };
|
||||||
|
|
||||||
#(#stmts)*
|
#(#stmts)*
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,8 +210,8 @@ pub struct Gba {
|
||||||
|
|
||||||
impl Gba {
|
impl Gba {
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub fn new() -> Self {
|
pub unsafe fn new_in_entry() -> Self {
|
||||||
unsafe { GBASINGLE.take() }
|
GBASINGLE.take()
|
||||||
}
|
}
|
||||||
|
|
||||||
const unsafe fn single_new() -> Self {
|
const unsafe fn single_new() -> Self {
|
||||||
|
@ -224,12 +224,6 @@ impl Gba {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Gba {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self::new()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub trait Testable {
|
pub trait Testable {
|
||||||
fn run(&self, gba: &mut Gba);
|
fn run(&self, gba: &mut Gba);
|
||||||
|
|
Loading…
Reference in a new issue