aboutsummaryrefslogtreecommitdiff
path: root/CleanC.icl
diff options
context:
space:
mode:
Diffstat (limited to 'CleanC.icl')
-rw-r--r--CleanC.icl7
1 files changed, 6 insertions, 1 deletions
diff --git a/CleanC.icl b/CleanC.icl
index ed1f6b1..1e1e8ce 100644
--- a/CleanC.icl
+++ b/CleanC.icl
@@ -28,6 +28,9 @@ from GenEq import generic gEq
:: State :== Int
derive gEq CType
+derive gEq CParam
+instance == CType where (==) x y = gEq{|*|} x y
+instance == CParam where (==) x y = gEq{|*|} x y
cNewState :: *State
cNewState = 42
@@ -99,6 +102,7 @@ cSetReturnType :: !CType -> *State -> *State
cSetReturnType Int = cSetReturnType_ 0
cSetReturnType String = cSetReturnType_ 1
cSetReturnType Real = cSetReturnType_ 2
+cSetReturnType Void = cSetReturnType_ 3
cCall_ :: !String !*State -> *State
cCall_ f s = code inline {
@@ -138,7 +142,8 @@ where
cCall` t f [] s
# s = cSetReturnType t s
# s = cCall_ f s
- = cGetParam t s
+ | t == Void = (CV, s)
+ | otherwise = cGetParam t s
cCall` t f [p:ps] s
# s = cPutParam p s
= cCall` t f ps s