From 4050bcb17f91d193ca181a23896e0f179b32b721 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Sun, 21 Dec 2025 11:07:08 +0100 Subject: [PATCH] fix #1 Add optional include to initialize const variables for tests --- src/stubser/stubser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stubser/stubser.c b/src/stubser/stubser.c index 31bb5ec..789fc14 100644 --- a/src/stubser/stubser.c +++ b/src/stubser/stubser.c @@ -999,6 +999,9 @@ STATIC int8_t createStub(char *aOutput, char *aNoSuffix, cfile_t *aCfile) { fprintf(cfile, "#include // stub uses a va_list"NEWLINES); } + fprintf(cfile, "#if __has_include(\"stub_%s_init.h\")"NEWLINES, aNoSuffix); + fprintf(cfile, "#\tinclude \"stub_%s_init.h\""NEWLINES, aNoSuffix); + fprintf(cfile, "#endif"NEWLINES); fprintf(cfile, "#include \"stub_%s_user.h\""NEWLINES, aNoSuffix); fprintf(cfile, "#include \"%s\""NEWLINES NEWLINES, gnu_basename(cHeaderName));