Changes in tools/autocheck.awk [536ab4f:8be3230] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/autocheck.awk

    r536ab4f r8be3230  
    3333BEGIN {
    3434        filename = ARGV[1]
    35         output_lines = 0
    3635        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 "\""
    4237}
    4338
     
    4944        }
    5045        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 "), \"\");"
    5247        struct_name = ""
    5348}
     
    6055
    6156                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 "), \"\");"
    6358
    6459                macro_name = toupper(struct_name) "_SIZE_" toupper(member)
    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"
     60                print "#ifdef " macro_name
     61                print "_Static_assert(" macro_name " == sizeof(((struct " struct_name "){ })." member "), \"\");"
     62                print "#endif"
    6863        }
    6964}
     
    7267        struct_name = $3
    7368}
    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.