summaryrefslogtreecommitdiff
path: root/misc/pascal/insn16/prun/pexec.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-06 20:46:45 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-06 20:46:45 +0000
commit8ec4834055be4c002b810bbbaea773586f3eeeeb (patch)
treeba7521ddf88771a17123b71d0197c66c14ac6e09 /misc/pascal/insn16/prun/pexec.c
parent1b7bc5aeea327d47e6f4403121b243e34674c7c5 (diff)
downloadpx4-nuttx-8ec4834055be4c002b810bbbaea773586f3eeeeb.tar.gz
px4-nuttx-8ec4834055be4c002b810bbbaea773586f3eeeeb.tar.bz2
px4-nuttx-8ec4834055be4c002b810bbbaea773586f3eeeeb.zip
Add configuration for toolchains without libm
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@517 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'misc/pascal/insn16/prun/pexec.c')
-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;