From c43e759cf8432c699aa6d0366a9691c0a4a8167f Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 11 Jun 2023 14:02:44 +0800 Subject: [PATCH] ... --- docs/quick-start/config.md | 11 +++++++++++ src/config.h | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 docs/quick-start/config.md diff --git a/docs/quick-start/config.md b/docs/quick-start/config.md new file mode 100644 index 00000000..f302af4b --- /dev/null +++ b/docs/quick-start/config.md @@ -0,0 +1,11 @@ +--- +icon: dot +label: 'Advanced config' +order: -2 +--- + +You can create a `user_config.h` in the same directory as `pocketpy.h` to override some default settings. + +1. Copy [src/config.h](https://github.com/blueloveTH/pocketpy/blob/main/src/config.h) and rename it to `user_config.h`. +2. Define a macro `PK_USER_CONFIG_H` in `user_config.h`. This invalidates the default `config.h` and enables your `user_config.h`. +3. Edit `user_config.h` to override default settings. \ No newline at end of file diff --git a/src/config.h b/src/config.h index 3e61abfc..29f1ca37 100644 --- a/src/config.h +++ b/src/config.h @@ -1,6 +1,6 @@ #pragma once -#ifdef PK_USER_CONFIG +#ifdef PK_USER_CONFIG_H #include "user_config.h" @@ -25,7 +25,7 @@ // This is the maximum number of arguments in a function declaration // including positional arguments, keyword-only arguments, and varargs -#define PK_MAX_CO_VARNAMES 255 +#define PK_MAX_CO_VARNAMES 255 // Hash table load factor (smaller ones mean less collision but more memory) inline const float kInstAttrLoadFactor = 0.67f;