Skip to content
  • Joshua Elsasser's avatar
    Teach groveler cstruct :count :auto to work on arrays anywhere in the struct. · 4e207452
    Joshua Elsasser authored and Luís Oliveira's avatar Luís Oliveira committed
    The :count :auto logic assumed the struct member was an array which
    filled the remainder of the struct, and would generate incorrect cffi
    cstruct forms when any other struct members followed one declared
    :count :auto.
    
    The following C struct definition and groveler cstruct form
    demonstrate this:
    
    struct charbuf {
    	char three_chars[3];
    	int clobbered_int
    };
    
    (cstruct charbuf "struct charbuf"
      (three-chars "three_chars" :type :char :count :auto)
      (clobbered-int "clobbered_int" :type :int))
    4e207452