Changeset 536ab4f in mainline
- Timestamp:
- 2019-06-25T14:10:35Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c486f83
- Parents:
- 093e956
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-06-25 12:47:52)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2019-06-25 14:10:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/autocheck.awk
r093e956 r536ab4f 33 33 BEGIN { 34 34 filename = ARGV[1] 35 output_lines = 0 35 36 print "// Generated file. Fix the included header if static assert fails." 36 print "#include \"" filename "\"" 37 print "// Inlined \"" filename "\"" 38 } 39 40 { 41 print $0 37 42 } 38 43 … … 44 49 } 45 50 macro_name = toupper(struct_name) "_SIZE" 46 print"_Static_assert(" macro_name " == sizeof(struct " struct_name "), \"\");"51 output[output_lines++] = "_Static_assert(" macro_name " == sizeof(struct " struct_name "), \"\");" 47 52 struct_name = "" 48 53 } … … 55 60 56 61 macro_name = toupper(struct_name) "_OFFSET_" toupper(member) 57 print"_Static_assert(" macro_name " == __builtin_offsetof(struct " struct_name ", " member "), \"\");"62 output[output_lines++] = "_Static_assert(" macro_name " == __builtin_offsetof(struct " struct_name ", " member "), \"\");" 58 63 59 64 macro_name = toupper(struct_name) "_SIZE_" toupper(member) 60 print"#ifdef " macro_name61 print"_Static_assert(" macro_name " == sizeof(((struct " struct_name "){ })." member "), \"\");"62 print"#endif"65 output[output_lines++] = "#ifdef " macro_name 66 output[output_lines++] = "_Static_assert(" macro_name " == sizeof(((struct " struct_name "){ })." member "), \"\");" 67 output[output_lines++] = "#endif" 63 68 } 64 69 } … … 67 72 struct_name = $3 68 73 } 74 75 END { 76 for ( i = 0; i < output_lines; i++ ) { 77 print output[i] 78 } 79 }
Note:
See TracChangeset
for help on using the changeset viewer.