File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 67
67
line2 = $0;
68
68
if (skips > 0)
69
69
skips--;
70
- if (line1 ~ "^extern [ ]*\"C\" " &&
71
- line2 ~ "^{ [ ]*$")
70
+ if (line1 ~ "^#ifdef [ ]*__cplusplus " &&
71
+ line2 ~ "^extern[ ]*\"C\" [ ]*$")
72
72
{
73
- # do not print first line
74
- print "/* Open extern \"C\" */";
73
+ print line1;
74
+ print line2;
75
+ if (getline && $0 ~ /^{[ ]*$/)
76
+ print "/* Open extern \"C\" */";
77
+ else print $0;
75
78
line2 = "";
76
79
skips = 2;
77
80
}
1490
1493
# remove tabs and retab with four spaces
1491
1494
detab -t8 -qc |
1492
1495
entab -t4 -qc |
1493
- sed ' s;^/\* Open extern \"C\" \*/$;extern "C"\
1494
- {;' |
1496
+ sed ' s;^/\* Open extern \"C\" \*/$;{;' |
1495
1497
sed ' s;^/\* Close extern \"C\" \*/$;};' |
1496
1498
sed ' s;/\*---X_X;/* ---;g' |
1497
1499
# workaround indent bug
You can’t perform that action at this time.
0 commit comments