13
0
livetrax/tools/once
Paul Davis 8fbec13e9c script for once-ification
This still tends to require by-hand cleanups of bare #endif lines
2024-10-17 07:44:31 -06:00

8 lines
240 B
Bash
Executable File

#!/bin/sh
for x in *.h ; do
sed -i -e 's/^#ifndef *__[a-z_][a-z_]*_h__/#pragma once/' -e '/^#define *__[a-z_][a-z_]*_h__/d' -e '/^#endif *\/\* __[a-z_][a-z_]*_h__.*$/d' -e '/^#endif *\/\/ *__[a-z_][a-z_]*_h__.*$/d' $x
done
exit 0