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"]
|
||||
#(#attrs)*
|
||||
pub fn #fn_name() -> ! {
|
||||
let #mutable #argument_name = #argument_type ::new();
|
||||
let #mutable #argument_name = unsafe { #argument_type ::new_in_entry() };
|
||||
|
||||
#(#stmts)*
|
||||
}
|
||||
|
|
|
@ -210,8 +210,8 @@ pub struct Gba {
|
|||
|
||||
impl Gba {
|
||||
#[doc(hidden)]
|
||||
pub fn new() -> Self {
|
||||
unsafe { GBASINGLE.take() }
|
||||
pub unsafe fn new_in_entry() -> Self {
|
||||
GBASINGLE.take()
|
||||
}
|
||||
|
||||
const unsafe fn single_new() -> Self {
|
||||
|
@ -224,12 +224,6 @@ impl Gba {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for Gba {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub trait Testable {
|
||||
fn run(&self, gba: &mut Gba);
|
||||
|
|
Loading…
Reference in a new issue