summaryrefslogtreecommitdiff
path: root/lib9p/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/internal.h')
-rw-r--r--lib9p/internal.h22
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 *****************************************************************/