fix: change vec3.data 3 -> 4

fix cmake for microsoft
This commit is contained in:
2025-06-21 13:56:51 +02:00
parent bb62a219cb
commit d6f82cfd46
3 changed files with 9 additions and 4 deletions

View File

@@ -2,7 +2,13 @@ cmake_minimum_required(VERSION 3.10)
project(t3dsr C) project(t3dsr C)
set(CMAKE_C_STANDARD 17) 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 SOURCES CONFIGURE_DEPENDS src/*.c)
file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS src/*.h) file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS src/*.h)

View File

@@ -6,6 +6,7 @@
// //
#include "vec3.h" #include "vec3.h"
#include "common_math.h"
#define VEC_SIZE 3 #define VEC_SIZE 3

View File

@@ -8,12 +8,10 @@
#ifndef vec3_h #ifndef vec3_h
#define vec3_h #define vec3_h
#include "common_math.h"
typedef union typedef union
{ {
struct {float x, y, z; }; struct {float x, y, z; };
float data[3]; float data[4];
} __attribute__((aligned(16))) Vec3f_t; } __attribute__((aligned(16))) Vec3f_t;
Vec3f_t vec3f_from_array(const float *__restrict val); Vec3f_t vec3f_from_array(const float *__restrict val);