Project

General

Profile

Revision 52c5ba00 src/backends/C/c_backend_common.ml

View differences:

src/backends/C/c_backend_common.ml
124 124
  | Types.Tbool | Types.Treal | Types.Tint  -> true
125 125
  | _                                       -> false
126 126

  
127
let pp_basic_c_type fmt t =
128
  match (Types.repr t).Types.tdesc with
129
  | Types.Tbool                    -> fprintf fmt "_Bool"
130
  | Types.Treal when !Options.mpfr -> fprintf fmt "%s" Mpfr.mpfr_t
131
  | Types.Treal                    -> fprintf fmt "double"
132
  | Types.Tint                     -> fprintf fmt "int"
127
let pp_c_basic_type_desc t_dsec =
128
  match (t_dsec) with
129
  | Types.Tbool when !Options.cpp  -> "bool"
130
  | Types.Tbool                    -> "_Bool"
131
  | Types.Tint                     -> !Options.int_type
132
  | Types.Treal when !Options.mpfr -> Mpfr.mpfr_t
133
  | Types.Treal                    -> !Options.real_type
133 134
  | _ -> assert false (* Not a basic C type. Do not handle arrays or pointers *)
134 135

  
136
let pp_basic_c_type fmt t = fprintf fmt "%s" (pp_c_basic_type_desc (Types.repr t).Types.tdesc)
137

  
135 138
let pp_c_type var fmt t =
136 139
  let rec aux t pp_suffix =
137 140
    match (Types.repr t).Types.tdesc with

Also available in: Unified diff