miraland_sdk/
entrypoint_deprecated.rs

1//! The Rust-based BPF program entrypoint supported by the original BPF loader.
2//!
3//! The original BPF loader is deprecated and exists for backwards-compatibility
4//! reasons. This module should not be used by new programs.
5//!
6//! For more information see the [`bpf_loader_deprecated`] module.
7//!
8//! [`bpf_loader_deprecated`]: crate::bpf_loader_deprecated
9
10pub use miraland_program::entrypoint_deprecated::*;
11
12#[macro_export]
13#[deprecated(
14    since = "1.4.3",
15    note = "use miraland_program::entrypoint::entrypoint instead"
16)]
17macro_rules! entrypoint_deprecated {
18    ($process_instruction:ident) => {
19        /// # Safety
20        #[no_mangle]
21        pub unsafe extern "C" fn entrypoint(input: *mut u8) -> u64 {
22            let (program_id, accounts, instruction_data) =
23                unsafe { $crate::entrypoint_deprecated::deserialize(input) };
24            match $process_instruction(&program_id, &accounts, &instruction_data) {
25                Ok(()) => $crate::entrypoint_deprecated::SUCCESS,
26                Err(error) => error.into(),
27            }
28        }
29    };
30}