From e20c0c6b5d48dc2a77ec5cca495437a6d6bb012a Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Tue, 19 Jan 2021 22:19:54 +0000 Subject: [PATCH] dll feature test: output #error directive on failure A common cause of build failures on some systems is that the output block in the dll feature test silently fails to compile. This leads to very-hard-to-trace compiler errors about missing identifiers later on. iffe syntax does not allow aborting compilation if a block does not compile, however, it does let us produce alternative output from a shell script if compilation fails. This can be used to generate an informative #error directive that is inserted in place of the missing identifiers. src/lib/libdll/features/dll: - Add fail block to output block that produces an #error directive. --- src/lib/libdll/features/dll | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/libdll/features/dll b/src/lib/libdll/features/dll index 93b53c243..f530a3b87 100644 --- a/src/lib/libdll/features/dll +++ b/src/lib/libdll/features/dll @@ -261,4 +261,6 @@ tst - output{ printf("\n"); return 0; } +}end fail{ + echo '#error The output block in src/lib/libdll/features/dll failed to compile' }end