From c6d44836fd8ed1442e01825cb0f9f97e7bf11515 Mon Sep 17 00:00:00 2001 From: David Moc Date: Wed, 3 Jun 2026 02:26:11 +0200 Subject: Harden editor logging and packaging --- src/config.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index 9c885ff..6e4b84f 100644 --- a/src/config.c +++ b/src/config.c @@ -339,9 +339,18 @@ static int add_include_path(ccdjit_context *ctx, const char *path) { return ECEX_ERR; } +static int add_existing_include_path(ccdjit_context *ctx, const char *path) { + if (!path || !path[0] || !ecex_path_is_dir(path)) return ECEX_OK; + return add_include_path(ctx, path); +} + int ecex_add_ccdjit_include_paths(ccdjit_context *ctx) { - if (add_include_path(ctx, "include") != ECEX_OK) return ECEX_ERR; - if (add_include_path(ctx, "../include") != ECEX_OK) return ECEX_ERR; + if (add_existing_include_path(ctx, "include") != ECEX_OK) return ECEX_ERR; + if (add_existing_include_path(ctx, "../include") != ECEX_OK) return ECEX_ERR; + +#ifdef ECEX_SYSTEM_INCLUDE_DIR + if (add_existing_include_path(ctx, ECEX_SYSTEM_INCLUDE_DIR) != ECEX_OK) return ECEX_ERR; +#endif const char *env_include = getenv("ECEX_INCLUDE"); if (env_include && env_include[0]) { -- cgit v1.2.3