Browse Source

implement sincosf in cpp

Kajetan Johannes Hammerle 2 years ago
parent
commit
c6f738f3ad
3 changed files with 10 additions and 4 deletions
  1. 8 0
      math/Math.cpp
  2. 1 4
      math/Math.h
  3. 1 0
      meson.build

+ 8 - 0
math/Math.cpp

@@ -0,0 +1,8 @@
+#include "math/Math.h"
+
+#ifndef _GNU_SOURCE
+void sincosf(float a, float* s, float* c) {
+    *s = sinf(a);
+    *c = cosf(a);
+}
+#endif

+ 1 - 4
math/Math.h

@@ -8,10 +8,7 @@
 #endif
 
 #ifndef _GNU_SOURCE
-void sincosf(float a, float* s, float* c) {
-    *s = sinf(a);
-    *c = cosf(a);
-}
+void sincosf(float a, float* s, float* c);
 #endif
 
 #endif

+ 1 - 0
meson.build

@@ -2,6 +2,7 @@ project('gamingcore', 'cpp', default_options : ['default_library=static'])
 
 src = [
     'io/ImageReader.cpp',
+    'math/Math.cpp',
     'math/Frustum.cpp',
     'math/Matrix.cpp',
     'math/Plane.cpp',