From 311bcfc6b3acdd6fd152798c7f287ddf74fa2a98 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 16 Apr 2024 21:46:48 +0200 Subject: Adding upstream version 15.4. Signed-off-by: Daniel Baumann --- src/tools/pginclude/pgdefine | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 src/tools/pginclude/pgdefine (limited to 'src/tools/pginclude/pgdefine') diff --git a/src/tools/pginclude/pgdefine b/src/tools/pginclude/pgdefine new file mode 100755 index 0000000..242d035 --- /dev/null +++ b/src/tools/pginclude/pgdefine @@ -0,0 +1,25 @@ +: +# create macro calls for all defines in the file + +# src/tools/pginclude/pgdefine + +trap "rm -f /tmp/$$" 0 1 2 3 15 +for FILE +do + cat "$FILE" | grep "^#define" >/tmp/$$ + cat /tmp/$$ | sed -n 's/^#define[ ][ ]*\([a-zA-Z0-9_]*\)[ ][ ]*[^ ].*\\\\$/\1;/p' + cat /tmp/$$ | sed -n 's/^#define[ ][ ]*\([a-zA-Z0-9_]*\)[ ][ ]*[^ ].*[^\\\\]$/(void)\1;/p' + + ( + cat /tmp/$$ | sed -n 's/^#define[ ][ ]*\([a-zA-Z0-9_]*([^)]*)\).*\\\\$/\1;/p' + cat /tmp/$$ | sed -n 's/^#define[ ][ ]*\([a-zA-Z0-9_]*([^)]*)\).*[^\\\\]$/(=void)\1;/p' + ) | + sed 's/([a-zA-Z0-9_ ][a-zA-Z0-9_ ]*)/(0)/g' | + sed 's/([a-zA-Z0-9_ ]*,/(0,/g' | + sed 's/,[a-zA-Z0-9_ ]*,/,0,/g' | + sed 's/,[a-zA-Z0-9_ ]*)/,0)/g' | + # do not cast 'return' macros as (void) + sed 's/(=void)\(.*return\)/\1/g' | + sed 's/(=void)\(.*RETURN\)/\1/g' | + sed 's/(=void)/(void)/g' +done -- cgit v1.2.3