ref: ccfe3cf4a72bf7373f50e7265d5f66abe199b712
parent: 0c86b06047b17ec68d8ce525138d5bcd085993d3
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu May 4 00:04:38 EDT 2023
9front supports #pragma once now
--- a/make-plan9.rc
+++ b/make-plan9.rc
@@ -1,19 +1,6 @@
#!/bin/rc
rfork ne
-fn pragma_once {
- h=_^`"{echo $1 | sed 's,.*/,,g;s/\..*//g' | tr -d '
-'}^_h_
- sed 's/#pragma once/#ifndef '^$h^'\n#define '^$h^'/g' $1 && echo && echo '#endif'
-}
-
-for(f in src/*.h src/*/*.h){
- grep -s '^#pragma[ ]+once' $f && {
- pragma_once $f >$f.p
- mv $f.p $f
- }
-}
-
fn pragma_pack {
sed 's/#pragma[ ]+pack[ (]*(push|1)[ )]*/#pragma pack on/g
s/#pragma[ ]+pack[ (]*(pop|0)[ )]*/#pragma pack off/g