File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,25 @@ fn get_api() -> &'static Api {
470470 unsafe { ptr. as_ref ( ) . unwrap ( ) }
471471}
472472
473+ /// Initialisation function for OSes other than Neotron OS
474+ ///
475+ /// If you are using this SDK on Windows or UNIX, your main function should
476+ /// call this function as the first thing it does. It will set up the SDK
477+ /// and then jump to `neotron_main()`.
478+ ///
479+ /// ```
480+ /// #[cfg(not(target_os = "none"))]
481+ /// fn main() {
482+ /// neotron_sdk::init();
483+ /// }
484+ ///
485+ ///
486+ /// #[no_mangle]
487+ /// extern "C" fn neotron_main() -> i32 {
488+ /// // Your code here
489+ /// 0
490+ /// }
491+ /// ```
473492#[ cfg( not( target_os = "none" ) ) ]
474493pub fn init ( ) {
475494 API . store ( fake_os_api:: get_ptr ( ) as * mut Api , Ordering :: Relaxed ) ;
You can’t perform that action at this time.
0 commit comments