# $Header$
+NOFL =
+
all: testC testI
testI:
-# int t1.p; em
- int t2.p; em
- int t3.p; em e.out f1 f2 f3 f4 f5 f6
- int t4.p; em
- int t5.p; em
- int tstenc.p; em
- int tstgto.p; em
- int -.p callc.p cmod.c ; em
+# int $(NOFL) t1.p; em
+ int $(NOFL) t2.p; em
+ int $(NOFL) t3.p; em e.out f1 f2 f3 f4 f5 f6
+ int $(NOFL) t4.p; em
+ int $(NOFL) t5.p; em
+ int $(NOFL) tstenc.p; em
+ int $(NOFL) tstgto.p; em
+ int $(NOFL) -.p callc.p cmod.c ; em
rm -f e.out f? *.k
testC:
- apc t1.p; a.out
- apc t2.p; a.out
- apc t3.p; a.out f1 f2 f3 f4 f5 f6
- apc t4.p; a.out
- apc t5.p; a.out
- apc tstenc.p; a.out
- apc tstgto.p; a.out
- apc -.p callc.p cmod.c ; a.out
+ apc $(NOFL) t1.p; a.out
+ apc $(NOFL) t2.p; a.out
+ apc $(NOFL) t3.p; a.out f1 f2 f3 f4 f5 f6
+ apc $(NOFL) t4.p; a.out
+ apc $(NOFL) t5.p; a.out
+ apc $(NOFL) tstenc.p; a.out
+ apc $(NOFL) tstgto.p; a.out
+ apc $(NOFL) -.p callc.p cmod.c ; a.out
rm -f a.out f? *.[os]
install cmp:
clean:
- -rm -f [ea].out f?
+ -rm -f [ea].out f? *.o
opr:
make pr | opr
+#
program callc(input,output) ;
var success: integer ;
procedure rcsid ; begin writeln('$Header$') end ;
procedure cmain ; extern ;
procedure incs ; begin success:=success+1 end ;
procedure pptr( function ptwice(val:integer):integer ) ; extern ;
+#ifndef NOFLOAT
function ceval( function pinside(val:integer):real ): boolean ; extern ;
function outside(val:integer):real ;
begin
if ceval(outside) then success:=success+1
else writeln('Calling outside through C doesn''t work')
end;
+#endif
procedure cptr( function pkwad(val:integer):integer ) ;
begin
if ( pkwad(-2)<>4 ) and (pkwad(-8)<>64) then
success:=success+1 ;
cmain;
pptr(twice) ;
+#ifndef NOFLOAT
envellop ;
- if success <>7 then writeln('Only ',success,' tests passed')
+#endif
+ if success <>
+#ifdef NOFLOAT
+ 4
+#else
+ 7
+#endif
+ then writeln('Only ',success,' tests passed')
else writeln('All tests passed')
end.
char *p_slink ;
} p_fiptr ;
+#ifndef NOFLOAT
typedef struct {
double (*p_func)() ;
char *p_slink ;
} p_ffptr ;
+#endif
int kwad(val) int val ; { return val*val ; }
cmain() {
else incs() ;
}
+#ifndef NOFLOAT
double callpas(pasfunc,par) p_ffptr pasfunc ; int par ; {
/* Call a Pascal function, both inner block and outer block */
/* Function must return a double, (In pascal terms: real) */
resval= callpas(p_inside,2) ;
return resval>1.41 && resval<1.42 ;
}
+#endif