summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/natmod/btree/Makefile7
-rw-r--r--examples/natmod/btree/btree_c.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/examples/natmod/btree/Makefile b/examples/natmod/btree/Makefile
index d795102b4..218ec15a2 100644
--- a/examples/natmod/btree/Makefile
+++ b/examples/natmod/btree/Makefile
@@ -11,9 +11,10 @@ SRC = btree_c.c btree_py.py
ARCH = x64
BTREE_DIR = $(MPY_DIR)/lib/berkeley-db-1.xx
-BTREE_DEFS = -D__DBINTERFACE_PRIVATE=1 -Dmpool_error="(void)" -Dabort=abort_ "-Dvirt_fd_t=void*" $(BTREE_DEFS_EXTRA)
-CFLAGS += -I$(BTREE_DIR)/PORT/include
-CFLAGS += -Wno-old-style-definition -Wno-sign-compare -Wno-unused-parameter $(BTREE_DEFS)
+BERKELEY_DB_CONFIG_FILE ?= \"extmod/berkeley-db/berkeley_db_config_port.h\"
+CFLAGS += -I$(BTREE_DIR)/include
+CFLAGS += -DBERKELEY_DB_CONFIG_FILE=$(BERKELEY_DB_CONFIG_FILE)
+CFLAGS += -Wno-old-style-definition -Wno-sign-compare -Wno-unused-parameter
SRC += $(addprefix $(realpath $(BTREE_DIR))/,\
btree/bt_close.c \
diff --git a/examples/natmod/btree/btree_c.c b/examples/natmod/btree/btree_c.c
index 3c60e41b2..bbf51c731 100644
--- a/examples/natmod/btree/btree_c.c
+++ b/examples/natmod/btree/btree_c.c
@@ -39,6 +39,10 @@ void abort_(void) {
nlr_raise(mp_obj_new_exception(mp_load_global(MP_QSTR_RuntimeError)));
}
+int puts(const char *s) {
+ return mp_printf(&mp_plat_print, "%s\n", s);
+}
+
int native_errno;
#if defined(__linux__)
int *__errno_location (void)