Changes in tools/autocheck.awk [536ab4f:8be3230] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/autocheck.awk
r536ab4f r8be3230 33 33 BEGIN { 34 34 filename = ARGV[1] 35 output_lines = 036 35 print "// Generated file. Fix the included header if static assert fails." 37 print "// Inlined \"" filename "\"" 38 } 39 40 { 41 print $0 36 print "#include \"" filename "\"" 42 37 } 43 38 … … 49 44 } 50 45 macro_name = toupper(struct_name) "_SIZE" 51 output[output_lines++] ="_Static_assert(" macro_name " == sizeof(struct " struct_name "), \"\");"46 print "_Static_assert(" macro_name " == sizeof(struct " struct_name "), \"\");" 52 47 struct_name = "" 53 48 } … … 60 55 61 56 macro_name = toupper(struct_name) "_OFFSET_" toupper(member) 62 output[output_lines++] ="_Static_assert(" macro_name " == __builtin_offsetof(struct " struct_name ", " member "), \"\");"57 print "_Static_assert(" macro_name " == __builtin_offsetof(struct " struct_name ", " member "), \"\");" 63 58 64 59 macro_name = toupper(struct_name) "_SIZE_" toupper(member) 65 output[output_lines++] ="#ifdef " macro_name66 output[output_lines++] ="_Static_assert(" macro_name " == sizeof(((struct " struct_name "){ })." member "), \"\");"67 output[output_lines++] ="#endif"60 print "#ifdef " macro_name 61 print "_Static_assert(" macro_name " == sizeof(((struct " struct_name "){ })." member "), \"\");" 62 print "#endif" 68 63 } 69 64 } … … 72 67 struct_name = $3 73 68 } 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.