Changes in tools/autocheck.awk [08f1a6d:81c6365] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/autocheck.awk
r08f1a6d r81c6365 38 38 39 39 /}.*;/ { 40 pattern = "}( __attribute__\\(.*\\))? " struct_name "_t;" 41 if ($0 ~ pattern) { 42 macro_name = toupper(struct_name) "_SIZE" 43 print "_Static_assert(" macro_name " == sizeof(struct " struct_name "), \"\");" 44 struct_name = "" 40 pattern = "}( __attribute__\\(.*\\))? (" struct_name "_t)?;" 41 if ($0 !~ pattern) { 42 print("Bad struct ending: " $0) > "/dev/stderr" 43 exit 1 45 44 } 45 macro_name = toupper(struct_name) "_SIZE" 46 print "_Static_assert(" macro_name " == sizeof(struct " struct_name "), \"\");" 47 struct_name = "" 46 48 } 47 49 48 50 /;$/ { 49 if (struct_name != "" && $0 !~ "}") {51 if (struct_name != "") { 50 52 # Remove array subscript, if any. 51 53 sub("(\\[.*\\])?;", "", $0)
Note:
See TracChangeset
for help on using the changeset viewer.