# HG changeset patch
# User koda
# Date 1461210577 14400
# Node ID e15eb10f170391591a822a71dac3e3f90f4146ab
# Parent  870f22de388b8a59be3a8f19e23b7c7cf44069ab
Work around emscripten not finding math.h

diff -r 870f22de388b -r e15eb10f1703 project_files/hwc/rtl/pmath.h
--- a/project_files/hwc/rtl/pmath.h	Wed Apr 20 14:46:04 2016 -0400
+++ b/project_files/hwc/rtl/pmath.h	Wed Apr 20 23:49:37 2016 -0400
@@ -21,4 +21,17 @@
 int         __attribute__((overloadable))   fpcrtl_abs(int x);
 int64_t     __attribute__((overloadable))   fpcrtl_abs(int64_t x);
 
+/* emscripten cannot find math.h through our cmake */
+#ifdef EMSCRIPTEN
+double      exp(double);
+double      log(double);
+double      sin(double);
+double      cos(double);
+double      fabs(double);
+double      ceil(double);
+double      sqrt(double);
+double      atan(double);
+double      atan2(double, double);
+#endif
+
 #endif /* PMATH_H_ */
diff -r 870f22de388b -r e15eb10f1703 project_files/hwc/rtl/system.c
--- a/project_files/hwc/rtl/system.c	Wed Apr 20 14:46:04 2016 -0400
+++ b/project_files/hwc/rtl/system.c	Wed Apr 20 23:49:37 2016 -0400
@@ -3,6 +3,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <wchar.h>
+#include "pmath.h"
 
 #ifndef M_PI
 // some math.h do not have M_PI macros