anchor.diff:      | None -> failwithf "%A not supported." typ.FullName
       | Some x -> x
   
  +and makeCDeclStructField typ name = CField (typ, name)
  +
  +and makeCDeclStructFields env (typ: Type) =
  +    properties typ
  +    |> List.fold (fun (env, fields) x -> 
  +        match tryLookupCType env x.PropertyType with
  +        | None -> 
  +            let env = makeCDeclStruct env x.PropertyType
  +            env, makeCDeclStructField (lookupCType env x.PropertyType) x.Name :: fields
  +        | Some ctype -> env, makeCDeclStructField ctype x.Name :: fields) (env, [])
  +
  +and makeCDeclStruct env (typ: Type) =
  +    let name = typ.Name
  +    let env', fields = makeCDeclStructFields env typ
  +
  +    { env' with Structs = CStruct (name, fields) :: env'.Structs }
  +
  +and makeCField typ name = CField (typ, name)
  +
  +and makeCFields env (typ: Type) =
  +    properties typ
  +    |> List.map (fun x ->
  +        let ctype = lookupCType env x.PropertyType
  +        makeCField ctype x.Name)
  +
   and makeCStruct env (typ: Type) =
       let name = typ.Name
  -    let env, fields =
  -        properties typ
  -        |> List.fold (fun (env, fields) x -> 
  -            match tryLookupCType env x.PropertyType with
  -            | Some ctype ->
  -                env, CField (ctype, x.Name) :: fields
  -            | None ->
  -                let env = makeCStruct env x.PropertyType
  -                env,CField (lookupCType env x.PropertyType, x.Name) :: fields) (env, [])
  +    let fields = makeCFields env typ
   
  -    { env with Structs = CStruct (name, List.rev fields) :: env.Structs }
  +    CStruct (name, fields)
   
   let makeReturnType env = function
       | x when x = typeof<Void> -> None
  
positive.code:     |> Seq.distinct
      |> List.ofSeq
      |> List.filter (fun x -> not x.IsPrimitive && isTypeUnmanaged x)
      |> List.fold (fun env x -> makeCStruct env x) env
  
  let makeCDecls env modul =
      { env with Decls = modul.Functions |> List.map (makeCDecl env) }
  
  let makeCEnv modul =
      let env = makeEmptyEnv modul.Name
      let env' = makeCStructs env modul
      makeCDecls env' modul
  
negative.code: 
  let makeCDecl env func = makeCFunction env func
  
  let makeCDeclStructs env modul =
      modul.Functions
      |> List.map (fun x -> x.GetParameters () |> List.ofArray)
      |> List.reduce (fun x y -> x @ y)
  