aboutsummaryrefslogtreecommitdiffstats
path: root/cfrontend/C2C.ml
diff options
context:
space:
mode:
Diffstat (limited to 'cfrontend/C2C.ml')
-rw-r--r--cfrontend/C2C.ml9
1 files changed, 8 insertions, 1 deletions
diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml
index bd9b7487..1ab38a2b 100644
--- a/cfrontend/C2C.ml
+++ b/cfrontend/C2C.ml
@@ -154,6 +154,10 @@ let ais_annot_functions =
else
[]
+let builtin_ternary suffix typ =
+ ("__builtin_ternary_" ^ suffix),
+ (typ, [TInt(IInt, []); typ; typ], false);;
+
let builtins_generic = {
Builtins.typedefs = [];
Builtins.functions =
@@ -180,7 +184,10 @@ let builtins_generic = {
TPtr(TVoid [AConst], []);
TInt(IULong, []);
TInt(IULong, [])],
- false);
+ false);
+ (* Ternary operator *)
+ builtin_ternary "uint" (TInt(IUInt, []));
+
(* Annotations *)
"__builtin_annot",
(TVoid [],