Skip entrypoint in programs (#11176)
This commit is contained in:
parent
c90de8978d
commit
6de8da05e3
|
@ -11,6 +11,8 @@ edition = "2018"
|
||||||
[features]
|
[features]
|
||||||
# On-chain program specific dependencies
|
# On-chain program specific dependencies
|
||||||
program = []
|
program = []
|
||||||
|
# Program elements to optionally skip
|
||||||
|
skip-no-mangle = []
|
||||||
# Dependencies that are not compatible or needed for on-chain programs
|
# Dependencies that are not compatible or needed for on-chain programs
|
||||||
default = [
|
default = [
|
||||||
"assert_matches",
|
"assert_matches",
|
||||||
|
|
|
@ -35,7 +35,7 @@ pub const SUCCESS: u64 = 0;
|
||||||
macro_rules! entrypoint {
|
macro_rules! entrypoint {
|
||||||
($process_instruction:ident) => {
|
($process_instruction:ident) => {
|
||||||
/// # Safety
|
/// # Safety
|
||||||
#[cfg(feature = "program")]
|
#[cfg(not(feature = "skip-no-mangle"))]
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn entrypoint(input: *mut u8) -> u64 {
|
pub unsafe extern "C" fn entrypoint(input: *mut u8) -> u64 {
|
||||||
let (program_id, accounts, instruction_data) =
|
let (program_id, accounts, instruction_data) =
|
||||||
|
|
Loading…
Reference in New Issue