view ifndef_wrapper.sh @ 1883:f54451afc046

use buf_getptr and m_free on every iteration before m_malloc to insure no memory leaks are happening
author HansH111 <hans@atbas.org>
date Tue, 15 Mar 2022 18:57:21 +0000
parents 0196f4f83fee
children
line wrap: on
line source

#!/bin/sh

# Wrap all "#define X Y" with a #ifndef X...#endif"

sed 's/^\( *#define \([^ ][^ ]*\) .*\)/#ifndef \2\
\1\
#endif/'