diff --git a/CMakeLists.txt b/CMakeLists.txt index 38ed24b..4be6a1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,13 @@ cmake_minimum_required(VERSION 3.10) project(t3dsr C) set(CMAKE_C_STANDARD 17) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") + +# if microsoft compilation +if (MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") +else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") +endif() file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS src/*.c) file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS src/*.h) diff --git a/src/math/vec3.c b/src/math/vec3.c index 568bffa..045c30f 100644 --- a/src/math/vec3.c +++ b/src/math/vec3.c @@ -6,6 +6,7 @@ // #include "vec3.h" +#include "common_math.h" #define VEC_SIZE 3 diff --git a/src/math/vec3.h b/src/math/vec3.h index 1733022..41f56e5 100644 --- a/src/math/vec3.h +++ b/src/math/vec3.h @@ -8,12 +8,10 @@ #ifndef vec3_h #define vec3_h -#include "common_math.h" - typedef union { struct {float x, y, z; }; - float data[3]; + float data[4]; } __attribute__((aligned(16))) Vec3f_t; Vec3f_t vec3f_from_array(const float *__restrict val);