diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-03-22 19:17:02 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-03-22 19:17:02 -0600 |
commit | 185c3329145959433b8b805de5f114b66b8fcaee (patch) | |
tree | 048ec8b781f1d3b45d29a1d862d724908d0d9785 /lib9p/tests/test_compile.c.gen | |
parent | 2774e918b6ced670f80036532052189d568e5c5c (diff) | |
parent | 2300ddae5f98180311419413d98fbc8384470665 (diff) |
Merge branch 'lukeshu/qa'
Diffstat (limited to 'lib9p/tests/test_compile.c.gen')
-rwxr-xr-x | lib9p/tests/test_compile.c.gen | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib9p/tests/test_compile.c.gen b/lib9p/tests/test_compile.c.gen new file mode 100755 index 0000000..47046b3 --- /dev/null +++ b/lib9p/tests/test_compile.c.gen @@ -0,0 +1,19 @@ +#!/bin/sh +# lib9p/tests/test_compile.c.gen - Generate code to make sure all generated macros work +# +# Copyright (C) 2025 Luke T. Shumaker <lukeshu@lukeshu.com> +# SPDX-License-Identifier: AGPL-3.0-or-later + +generated_h=$1 +outfile=$2 + +{ + echo "/* ${outfile} - Generated by $0. DO NOT EDIT! */" + echo + echo "#include <lib9p/9p.h>" + echo 'int main(void) {' + echo ' [[gnu::unused]] uint64_t x;' + sed -nE 's/^\s*#\s*define\s*(\S[^ (]*)\s.*/ x = \1;/p' <"$generated_h" + echo ' return 0;' + echo '}' +} >"$outfile" |