diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-07 17:24:18 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-07 17:24:36 -0600 |
commit | 62e8081e0ac4a4c170bc536303f7a9bd3e91fd7b (patch) | |
tree | 2c40e8297ff0d423bf5e811fa7212345af6141de /lib9p/internal.h | |
parent | b1b07aea8841d78e935e7de13d693a267709e711 (diff) |
tidy config
Diffstat (limited to 'lib9p/internal.h')
-rw-r--r-- | lib9p/internal.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/lib9p/internal.h b/lib9p/internal.h index 36a2647..2b5f8f3 100644 --- a/lib9p/internal.h +++ b/lib9p/internal.h @@ -12,13 +12,29 @@ #include <lib9p/9p.h> -#define USE_CONFIG_9P -#define USE_CONFIG_COROUTINE +/* configuration **************************************************************/ + #include "config.h" + +#ifndef CONFIG_9P_MAX_MSG_SIZE +# error config.h must define CONFIG_9P_MAX_MSG_SIZE +#endif +#ifndef CONFIG_9P_MAX_HOSTMSG_SIZE +# error config.h must define CONFIG_9P_MAX_HOSTMSG_SIZE +#endif +#ifndef CONFIG_9P_MAX_FIDS +# error config.h must define CONFIG_9P_MAX_FIDS +#endif +#ifndef CONFIG_9P_MAX_REQS +# error config.h must define CONFIG_9P_MAX_REQS +#endif +#ifndef CONFIG_9P_MAX_ERR_SIZE +# error config.h must define CONFIG_9P_MAX_ERR_SIZE +#endif + static_assert(CONFIG_9P_MAX_ERR_SIZE <= UINT16_MAX); static_assert(CONFIG_9P_MAX_MSG_SIZE <= CONFIG_9P_MAX_HOSTMSG_SIZE); static_assert(CONFIG_9P_MAX_HOSTMSG_SIZE <= SSIZE_MAX); -static_assert(CONFIG_9P_MAX_ERR_SIZE + CONFIG_9P_MAX_MSG_SIZE + 2*CONFIG_9P_MAX_HOSTMSG_SIZE < CONFIG_COROUTINE_DEFAULT_STACK_SIZE); /* C language *****************************************************************/ |