diff --git a/programs/bpf/c/sdk/bpf.mk b/programs/bpf/c/sdk/bpf.mk index 87dc1bcf96..5ec83ebe56 100644 --- a/programs/bpf/c/sdk/bpf.mk +++ b/programs/bpf/c/sdk/bpf.mk @@ -6,7 +6,7 @@ ifneq ($(V),1) _@ :=@ endif -SYSTEM_INC_DIRS ?= -isystem $(dir $(lastword $(MAKEFILE_LIST)))inc +SYSTEM_INC_DIRS ?= -Isystem -I$(dir $(lastword $(MAKEFILE_LIST)))inc INC_DIRS ?= SRC_DIR ?= ./src OUT_DIR ?= ./out @@ -50,11 +50,13 @@ help: @echo ' - Output files will be placed in the directory: $(OUT_DIR)' @echo '' @echo 'User settings' - @echo ' - The following setting are overridable on the command line, default values shown' + @echo ' - The following setting are overridable on the command line, default values shown:' @echo ' - Show commands:' @echo ' V=1' @echo ' - List of include dirs:' @echo ' INC_DIRS=$(INC_DIRS)' + @echo ' - List of systme include dirs:' + @echo ' INC_DIRS=$(SYSTEM_INC_DIRS)' @echo ' - Location of source files:' @echo ' SRC_DIR=$(SRC_DIR)' @echo ' - Location to place output files:' @@ -88,7 +90,7 @@ $(OUT_DIR)/%.o: $(OUT_DIR)/%.bc @echo "[llc] $@ ($<)" $(_@)$(LLC) $(LLC_FLAGS) -o $@ $< --include $(wildcard $(OUT_DIR)/*.d) +-include $(wildcard $(OUT_DIR)/%.d) PROGRAM_NAMES := $(notdir $(basename $(wildcard src/*.c))) diff --git a/programs/bpf/c/sdk/inc/sol_bpf.h b/programs/bpf/c/sdk/inc/sol_bpf.h index 2c16c7bb99..8b174df90c 100644 --- a/programs/bpf/c/sdk/inc/sol_bpf.h +++ b/programs/bpf/c/sdk/inc/sol_bpf.h @@ -99,8 +99,8 @@ typedef struct { SolPubkey *key; /** Public Key of the account owner */ int64_t *tokens; /** Numer of tokens owned by this account */ uint64_t userdata_len; /** Length of userdata in bytes */ - uint8_t *userdata; /** On-chain data owned by this account */ - SolPubkey *program_id; /** Program that owns this account */ + const uint8_t *userdata; /** On-chain data owned by this account */ + const SolPubkey *program_id; /** Program that owns this account */ } SolKeyedAccounts; /** @@ -154,7 +154,7 @@ SOL_FN_PREFIX bool sol_deserialize( const uint8_t *input, uint64_t num_ka, SolKeyedAccounts *ka, - uint8_t **data, + const uint8_t **data, uint64_t *data_len ) { if (num_ka != *(uint64_t *)input) { diff --git a/programs/bpf/c/src/move_funds.c b/programs/bpf/c/src/move_funds.c index 7105916815..7555203fa6 100644 --- a/programs/bpf/c/src/move_funds.c +++ b/programs/bpf/c/src/move_funds.c @@ -13,7 +13,7 @@ extern bool entrypoint(const uint8_t *input) { SolKeyedAccounts ka[NUM_KA]; - uint8_t *data; + const uint8_t *data; uint64_t data_len; if (!sol_deserialize(input, NUM_KA, ka, &data, &data_len)) { diff --git a/programs/bpf/c/src/noop.c b/programs/bpf/c/src/noop.c index d78b32454a..e7db08d1cb 100644 --- a/programs/bpf/c/src/noop.c +++ b/programs/bpf/c/src/noop.c @@ -13,7 +13,7 @@ extern bool entrypoint(const uint8_t *input) { SolKeyedAccounts ka[NUM_KA]; - uint8_t *data; + const uint8_t *data; uint64_t data_len; if (!sol_deserialize(input, NUM_KA, ka, &data, &data_len)) {