summaryrefslogtreecommitdiff
path: root/misc/pascal/insn16
diff options
context:
space:
mode:
Diffstat (limited to 'misc/pascal/insn16')
-rw-r--r--misc/pascal/insn16/prun/pexec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/misc/pascal/insn16/prun/pexec.c b/misc/pascal/insn16/prun/pexec.c
index 8249d55c6..b9d688e5a 100644
--- a/misc/pascal/insn16/prun/pexec.c
+++ b/misc/pascal/insn16/prun/pexec.c
@@ -41,7 +41,6 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
-#include <math.h>
#include "keywords.h"
#include "pdefs.h"
@@ -53,6 +52,10 @@
#include "paslib.h"
#include "pexec.h"
+#ifdef CONFIG_HAVE_LIBM
+#include <math.h>
+#endif
+
/****************************************************************************
* Definitions
****************************************************************************/
@@ -1037,6 +1040,7 @@ static uint16 pexec_execfp(struct pexec_s *st, ubyte fpop)
PUSH(st, result.hw[2]);
PUSH(st, result.hw[3]);
break;
+#ifdef CONFIG_HAVE_LIBM
case fpABS :
pexec_getfparguments(st, fpop, &arg1, NULL);
result.f = fabs(arg1.f);
@@ -1045,6 +1049,7 @@ static uint16 pexec_execfp(struct pexec_s *st, ubyte fpop)
PUSH(st, result.hw[2]);
PUSH(st, result.hw[3]);
break;
+#endif
case fpSQR :
pexec_getfparguments(st, fpop, &arg1, NULL);
result.f = arg1.f * arg1.f;
@@ -1053,6 +1058,7 @@ static uint16 pexec_execfp(struct pexec_s *st, ubyte fpop)
PUSH(st, result.hw[2]);
PUSH(st, result.hw[3]);
break;
+#ifdef CONFIG_HAVE_LIBM
case fpSQRT :
pexec_getfparguments(st, fpop, &arg1, NULL);
result.f = sqrt(arg1.f);
@@ -1101,6 +1107,7 @@ static uint16 pexec_execfp(struct pexec_s *st, ubyte fpop)
PUSH(st, result.hw[2]);
PUSH(st, result.hw[3]);
break;
+#endif
default :
return eBADFPOPCODE;