From 8fbec13e9c46063783f6eac1e5884782a4843b03 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 22 Sep 2024 12:52:10 -0600 Subject: [PATCH] script for once-ification This still tends to require by-hand cleanups of bare #endif lines --- tools/once | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 tools/once diff --git a/tools/once b/tools/once new file mode 100755 index 0000000000..03c0d467aa --- /dev/null +++ b/tools/once @@ -0,0 +1,7 @@ +#!/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