Repository: HandmadeMath/HandmadeMath (c)

Issue:
HMM_Div C11 Generic Macro Contains HMM_DivM2, HMM_DivM3, HMM_DivM4, and HMM_DivQ Which Don't Exist
The `HMM_Div` macro contains some function names that don't exist when compiling in C mode using C11 _Generics:
```c
#define HMM_Div(A, B) _Generic((B), \
     float: _Generic((A), \
        HMM_Mat2: HMM_DivM2F, \
        HMM_Mat3: HMM_DivM3F, \
        HMM_Mat4: HMM_DivM4F, \
        HMM_Vec2: HMM_DivV2F, \
        HMM_Vec3: HMM_DivV3F, \
        HMM_Vec4: HMM_DivV4F, \
        HMM_Quat: HMM_DivQF  \
     ), \
     HMM_Mat2: HMM_DivM2, /* Doesn't exist! */ \
     HMM_Mat3: HMM_DivM3, /* Doesn't exist! */ \
     HMM_Mat4: HMM_DivM4, /* Doesn't exist! */ \
     HMM_Quat: HMM_DivQ, /* Doesn't exist! */ \
     default: _Generic((A), \
        HMM_Vec2: HMM_DivV2, \
        HMM_Vec3: HMM_DivV3, \
        HMM_Vec4: HMM_DivV4  \
    ) \
)(A, B)
```


Discussion:
This might be related or the cause, but the `COVERAGE` and `ASSERT_COVERED` macros also have the wrong names. For example:
```c
COVERAGE(HMM_DivM3, 1) //Missing F suffix!
static inline HMM_Mat3 HMM_DivM3F(HMM_Mat3 Matrix, float Scalar)
{
    ASSERT_COVERED(HMM_DivM3); //Missing F suffix!
    ...
}
```

EDIT: This might be the only instance of it being incorrect outside the `_Generic`. Seems `HMM_DivM2F` and `HMM_DivM4F` have their correct `COVERAGE` macro names.

Patch:
diff --git a/HandmadeMath.h b/HandmadeMath.h
--- a/HandmadeMath.h
+++ b/HandmadeMath.h
@@ -1431,10 +1431,10 @@ static inline HMM_Mat3 HMM_MulM3F(HMM_Mat3 Matrix, float Scalar)
     return Result;
 }
 
-COVERAGE(HMM_DivM3, 1)
+COVERAGE(HMM_DivM3F, 1)
 static inline HMM_Mat3 HMM_DivM3F(HMM_Mat3 Matrix, float Scalar)
 {
-    ASSERT_COVERED(HMM_DivM3);
+    ASSERT_COVERED(HMM_DivM3F);
 
     HMM_Mat3 Result;
 
@@ -3803,124 +3803,131 @@ static inline HMM_Vec4 operator-(HMM_Vec4 In)
 #endif /* __cplusplus*/
 
 #ifdef HANDMADE_MATH__USE_C11_GENERICS
+
+void __hmm_invalid_generic();
+
 #define HMM_Add(A, B) _Generic((A), \
-        HMM_Vec2: HMM_AddV2, \
-        HMM_Vec3: HMM_AddV3, \
-        HMM_Vec4: HMM_AddV4, \
-        HMM_Mat2: HMM_AddM2, \
-        HMM_Mat3: HMM_AddM3, \
-        HMM_Mat4: HMM_AddM4, \
-        HMM_Quat: HMM_AddQ \
+    HMM_Vec2: HMM_AddV2, \
+    HMM_Vec3: HMM_AddV3, \
+    HMM_Vec4: HMM_AddV4, \
+    HMM_Mat2: HMM_AddM2, \
+    HMM_Mat3: HMM_AddM3, \
+    HMM_Mat4: HMM_AddM4, \
+    HMM_Quat: HMM_AddQ   \
 )(A, B)
 
 #define HMM_Sub(A, B) _Generic((A), \
-        HMM_Vec2: HMM_SubV2, \
-        HMM_Vec3: HMM_SubV3, \
-        HMM_Vec4: HMM_SubV4, \
-        HMM_Mat2: HMM_SubM2, \
-        HMM_Mat3: HMM_SubM3, \
-        HMM_Mat4: HMM_SubM4, \
-        HMM_Quat: HMM_SubQ \
+    HMM_Vec2: HMM_SubV2, \
+    HMM_Vec3: HMM_SubV3, \
+    HMM_Vec4: HMM_SubV4, \
+    HMM_Mat2: HMM_SubM2, \
+    HMM_Mat3: HMM_SubM3, \
+    HMM_Mat4: HMM_SubM4, \
+    HMM_Quat: HMM_SubQ   \
 )(A, B)
 
 #define HMM_Mul(A, B) _Generic((B), \
-     float: _Generic((A), \
+    float: _Generic((A), \
         HMM_Vec2: HMM_MulV2F, \
         HMM_Vec3: HMM_MulV3F, \
         HMM_Vec4: HMM_MulV4F, \
         HMM_Mat2: HMM_MulM2F, \
         HMM_Mat3: HMM_MulM3F, \
         HMM_Mat4: HMM_MulM4F, \
-        HMM_Quat: HMM_MulQF \
-     ), \
-     HMM_Mat2: HMM_MulM2, \
-     HMM_Mat3: HMM_MulM3, \
-     HMM_Mat4: HMM_MulM4, \
-     HMM_Quat: HMM_MulQ, \
-     default: _Generic((A), \
+        HMM_Quat: HMM_MulQF,  \
+        default: __hmm_invalid_generic \
+    ), \
+    HMM_Vec2: _Generic((A), \
         HMM_Vec2: HMM_MulV2, \
-        HMM_Vec3: HMM_MulV3, \
-        HMM_Vec4: HMM_MulV4, \
         HMM_Mat2: HMM_MulM2V2, \
+        default: __hmm_invalid_generic \
+    ), \
+    HMM_Vec3: _Generic((A), \
+        HMM_Vec3: HMM_MulV3, \
         HMM_Mat3: HMM_MulM3V3, \
-        HMM_Mat4: HMM_MulM4V4 \
-    ) \
+        default: __hmm_invalid_generic \
+    ), \
+    HMM_Vec4: _Generic((A), \
+        HMM_Vec4: HMM_MulV4, \
+        HMM_Mat4: HMM_MulM4V4, \
+        default: __hmm_invalid_generic \
+    ), \
+    HMM_Mat2: HMM_MulM2, \
+    HMM_Mat3: HMM_MulM3, \
+    HMM_Mat4: HMM_MulM4, \
+    HMM_Quat: HMM_MulQ \
 )(A, B)
 
 #define HMM_Div(A, B) _Generic((B), \
-     float: _Generic((A), \
-        HMM_Mat2: HMM_DivM2F, \
-        HMM_Mat3: HMM_DivM3F, \
-        HMM_Mat4: HMM_DivM4F, \
+    float: _Generic((A), \
         HMM_Vec2: HMM_DivV2F, \
         HMM_Vec3: HMM_DivV3F, \
         HMM_Vec4: HMM_DivV4F, \
-        HMM_Quat: HMM_DivQF  \
-     ), \
-     HMM_Mat2: HMM_DivM2, \
-     HMM_Mat3: HMM_DivM3, \
-     HMM_Mat4: HMM_DivM4, \
-     HMM_Quat: HMM_DivQ, \
-     default: _Generic((A), \
-        HMM_Vec2: HMM_DivV2, \
-        HMM_Vec3: HMM_DivV3, \
-        HMM_Vec4: HMM_DivV4  \
-    ) \
+        HMM_Mat2: HMM_DivM2F, \
+        HMM_Mat3: HMM_DivM3F, \
+        HMM_Mat4: HMM_DivM4F, \
+        HMM_Quat: HMM_DivQF   \
+    ), \
+    HMM_Vec2: HMM_DivV2, \
+    HMM_Vec3: HMM_DivV3, \
+    HMM_Vec4: HMM_DivV4 \
 )(A, B)
 
 #define HMM_Len(A) _Generic((A), \
-        HMM_Vec2: HMM_LenV2, \
-        HMM_Vec3: HMM_LenV3, \
-        HMM_Vec4: HMM_LenV4  \
+    HMM_Vec2: HMM_LenV2, \
+    HMM_Vec3: HMM_LenV3, \
+    HMM_Vec4: HMM_LenV4  \
 )(A)
 
 #define HMM_LenSqr(A) _Generic((A), \
-        HMM_Vec2: HMM_LenSqrV2, \
-        HMM_Vec3: HMM_LenSqrV3, \
-        HMM_Vec4: HMM_LenSqrV4  \
+    HMM_Vec2: HMM_LenSqrV2, \
+    HMM_Vec3: HMM_LenSqrV3, \
+    HMM_Vec4: HMM_LenSqrV4  \
 )(A)
 
 #define HMM_Norm(A) _Generic((A), \
-        HMM_Vec2: HMM_NormV2, \
-        HMM_Vec3: HMM_NormV3, \
-        HMM_Vec4: HMM_NormV4  \
+    HMM_Vec2: HMM_NormV2, \
+    HMM_Vec3: HMM_NormV3, \
+    HMM_Vec4: HMM_NormV4, \
+    HMM_Quat: HMM_NormQ   \
 )(A)
 
 #define HMM_Dot(A, B) _Generic((A), \
-        HMM_Vec2: HMM_DotV2, \
-        HMM_Vec3: HMM_DotV3, \
-        HMM_Vec4: HMM_DotV4  \
+    HMM_Vec2: HMM_DotV2, \
+    HMM_Vec3: HMM_DotV3, \
+    HMM_Vec4: HMM_DotV4, \
+    HMM_Quat: HMM_DotQ   \
 )(A, B)
 
 #define HMM_Lerp(A, T, B) _Generic((A), \
-        float: HMM_Lerp, \
-        HMM_Vec2: HMM_LerpV2, \
-        HMM_Vec3: HMM_LerpV3, \
-        HMM_Vec4: HMM_LerpV4 \
+    float: HMM_Lerp, \
+    HMM_Vec2: HMM_LerpV2, \
+    HMM_Vec3: HMM_LerpV3, \
+    HMM_Vec4: HMM_LerpV4  \
 )(A, T, B)
 
 #define HMM_Eq(A, B) _Generic((A), \
-        HMM_Vec2: HMM_EqV2, \
-        HMM_Vec3: HMM_EqV3, \
-        HMM_Vec4: HMM_EqV4  \
+    HMM_Vec2: HMM_EqV2, \
+    HMM_Vec3: HMM_EqV3, \
+    HMM_Vec4: HMM_EqV4  \
 )(A, B)
 
 #define HMM_Transpose(M) _Generic((M), \
-        HMM_Mat2: HMM_TransposeM2, \
-        HMM_Mat3: HMM_TransposeM3, \
-        HMM_Mat4: HMM_TransposeM4  \
+    HMM_Mat2: HMM_TransposeM2, \
+    HMM_Mat3: HMM_TransposeM3, \
+    HMM_Mat4: HMM_TransposeM4  \
 )(M)
 
 #define HMM_Determinant(M) _Generic((M), \
-        HMM_Mat2: HMM_DeterminantM2, \
-        HMM_Mat3: HMM_DeterminantM3, \
-        HMM_Mat4: HMM_DeterminantM4  \
+    HMM_Mat2: HMM_DeterminantM2, \
+    HMM_Mat3: HMM_DeterminantM3, \
+    HMM_Mat4: HMM_DeterminantM4  \
 )(M)
 
 #define HMM_InvGeneral(M) _Generic((M), \
-        HMM_Mat2: HMM_InvGeneralM2, \
-        HMM_Mat3: HMM_InvGeneralM3, \
-        HMM_Mat4: HMM_InvGeneralM4  \
+    HMM_Mat2: HMM_InvGeneralM2, \
+    HMM_Mat3: HMM_InvGeneralM3, \
+    HMM_Mat4: HMM_InvGeneralM4  \
 )(M)
 
 #endif


Test patch:
diff --git a/test/Makefile b/test/Makefile
--- a/test/Makefile
+++ b/test/Makefile
@@ -2,77 +2,123 @@ BUILD_DIR=./build
 
 CXXFLAGS+=-g -Wall -Wextra -pthread -Wno-missing-braces -Wno-missing-field-initializers -Wfloat-equal
 
-all: c c_no_simd cpp cpp_no_simd build_c_without_coverage build_cpp_without_coverage
-
-build_all: build_c build_c_no_simd build_cpp build_cpp_no_simd
+.PHONY: all all_c all_cpp
+all: all_c all_cpp
+all_c: c99 c99_no_simd c11 c17
+all_cpp: cpp98 cpp98_no_simd cpp03 cpp11 cpp14 cpp17 cpp20
 
+.PHONY: clean
 clean:
 	rm -rf $(BUILD_DIR)
 
-c: build_c
-	$(BUILD_DIR)/hmm_test_c
-
-build_c: HandmadeMath.c test_impl
-	@echo "\nCompiling in C mode"
+.PHONY: c99
+c99:
+	@echo "\nCompiling as C99"
 	mkdir -p $(BUILD_DIR)
 	cd $(BUILD_DIR)\
 		&& $(CC) $(CPPFLAGS) $(CXXFLAGS) -std=c99 \
-			-c ../HandmadeMath.c ../hmm_test.c \
-			-lm \
-		&& $(CC) -ohmm_test_c HandmadeMath.o hmm_test.o -lm
-
-c_no_simd: build_c_no_simd
-	$(BUILD_DIR)/hmm_test_c_no_simd
+			../HandmadeMath.c ../hmm_test.c \
+			-lm -o hmm_test_c99 \
+		&& ./hmm_test_c99
 
-build_c_no_simd: HandmadeMath.c test_impl
-	@echo "\nCompiling in C mode (no SIMD)"
+.PHONY: c99_no_simd
+c99_no_simd:
+	@echo "\nCompiling as C99 (no SIMD)"
 	mkdir -p $(BUILD_DIR)
 	cd $(BUILD_DIR) \
 		&& $(CC) $(CPPFLAGS) $(CXXFLAGS) -std=c99 \
 			-DHANDMADE_MATH_NO_SIMD \
-			-c ../HandmadeMath.c ../hmm_test.c \
-			-lm \
-		&& $(CC) -ohmm_test_c_no_simd HandmadeMath.o hmm_test.o -lm
+			../HandmadeMath.c ../hmm_test.c \
+			-lm -o hmm_test_c99_no_simd \
+		&& ./hmm_test_c99_no_simd
 
-cpp: build_cpp
-	$(BUILD_DIR)/hmm_test_cpp
-
-build_cpp: HandmadeMath.cpp test_impl
-	@echo "\nCompiling in C++ mode"
+.PHONY: c11
+c11:
+	@echo "\nCompiling as C11"
+	mkdir -p $(BUILD_DIR)
+	cd $(BUILD_DIR)\
+		&& $(CC) $(CPPFLAGS) $(CXXFLAGS) -std=c11 \
+			../HandmadeMath.c ../hmm_test.c \
+			-lm -o hmm_test_c11 \
+		&& ./hmm_test_c11
+
+.PHONY: c17
+c17:
+	@echo "\nCompiling as C17"
+	mkdir -p $(BUILD_DIR)
+	cd $(BUILD_DIR)\
+		&& $(CC) $(CPPFLAGS) $(CXXFLAGS) -std=c17 \
+			../HandmadeMath.c ../hmm_test.c \
+			-lm -o hmm_test_c17 \
+		&& ./hmm_test_c17
+
+.PHONY: cpp98
+cpp98:
+	@echo "\nCompiling as C++98"
 	mkdir -p $(BUILD_DIR)
 	cd $(BUILD_DIR) \
-		&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -ohmm_test_cpp \
-			-DHANDMADE_MATH_CPP_MODE \
-			../HandmadeMath.cpp ../hmm_test.cpp
-
-cpp_no_simd: build_cpp_no_simd
-	$(BUILD_DIR)/hmm_test_cpp_no_simd
-
-build_cpp_no_simd: HandmadeMath.cpp test_impl
-	@echo "\nCompiling in C++ mode (no SIMD)"
+		&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++98 \
+			../HandmadeMath.cpp ../hmm_test.cpp \
+			-lm -o hmm_test_cpp98 \
+		&& ./hmm_test_cpp98
+
+.PHONY: cpp98_no_simd
+cpp98_no_simd:
+	@echo "\nCompiling as C++98 (no SIMD)"
 	mkdir -p $(BUILD_DIR)
 	cd $(BUILD_DIR) \
-		&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -ohmm_test_cpp_no_simd \
-			-DHANDMADE_MATH_CPP_MODE -DHANDMADE_MATH_NO_SIMD \
-			../HandmadeMath.cpp ../hmm_test.cpp
-
-test_impl: hmm_test.cpp hmm_test.c
+		&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++98 \
+			-DHANDMADE_MATH_NO_SIMD \
+			../HandmadeMath.cpp ../hmm_test.cpp \
+			-lm -o hmm_test_cpp98 \
+		&& ./hmm_test_cpp98
 
-build_c_without_coverage: HandmadeMath.c test_impl
-	@echo "\nCompiling in C mode"
+.PHONY: cpp03
+cpp03:
+	@echo "\nCompiling as C++03"
 	mkdir -p $(BUILD_DIR)
-	cd $(BUILD_DIR)\
-		&& $(CC) $(CPPFLAGS) $(CXXFLAGS) -std=c99 \
-			-DWITHOUT_COVERAGE \
-			-c ../HandmadeMath.c ../hmm_test.c \
-			-lm \
-		&& $(CC) -ohmm_test_c HandmadeMath.o hmm_test.o -lm
-
-build_cpp_without_coverage: HandmadeMath.cpp test_impl
-	@echo "\nCompiling in C++ mode (no SIMD)"
+	cd $(BUILD_DIR) \
+		&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++03 \
+			../HandmadeMath.cpp ../hmm_test.cpp \
+			-lm -o hmm_test_cpp03 \
+		&& ./hmm_test_cpp03
+
+.PHONY: cpp11
+cpp11:
+	@echo "\nCompiling as C++11"
 	mkdir -p $(BUILD_DIR)
 	cd $(BUILD_DIR) \
-		&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -ohmm_test_cpp_no_simd \
-			-DHANDMADE_MATH_CPP_MODE -DWITHOUT_COVERAGE \
-			../HandmadeMath.cpp ../hmm_test.cpp
-
+		&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++11 \
+			../HandmadeMath.cpp ../hmm_test.cpp \
+			-lm -o hmm_test_cpp11 \
+		&& ./hmm_test_cpp11
+
+.PHONY: cpp14
+cpp14:
+	@echo "\nCompiling as C++14"
+	mkdir -p $(BUILD_DIR)
+	cd $(BUILD_DIR) \
+		&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++14 \
+			../HandmadeMath.cpp ../hmm_test.cpp \
+			-lm -o hmm_test_cpp14 \
+		&& ./hmm_test_cpp14
+
+.PHONY: cpp17
+cpp17:
+	@echo "\nCompiling as C++17"
+	mkdir -p $(BUILD_DIR)
+	cd $(BUILD_DIR) \
+		&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++17 \
+			../HandmadeMath.cpp ../hmm_test.cpp \
+			-lm -o hmm_test_cpp17 \
+		&& ./hmm_test_cpp17
+
+.PHONY: cpp20
+cpp20:
+	@echo "\nCompiling as C++20"
+	mkdir -p $(BUILD_DIR)
+	cd $(BUILD_DIR) \
+		&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++20 \
+			../HandmadeMath.cpp ../hmm_test.cpp \
+			-lm -o hmm_test_cpp20 \
+		&& ./hmm_test_cpp20
diff --git a/test/categories/Addition.h b/test/categories/Addition.h
--- a/test/categories/Addition.h
+++ b/test/categories/Addition.h
@@ -10,12 +10,14 @@ TEST(Addition, Vec2)
         EXPECT_FLOAT_EQ(result.X, 4.0f);
         EXPECT_FLOAT_EQ(result.Y, 6.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec2 result = HMM_Add(v2_1, v2_2);
         EXPECT_FLOAT_EQ(result.X, 4.0f);
         EXPECT_FLOAT_EQ(result.Y, 6.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec2 result = v2_1 + v2_2;
         EXPECT_FLOAT_EQ(result.X, 4.0f);
@@ -39,13 +41,15 @@ TEST(Addition, Vec3)
         EXPECT_FLOAT_EQ(result.Y, 7.0f);
         EXPECT_FLOAT_EQ(result.Z, 9.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec3 result = HMM_Add(v3_1, v3_2);
         EXPECT_FLOAT_EQ(result.X, 5.0f);
         EXPECT_FLOAT_EQ(result.Y, 7.0f);
         EXPECT_FLOAT_EQ(result.Z, 9.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec3 result = v3_1 + v3_2;
         EXPECT_FLOAT_EQ(result.X, 5.0f);
@@ -72,7 +76,7 @@ TEST(Addition, Vec4)
         EXPECT_FLOAT_EQ(result.Z, 10.0f);
         EXPECT_FLOAT_EQ(result.W, 12.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec4 result = HMM_Add(v4_1, v4_2);
         EXPECT_FLOAT_EQ(result.X, 6.0f);
@@ -80,6 +84,8 @@ TEST(Addition, Vec4)
         EXPECT_FLOAT_EQ(result.Z, 10.0f);
         EXPECT_FLOAT_EQ(result.W, 12.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec4 result = v4_1 + v4_2;
         EXPECT_FLOAT_EQ(result.X, 6.0f);
@@ -125,14 +131,16 @@ TEST(Addition, Mat2)
         EXPECT_FLOAT_EQ(result.Elements[1][1], 12.0f); 
     }
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat2 result = HMM_Add(a, b);
-        EXPECT_FLOAT_EQ(result.Elements[0][0], 6.0f); 
-        EXPECT_FLOAT_EQ(result.Elements[0][1], 8.0f); 
-        EXPECT_FLOAT_EQ(result.Elements[1][0], 10.0f); 
-        EXPECT_FLOAT_EQ(result.Elements[1][1], 12.0f); 
+        EXPECT_FLOAT_EQ(result.Elements[0][0], 6.0f);
+        EXPECT_FLOAT_EQ(result.Elements[0][1], 8.0f);
+        EXPECT_FLOAT_EQ(result.Elements[1][0], 10.0f);
+        EXPECT_FLOAT_EQ(result.Elements[1][1], 12.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Mat2 result = a + b;
         EXPECT_FLOAT_EQ(result.Elements[0][0], 6.0f); 
@@ -182,19 +190,21 @@ TEST(Addition, Mat3)
         EXPECT_FLOAT_EQ(result.Elements[2][2], 27.0f);   
     }
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat3 result = HMM_Add(a, b);
-        EXPECT_FLOAT_EQ(result.Elements[0][0], 11.0f); 
-        EXPECT_FLOAT_EQ(result.Elements[0][1], 13.0f); 
-        EXPECT_FLOAT_EQ(result.Elements[0][2], 15.0f); 
-        EXPECT_FLOAT_EQ(result.Elements[1][0], 17.0f); 
+        EXPECT_FLOAT_EQ(result.Elements[0][0], 11.0f);
+        EXPECT_FLOAT_EQ(result.Elements[0][1], 13.0f);
+        EXPECT_FLOAT_EQ(result.Elements[0][2], 15.0f);
+        EXPECT_FLOAT_EQ(result.Elements[1][0], 17.0f);
         EXPECT_FLOAT_EQ(result.Elements[1][1], 19.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][2], 21.0f); 
-        EXPECT_FLOAT_EQ(result.Elements[2][0], 23.0f); 
+        EXPECT_FLOAT_EQ(result.Elements[1][2], 21.0f);
+        EXPECT_FLOAT_EQ(result.Elements[2][0], 23.0f);
         EXPECT_FLOAT_EQ(result.Elements[2][1], 25.0f);
-        EXPECT_FLOAT_EQ(result.Elements[2][2], 27.0f);   
+        EXPECT_FLOAT_EQ(result.Elements[2][2], 27.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Mat3 result = a + b;
         EXPECT_FLOAT_EQ(result.Elements[0][0], 11.0f); 
@@ -257,7 +267,7 @@ TEST(Addition, Mat4)
             }
         }
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat4 result = HMM_Add(m4_1, m4_2);
         float Expected = 18.0f;
@@ -270,6 +280,8 @@ TEST(Addition, Mat4)
             }
         }
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Mat4 result = m4_1 + m4_2;
         float Expected = 18.0f;
@@ -308,7 +320,7 @@ TEST(Addition, Quaternion)
         EXPECT_FLOAT_EQ(result.Z, 10.0f);
         EXPECT_FLOAT_EQ(result.W, 12.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Quat result = HMM_Add(q1, q2);
         EXPECT_FLOAT_EQ(result.X, 6.0f);
@@ -316,6 +328,8 @@ TEST(Addition, Quaternion)
         EXPECT_FLOAT_EQ(result.Z, 10.0f);
         EXPECT_FLOAT_EQ(result.W, 12.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Quat result = q1 + q2;
         EXPECT_FLOAT_EQ(result.X, 6.0f);
diff --git a/test/categories/Division.h b/test/categories/Division.h
--- a/test/categories/Division.h
+++ b/test/categories/Division.h
@@ -10,12 +10,14 @@ TEST(Division, Vec2Vec2)
         EXPECT_FLOAT_EQ(result.X, 0.5f);
         EXPECT_FLOAT_EQ(result.Y, 0.75f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec2 result = HMM_Div(v2_1, v2_2);
         EXPECT_FLOAT_EQ(result.X, 0.5f);
         EXPECT_FLOAT_EQ(result.Y, 0.75f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec2 result = v2_1 / v2_2;
         EXPECT_FLOAT_EQ(result.X, 0.5f);
@@ -38,12 +40,14 @@ TEST(Division, Vec2Scalar)
         EXPECT_FLOAT_EQ(result.X, 0.5f);
         EXPECT_FLOAT_EQ(result.Y, 1.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec2 result = HMM_Div(v2, s);
         EXPECT_FLOAT_EQ(result.X, 0.5f);
         EXPECT_FLOAT_EQ(result.Y, 1.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec2 result = v2 / s;
         EXPECT_FLOAT_EQ(result.X, 0.5f);
@@ -67,13 +71,15 @@ TEST(Division, Vec3Vec3)
         EXPECT_FLOAT_EQ(result.Y, 0.75f);
         EXPECT_FLOAT_EQ(result.Z, 10.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec3 result = HMM_Div(v3_1, v3_2);
         EXPECT_FLOAT_EQ(result.X, 0.5f);
         EXPECT_FLOAT_EQ(result.Y, 0.75f);
         EXPECT_FLOAT_EQ(result.Z, 10.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec3 result = v3_1 / v3_2;
         EXPECT_FLOAT_EQ(result.X, 0.5f);
@@ -99,13 +105,15 @@ TEST(Division, Vec3Scalar)
         EXPECT_FLOAT_EQ(result.Y, 1.0f);
         EXPECT_FLOAT_EQ(result.Z, 1.5f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec3 result = HMM_Div(v3, s);
         EXPECT_FLOAT_EQ(result.X, 0.5f);
         EXPECT_FLOAT_EQ(result.Y, 1.0f);
         EXPECT_FLOAT_EQ(result.Z, 1.5f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec3 result = v3 / s;
         EXPECT_FLOAT_EQ(result.X, 0.5f);
@@ -132,7 +140,7 @@ TEST(Division, Vec4Vec4)
         EXPECT_FLOAT_EQ(result.Z, 10.0f);
         EXPECT_FLOAT_EQ(result.W, 0.25f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec4 result = HMM_Div(v4_1, v4_2);
         EXPECT_FLOAT_EQ(result.X, 0.5f);
@@ -140,6 +148,8 @@ TEST(Division, Vec4Vec4)
         EXPECT_FLOAT_EQ(result.Z, 10.0f);
         EXPECT_FLOAT_EQ(result.W, 0.25f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec4 result = v4_1 / v4_2;
         EXPECT_FLOAT_EQ(result.X, 0.5f);
@@ -168,7 +178,7 @@ TEST(Division, Vec4Scalar)
         EXPECT_FLOAT_EQ(result.Z, 1.5f);
         EXPECT_FLOAT_EQ(result.W, 2.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec4 result = HMM_Div(v4, s);
         EXPECT_FLOAT_EQ(result.X, 0.5f);
@@ -176,6 +186,8 @@ TEST(Division, Vec4Scalar)
         EXPECT_FLOAT_EQ(result.Z, 1.5f);
         EXPECT_FLOAT_EQ(result.W, 2.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec4 result = v4 / s;
         EXPECT_FLOAT_EQ(result.X, 0.5f);
@@ -212,7 +224,7 @@ TEST(Division, Mat2Scalar)
         EXPECT_FLOAT_EQ(result.Elements[1][1], 8.0f);
     }
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat2 result = HMM_Div(m, s);
         EXPECT_FLOAT_EQ(result.Elements[0][0], 2.0f);
@@ -220,7 +232,9 @@ TEST(Division, Mat2Scalar)
         EXPECT_FLOAT_EQ(result.Elements[1][0], 6.0f);
         EXPECT_FLOAT_EQ(result.Elements[1][1], 8.0f);
     }
+#endif
 
+#ifdef __cplusplus
     {
         HMM_Mat2 result = m / s;
         EXPECT_FLOAT_EQ(result.Elements[0][0], 2.0f);
@@ -257,7 +271,7 @@ TEST(Division, Mat3Scalar)
         EXPECT_FLOAT_EQ(result.Elements[2][2], 18.0f);
     }
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat3 result = HMM_Div(m, s);
         EXPECT_FLOAT_EQ(result.Elements[0][0], 2.0f);
@@ -270,7 +284,9 @@ TEST(Division, Mat3Scalar)
         EXPECT_FLOAT_EQ(result.Elements[2][1], 16.0f);
         EXPECT_FLOAT_EQ(result.Elements[2][2], 18.0f);
     }
+#endif
 
+#ifdef __cplusplus
     {
         HMM_Mat3 result = m / s;
         EXPECT_FLOAT_EQ(result.Elements[0][0], 2.0f);
@@ -322,7 +338,7 @@ TEST(Division, Mat4Scalar)
         EXPECT_FLOAT_EQ(result.Elements[3][2], 7.5f);
         EXPECT_FLOAT_EQ(result.Elements[3][3], 8.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat4 result = HMM_Div(m4, s);
         EXPECT_FLOAT_EQ(result.Elements[0][0], 0.5f);
@@ -342,6 +358,8 @@ TEST(Division, Mat4Scalar)
         EXPECT_FLOAT_EQ(result.Elements[3][2], 7.5f);
         EXPECT_FLOAT_EQ(result.Elements[3][3], 8.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Mat4 result = m4 / s;
         EXPECT_FLOAT_EQ(result.Elements[0][0], 0.5f);
@@ -394,7 +412,7 @@ TEST(Division, QuaternionScalar)
         EXPECT_FLOAT_EQ(result.Z, 1.5f);
         EXPECT_FLOAT_EQ(result.W, 2.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Quat result = HMM_Div(q, f);
         EXPECT_FLOAT_EQ(result.X, 0.5f);
@@ -402,6 +420,8 @@ TEST(Division, QuaternionScalar)
         EXPECT_FLOAT_EQ(result.Z, 1.5f);
         EXPECT_FLOAT_EQ(result.W, 2.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Quat result = q / f;
         EXPECT_FLOAT_EQ(result.X, 0.5f);
diff --git a/test/categories/Equality.h b/test/categories/Equality.h
--- a/test/categories/Equality.h
+++ b/test/categories/Equality.h
@@ -9,10 +9,12 @@ TEST(Equality, Vec2)
     EXPECT_TRUE(HMM_EqV2(a, b));
     EXPECT_FALSE(HMM_EqV2(a, c));
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     EXPECT_TRUE(HMM_Eq(a, b));
     EXPECT_FALSE(HMM_Eq(a, c));
+#endif
 
+#ifdef __cplusplus
     EXPECT_TRUE(a == b);
     EXPECT_FALSE(a == c);
 
@@ -30,10 +32,12 @@ TEST(Equality, Vec3)
     EXPECT_TRUE(HMM_EqV3(a, b));
     EXPECT_FALSE(HMM_EqV3(a, c));
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     EXPECT_TRUE(HMM_Eq(a, b));
     EXPECT_FALSE(HMM_Eq(a, c));
+#endif
 
+#ifdef __cplusplus
     EXPECT_TRUE(a == b);
     EXPECT_FALSE(a == c);
 
@@ -51,10 +55,12 @@ TEST(Equality, Vec4)
     EXPECT_TRUE(HMM_EqV4(a, b));
     EXPECT_FALSE(HMM_EqV4(a, c));
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     EXPECT_TRUE(HMM_Eq(a, b));
     EXPECT_FALSE(HMM_Eq(a, c));
+#endif
 
+#ifdef __cplusplus
     EXPECT_TRUE(a == b);
     EXPECT_FALSE(a == c);
 
diff --git a/test/categories/MatrixOps.h b/test/categories/MatrixOps.h
--- a/test/categories/MatrixOps.h
+++ b/test/categories/MatrixOps.h
@@ -19,7 +19,7 @@ TEST(InvMatrix, Transpose)
             EXPECT_FLOAT_EQ(result.Elements[1][0], Expect.Elements[1][0]);
             EXPECT_FLOAT_EQ(result.Elements[1][1], Expect.Elements[1][1]);
         }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
         {
             HMM_Mat2 result = HMM_Transpose(Matrix);
             EXPECT_FLOAT_EQ(result.Elements[0][0], Expect.Elements[0][0]);
@@ -54,7 +54,7 @@ TEST(InvMatrix, Transpose)
             EXPECT_FLOAT_EQ(result.Elements[2][1], Expect.Elements[2][1]);
             EXPECT_FLOAT_EQ(result.Elements[2][2], Expect.Elements[2][2]);
         }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
         {
             HMM_Mat3 result = HMM_Transpose(Matrix);
             EXPECT_FLOAT_EQ(result.Elements[0][0], Expect.Elements[0][0]);
@@ -94,7 +94,7 @@ TEST(InvMatrix, Transpose)
             EXPECT_FLOAT_EQ(result.Elements[2][1], Expect.Elements[2][1]);
             EXPECT_FLOAT_EQ(result.Elements[2][2], Expect.Elements[2][2]);
         }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
         {
             HMM_Mat4 result = HMM_Transpose(Matrix);
             EXPECT_FLOAT_EQ(result.Elements[0][0], Expect.Elements[0][0]);
diff --git a/test/categories/Multiplication.h b/test/categories/Multiplication.h
--- a/test/categories/Multiplication.h
+++ b/test/categories/Multiplication.h
@@ -10,12 +10,14 @@ TEST(Multiplication, Vec2Vec2)
         EXPECT_FLOAT_EQ(result.X, 3.0f);
         EXPECT_FLOAT_EQ(result.Y, 8.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec2 result = HMM_Mul(v2_1, v2_2);
         EXPECT_FLOAT_EQ(result.X, 3.0f);
         EXPECT_FLOAT_EQ(result.Y, 8.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec2 result = v2_1 * v2_2;
         EXPECT_FLOAT_EQ(result.X, 3.0f);
@@ -38,12 +40,14 @@ TEST(Multiplication, Vec2Scalar)
         EXPECT_FLOAT_EQ(result.X, 3.0f);
         EXPECT_FLOAT_EQ(result.Y, 6.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec2 result = HMM_Mul(v2, s);
         EXPECT_FLOAT_EQ(result.X, 3.0f);
         EXPECT_FLOAT_EQ(result.Y, 6.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec2 result = v2 * s;
         EXPECT_FLOAT_EQ(result.X, 3.0f);
@@ -72,13 +76,15 @@ TEST(Multiplication, Vec3Vec3)
         EXPECT_FLOAT_EQ(result.Y, 10.0f);
         EXPECT_FLOAT_EQ(result.Z, 18.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec3 result = HMM_Mul(v3_1, v3_2);
         EXPECT_FLOAT_EQ(result.X, 4.0f);
         EXPECT_FLOAT_EQ(result.Y, 10.0f);
         EXPECT_FLOAT_EQ(result.Z, 18.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec3 result = v3_1 * v3_2;
         EXPECT_FLOAT_EQ(result.X, 4.0f);
@@ -104,13 +110,15 @@ TEST(Multiplication, Vec3Scalar)
         EXPECT_FLOAT_EQ(result.Y, 6.0f);
         EXPECT_FLOAT_EQ(result.Z, 9.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec3 result = HMM_Mul(v3, s);
         EXPECT_FLOAT_EQ(result.X, 3.0f);
         EXPECT_FLOAT_EQ(result.Y, 6.0f);
         EXPECT_FLOAT_EQ(result.Z, 9.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec3 result = v3 * s;
         EXPECT_FLOAT_EQ(result.X, 3.0f);
@@ -143,7 +151,7 @@ TEST(Multiplication, Vec4Vec4)
         EXPECT_FLOAT_EQ(result.Z, 21.0f);
         EXPECT_FLOAT_EQ(result.W, 32.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec4 result = HMM_Mul(v4_1, v4_2);
         EXPECT_FLOAT_EQ(result.X, 5.0f);
@@ -151,6 +159,8 @@ TEST(Multiplication, Vec4Vec4)
         EXPECT_FLOAT_EQ(result.Z, 21.0f);
         EXPECT_FLOAT_EQ(result.W, 32.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec4 result = v4_1 * v4_2;
         EXPECT_FLOAT_EQ(result.X, 5.0f);
@@ -179,7 +189,7 @@ TEST(Multiplication, Vec4Scalar)
         EXPECT_FLOAT_EQ(result.Z, 9.0f);
         EXPECT_FLOAT_EQ(result.W, 12.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec4 result = HMM_Mul(v4, s);
         EXPECT_FLOAT_EQ(result.X, 3.0f);
@@ -187,6 +197,8 @@ TEST(Multiplication, Vec4Scalar)
         EXPECT_FLOAT_EQ(result.Z, 9.0f);
         EXPECT_FLOAT_EQ(result.W, 12.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec4 result = v4 * s;
         EXPECT_FLOAT_EQ(result.X, 3.0f);
@@ -234,15 +246,17 @@ TEST(Multiplication, Mat2Mat2) {
         EXPECT_FLOAT_EQ(result.Elements[1][1], 46.0f);        
     }
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat2 result = HMM_Mul(a,b);
         EXPECT_FLOAT_EQ(result.Elements[0][0], 23.0f);
         EXPECT_FLOAT_EQ(result.Elements[0][1], 34.0f);
         EXPECT_FLOAT_EQ(result.Elements[1][0], 31.0f);
-        EXPECT_FLOAT_EQ(result.Elements[1][1], 46.0f);        
+        EXPECT_FLOAT_EQ(result.Elements[1][1], 46.0f);
     }
+#endif
 
+#ifdef __cplusplus
     {
         HMM_Mat2 result = a * b;
         EXPECT_FLOAT_EQ(result.Elements[0][0], 23.0f);
@@ -271,7 +285,7 @@ TEST(Multiplication, Mat2Scalar) {
         EXPECT_FLOAT_EQ(result.Elements[1][0], 30.0f);
         EXPECT_FLOAT_EQ(result.Elements[1][1], 40.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat2 result = HMM_Mul(m, s);
         EXPECT_FLOAT_EQ(result.Elements[0][0], 10.0f);
@@ -279,6 +293,8 @@ TEST(Multiplication, Mat2Scalar) {
         EXPECT_FLOAT_EQ(result.Elements[1][0], 30.0f);
         EXPECT_FLOAT_EQ(result.Elements[1][1], 40.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Mat2 result = m * s;
         EXPECT_FLOAT_EQ(result.Elements[0][0], 10.0f);
@@ -322,13 +338,15 @@ TEST(Multiplication, Mat2Vec2) {
         EXPECT_FLOAT_EQ(result.Elements[1], 34.0f);
     }
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec2 result = HMM_Mul(m, v);
         EXPECT_FLOAT_EQ(result.Elements[0], 23.0f);
         EXPECT_FLOAT_EQ(result.Elements[1], 34.0f);
     }
-    
+#endif
+
+#ifdef __cplusplus
     {
         HMM_Vec2 result = m * v;
         EXPECT_FLOAT_EQ(result.Elements[0], 23.0f);
@@ -368,7 +386,7 @@ TEST(Multiplication, Mat3Mat3)
         EXPECT_FLOAT_EQ(result.Elements[2][2], 312.0f);
     }
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat3 result = HMM_Mul(a,b);
         EXPECT_FLOAT_EQ(result.Elements[0][0], 138.0f);
@@ -381,7 +399,9 @@ TEST(Multiplication, Mat3Mat3)
         EXPECT_FLOAT_EQ(result.Elements[2][1], 261.0f);
         EXPECT_FLOAT_EQ(result.Elements[2][2], 312.0f);
     }
+#endif
 
+#ifdef __cplusplus
     {
         HMM_Mat3 result = a * b;
         EXPECT_FLOAT_EQ(result.Elements[0][0], 138.0f);
@@ -420,7 +440,7 @@ TEST(Multiplication, Mat3Scalar) {
         EXPECT_FLOAT_EQ(result.Elements[2][1], 80.0f);
         EXPECT_FLOAT_EQ(result.Elements[2][2], 90.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat3 result = HMM_Mul(m, s);
         EXPECT_FLOAT_EQ(result.Elements[0][0], 10.0f);
@@ -433,6 +453,8 @@ TEST(Multiplication, Mat3Scalar) {
         EXPECT_FLOAT_EQ(result.Elements[2][1], 80.0f);
         EXPECT_FLOAT_EQ(result.Elements[2][2], 90.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Mat3 result = m * s;
         EXPECT_FLOAT_EQ(result.Elements[0][0], 10.0f);
@@ -491,14 +513,15 @@ TEST(Multiplication, Mat3Vec3) {
         EXPECT_FLOAT_EQ(result.Elements[1], 171.0f);
         EXPECT_FLOAT_EQ(result.Elements[2], 204.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec3 result = HMM_Mul(m, v);
         EXPECT_FLOAT_EQ(result.Elements[0], 138.0f);
         EXPECT_FLOAT_EQ(result.Elements[1], 171.0f);
         EXPECT_FLOAT_EQ(result.Elements[2], 204.0f);
     }
-    
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec3 result = m * v;
         EXPECT_FLOAT_EQ(result.Elements[0], 138.0f);
@@ -552,7 +575,7 @@ TEST(Multiplication, Mat4Mat4)
         EXPECT_FLOAT_EQ(result.Elements[3][2], 1118.0f);
         EXPECT_FLOAT_EQ(result.Elements[3][3], 1240.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat4 result = HMM_Mul(m4_1, m4_2);
         EXPECT_FLOAT_EQ(result.Elements[0][0], 538.0f);
@@ -572,6 +595,8 @@ TEST(Multiplication, Mat4Mat4)
         EXPECT_FLOAT_EQ(result.Elements[3][2], 1118.0f);
         EXPECT_FLOAT_EQ(result.Elements[3][3], 1240.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Mat4 result = m4_1 * m4_2;
         EXPECT_FLOAT_EQ(result.Elements[0][0], 538.0f);
@@ -634,7 +659,7 @@ TEST(Multiplication, Mat4Scalar)
         EXPECT_FLOAT_EQ(result.Elements[3][2], 45.0f);
         EXPECT_FLOAT_EQ(result.Elements[3][3], 48.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat4 result = HMM_Mul(m4, s);
         EXPECT_FLOAT_EQ(result.Elements[0][0], 3.0f);
@@ -654,6 +679,8 @@ TEST(Multiplication, Mat4Scalar)
         EXPECT_FLOAT_EQ(result.Elements[3][2], 45.0f);
         EXPECT_FLOAT_EQ(result.Elements[3][3], 48.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Mat4 result = m4 * s;
         EXPECT_FLOAT_EQ(result.Elements[0][0], 3.0f);
@@ -737,7 +764,7 @@ TEST(Multiplication, Mat4Vec4)
         EXPECT_FLOAT_EQ(result.Z, 110.0f);
         EXPECT_FLOAT_EQ(result.W, 120.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec4 result = HMM_Mul(m4, v4);
         EXPECT_FLOAT_EQ(result.X, 90.0f);
@@ -745,6 +772,8 @@ TEST(Multiplication, Mat4Vec4)
         EXPECT_FLOAT_EQ(result.Z, 110.0f);
         EXPECT_FLOAT_EQ(result.W, 120.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec4 result = m4 * v4;
         EXPECT_FLOAT_EQ(result.X, 90.0f);
@@ -769,7 +798,7 @@ TEST(Multiplication, QuaternionQuaternion)
         EXPECT_FLOAT_EQ(result.Z, 48.0f);
         EXPECT_FLOAT_EQ(result.W, -6.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Quat result = HMM_Mul(q1, q2);
         EXPECT_FLOAT_EQ(result.X, 24.0f);
@@ -777,6 +806,8 @@ TEST(Multiplication, QuaternionQuaternion)
         EXPECT_FLOAT_EQ(result.Z, 48.0f);
         EXPECT_FLOAT_EQ(result.W, -6.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Quat result = q1 * q2;
         EXPECT_FLOAT_EQ(result.X, 24.0f);
@@ -803,7 +834,7 @@ TEST(Multiplication, QuaternionScalar)
         EXPECT_FLOAT_EQ(result.Z, 6.0f);
         EXPECT_FLOAT_EQ(result.W, 8.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Quat result = HMM_Mul(q, f);
         EXPECT_FLOAT_EQ(result.X, 2.0f);
@@ -811,6 +842,8 @@ TEST(Multiplication, QuaternionScalar)
         EXPECT_FLOAT_EQ(result.Z, 6.0f);
         EXPECT_FLOAT_EQ(result.W, 8.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Quat result = q * f;
         EXPECT_FLOAT_EQ(result.X, 2.0f);
diff --git a/test/categories/QuaternionOps.h b/test/categories/QuaternionOps.h
--- a/test/categories/QuaternionOps.h
+++ b/test/categories/QuaternionOps.h
@@ -22,7 +22,7 @@ TEST(QuaternionOps, Dot)
         float result = HMM_DotQ(q1, q2);
         EXPECT_FLOAT_EQ(result, 70.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         float result = HMM_Dot(q1, q2);
         EXPECT_FLOAT_EQ(result, 70.0f);
@@ -41,7 +41,7 @@ TEST(QuaternionOps, Normalize)
         EXPECT_NEAR(result.Z, 0.5477225575f, 0.001f);
         EXPECT_NEAR(result.W, 0.7302967433f, 0.001f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Quat result = HMM_Norm(q);
         EXPECT_NEAR(result.X, 0.1825741858f, 0.001f);
@@ -97,7 +97,7 @@ TEST(QuaternionOps, SLerp)
         EXPECT_NEAR(result.Z, -0.40824830f, 0.001f);
         EXPECT_NEAR(result.W, 0.70710676f, 0.001f);
     }
-        {
+    {
         HMM_Quat result = HMM_SLerp(from, 1.0f, to);
         EXPECT_NEAR(result.X, 0.5f, 0.001f);
         EXPECT_NEAR(result.Y, 0.5f, 0.001f);
diff --git a/test/categories/Subtraction.h b/test/categories/Subtraction.h
--- a/test/categories/Subtraction.h
+++ b/test/categories/Subtraction.h
@@ -10,12 +10,14 @@ TEST(Subtraction, Vec2)
         EXPECT_FLOAT_EQ(result.X, -2.0f);
         EXPECT_FLOAT_EQ(result.Y, -2.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec2 result = HMM_Sub(v2_1, v2_2);
         EXPECT_FLOAT_EQ(result.X, -2.0f);
         EXPECT_FLOAT_EQ(result.Y, -2.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec2 result = v2_1 - v2_2;
         EXPECT_FLOAT_EQ(result.X, -2.0f);
@@ -39,13 +41,15 @@ TEST(Subtraction, Vec3)
         EXPECT_FLOAT_EQ(result.Y, -3.0f);
         EXPECT_FLOAT_EQ(result.Z, -3.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec3 result = HMM_Sub(v3_1, v3_2);
         EXPECT_FLOAT_EQ(result.X, -3.0f);
         EXPECT_FLOAT_EQ(result.Y, -3.0f);
         EXPECT_FLOAT_EQ(result.Z, -3.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec3 result = v3_1 - v3_2;
         EXPECT_FLOAT_EQ(result.X, -3.0f);
@@ -72,7 +76,7 @@ TEST(Subtraction, Vec4)
         EXPECT_FLOAT_EQ(result.Z, -4.0f);
         EXPECT_FLOAT_EQ(result.W, -4.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec4 result = HMM_Sub(v4_1, v4_2);
         EXPECT_FLOAT_EQ(result.X, -4.0f);
@@ -80,6 +84,8 @@ TEST(Subtraction, Vec4)
         EXPECT_FLOAT_EQ(result.Z, -4.0f);
         EXPECT_FLOAT_EQ(result.W, -4.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Vec4 result = v4_1 - v4_2;
         EXPECT_FLOAT_EQ(result.X, -4.0f);
@@ -124,7 +130,7 @@ TEST(Subtraction, Mat2)
         EXPECT_FLOAT_EQ(result.Elements[1][0], 4.0);
         EXPECT_FLOAT_EQ(result.Elements[1][1], 4.0);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat2 result = HMM_Sub(b,a);
         EXPECT_FLOAT_EQ(result.Elements[0][0], 4.0);
@@ -132,7 +138,8 @@ TEST(Subtraction, Mat2)
         EXPECT_FLOAT_EQ(result.Elements[1][0], 4.0);
         EXPECT_FLOAT_EQ(result.Elements[1][1], 4.0);
     }
-
+#endif
+#ifdef __cplusplus
     {
         HMM_Mat2 result = b - a;
         EXPECT_FLOAT_EQ(result.Elements[0][0], 4.0);
@@ -183,7 +190,7 @@ TEST(Subtraction, Mat3)
         EXPECT_FLOAT_EQ(result.Elements[2][1], 9.0);
         EXPECT_FLOAT_EQ(result.Elements[2][2], 9.0);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat3 result = HMM_Sub(b,a);
         EXPECT_FLOAT_EQ(result.Elements[0][0], 9.0);
@@ -196,7 +203,9 @@ TEST(Subtraction, Mat3)
         EXPECT_FLOAT_EQ(result.Elements[2][1], 9.0);
         EXPECT_FLOAT_EQ(result.Elements[2][2], 9.0);
     }
+#endif
 
+#ifdef __cplusplus
     b -= a;
     EXPECT_FLOAT_EQ(b.Elements[0][0], 9.0);
     EXPECT_FLOAT_EQ(b.Elements[0][1], 9.0);
@@ -245,7 +254,7 @@ TEST(Subtraction, Mat4)
             }
         }
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Mat4 result = HMM_Sub(m4_1, m4_2);
         for (int Column = 0; Column < 4; ++Column)
@@ -256,6 +265,8 @@ TEST(Subtraction, Mat4)
             }
         }
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Mat4 result = m4_1 - m4_2;
         for (int Column = 0; Column < 4; ++Column)
@@ -290,7 +301,7 @@ TEST(Subtraction, Quaternion)
         EXPECT_FLOAT_EQ(result.Z, -4.0f);
         EXPECT_FLOAT_EQ(result.W, -4.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Quat result = HMM_Sub(q1, q2);
         EXPECT_FLOAT_EQ(result.X, -4.0f);
@@ -298,6 +309,8 @@ TEST(Subtraction, Quaternion)
         EXPECT_FLOAT_EQ(result.Z, -4.0f);
         EXPECT_FLOAT_EQ(result.W, -4.0f);
     }
+#endif
+#ifdef __cplusplus
     {
         HMM_Quat result = q1 - q2;
         EXPECT_FLOAT_EQ(result.X, -4.0f);
diff --git a/test/categories/VectorOps.h b/test/categories/VectorOps.h
--- a/test/categories/VectorOps.h
+++ b/test/categories/VectorOps.h
@@ -10,7 +10,7 @@ TEST(VectorOps, LengthSquared)
     EXPECT_FLOAT_EQ(HMM_LenSqrV3(v3), 14.0f);
     EXPECT_FLOAT_EQ(HMM_LenSqrV4(v4), 15.0f);
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     EXPECT_FLOAT_EQ(HMM_LenSqr(v2), 5.0f);
     EXPECT_FLOAT_EQ(HMM_LenSqr(v3), 14.0f);
     EXPECT_FLOAT_EQ(HMM_LenSqr(v4), 15.0f);
@@ -27,7 +27,7 @@ TEST(VectorOps, Length)
     EXPECT_FLOAT_EQ(HMM_LenV3(v3), 7.0f);
     EXPECT_FLOAT_EQ(HMM_LenV4(v4), 13.892444f);
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     EXPECT_FLOAT_EQ(HMM_Len(v2), 9.0553856f);
     EXPECT_FLOAT_EQ(HMM_Len(v3), 7.0f);
     EXPECT_FLOAT_EQ(HMM_Len(v4), 13.892444f);
@@ -62,7 +62,7 @@ TEST(VectorOps, Normalize)
         EXPECT_LT(result.W, 0.0f);
     }
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec2 result = HMM_Norm(v2);
         EXPECT_NEAR(HMM_LenV2(result), 1.0f, 0.001f);
@@ -112,7 +112,7 @@ TEST(VectorOps, NormalizeZero)
         EXPECT_FLOAT_EQ(result.W, 0.0f);
     }
 
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec2 result = HMM_Norm(v2);
         EXPECT_FLOAT_EQ(result.X, 0.0f);
@@ -152,7 +152,7 @@ TEST(VectorOps, DotVec2)
     HMM_Vec2 v2 = HMM_V2(3.0f, 4.0f);
 
     EXPECT_FLOAT_EQ(HMM_DotV2(v1, v2), 11.0f);
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     EXPECT_FLOAT_EQ(HMM_Dot(v1, v2), 11.0f);
 #endif
 }
@@ -163,7 +163,7 @@ TEST(VectorOps, DotVec3)
     HMM_Vec3 v2 = HMM_V3(4.0f, 5.0f, 6.0f);
 
     EXPECT_FLOAT_EQ(HMM_DotV3(v1, v2), 32.0f);
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     EXPECT_FLOAT_EQ(HMM_Dot(v1, v2), 32.0f);
 #endif
 }
@@ -174,7 +174,7 @@ TEST(VectorOps, DotVec4)
     HMM_Vec4 v2 = HMM_V4(5.0f, 6.0f, 7.0f, 8.0f);
 
     EXPECT_FLOAT_EQ(HMM_DotV4(v1, v2), 70.0f);
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     EXPECT_FLOAT_EQ(HMM_Dot(v1, v2), 70.0f);
 #endif
 }
@@ -189,7 +189,7 @@ TEST(VectorOps, LerpV2)
         EXPECT_FLOAT_EQ(result.X, 0.5f);
         EXPECT_FLOAT_EQ(result.Y, 0.5f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec2 result = HMM_Lerp(v1, 0.5, v2);
         EXPECT_FLOAT_EQ(result.X, 0.5f);
@@ -209,7 +209,7 @@ TEST(VectorOps, LerpV3)
         EXPECT_FLOAT_EQ(result.Y, 1.0f);
         EXPECT_FLOAT_EQ(result.Z, 0.5f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec3 result = HMM_Lerp(v1, 0.5, v2);
         EXPECT_FLOAT_EQ(result.X, 0.5f);
@@ -231,7 +231,7 @@ TEST(VectorOps, LerpV4)
         EXPECT_FLOAT_EQ(result.Z, 0.5f);
         EXPECT_FLOAT_EQ(result.W, 1.0f);
     }
-#ifdef __cplusplus
+#if HANDMADE_MATH__USE_C11_GENERICS || defined(__cplusplus)
     {
         HMM_Vec4 result = HMM_Lerp(v1, 0.5, v2);
         EXPECT_FLOAT_EQ(result.X, 0.5f);
diff --git a/test/run_test_clang.bat b/test/run_test_clang.bat
--- a/test/run_test_clang.bat
+++ b/test/run_test_clang.bat
@@ -3,16 +3,25 @@
 if not exist "build" mkdir build
 pushd build
 
-clang-cl /Fehmm_test_c.exe ..\HandmadeMath.c ..\hmm_test.c
-hmm_test_c
+clang-cl /std:c11 /Fehmm_test_c11.exe ..\HandmadeMath.c ..\hmm_test.c || exit /b 1
+hmm_test_c11 || exit /b 1
 
-clang-cl /Fehmm_test_c_no_sse.exe /DHANDMADE_MATH_NO_SSE ..\HandmadeMath.c ..\hmm_test.c
-hmm_test_c_no_sse
+clang-cl /std:c11 /Fehmm_test_c11_no_simd.exe /DHANDMADE_MATH_NO_SIMD ..\HandmadeMath.c ..\hmm_test.c || exit /b 1
+hmm_test_c11_no_simd || exit /b 1
 
-clang-cl /Fehmm_test_cpp.exe ..\HandmadeMath.cpp ..\hmm_test.cpp
-hmm_test_cpp
+clang-cl /std:c17 /Fehmm_test_c17.exe ..\HandmadeMath.c ..\hmm_test.c || exit /b 1
+hmm_test_c17 || exit /b 1
 
-clang-cl /Fehmm_test_cpp_no_sse.exe /DHANDMADE_MATH_NO_SSE ..\HandmadeMath.cpp ..\hmm_test.cpp
-hmm_test_cpp_no_sse
+clang-cl /std:c++14 /Fehmm_test_cpp14.exe ..\HandmadeMath.cpp ..\hmm_test.cpp || exit /b 1
+hmm_test_cpp14 || exit /b 1
+
+clang-cl /std:c++14 /Fehmm_test_cpp14_no_simd.exe /DHANDMADE_MATH_NO_SIMD ..\HandmadeMath.cpp ..\hmm_test.cpp || exit /b 1
+hmm_test_cpp14_no_simd || exit /b 1
+
+clang-cl /std:c++17 /Fehmm_test_cpp17.exe ..\HandmadeMath.cpp ..\hmm_test.cpp || exit /b 1
+hmm_test_cpp17 || exit /b 1
+
+clang-cl /std:c++20 /Fehmm_test_cpp20.exe ..\HandmadeMath.cpp ..\hmm_test.cpp || exit /b 1
+hmm_test_cpp20 || exit /b 1
 
 popd
diff --git a/test/run_test_msvc.bat b/test/run_test_msvc.bat
--- a/test/run_test_msvc.bat
+++ b/test/run_test_msvc.bat
@@ -1,27 +1,32 @@
 @echo off
 
-if "%1%"=="travis" (
-    call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
-) else (
-    where /q cl
-    if ERRORLEVEL 1 (
-        for /f "delims=" %%a in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -find VC\Auxiliary\Build\vcvarsall.bat') do (%%a x64)
-    )
+where /q cl
+if ERRORLEVEL 1 (
+    for /f "delims=" %%a in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -find VC\Auxiliary\Build\vcvarsall.bat') do (%%a x64)
 )
 
 if not exist "build" mkdir build
 pushd build
 
-cl /Fehmm_test_c.exe ..\HandmadeMath.c ..\hmm_test.c
-hmm_test_c
+cl /std:c11 /Fehmm_test_c11.exe ..\HandmadeMath.c ..\hmm_test.c || exit /b 1
+hmm_test_c11 || exit /b 1
 
-cl /Fehmm_test_c_no_sse.exe /DHANDMADE_MATH_NO_SSE ..\HandmadeMath.c ..\hmm_test.c
-hmm_test_c_no_sse
+cl /std:c11 /Fehmm_test_c11_no_simd.exe /DHANDMADE_MATH_NO_SIMD ..\HandmadeMath.c ..\hmm_test.c || exit /b 1
+hmm_test_c11_no_simd || exit /b 1
 
-cl /Fehmm_test_cpp.exe ..\HandmadeMath.cpp ..\hmm_test.cpp
-hmm_test_cpp
+cl /std:c17 /Fehmm_test_c17.exe ..\HandmadeMath.c ..\hmm_test.c || exit /b 1
+hmm_test_c17 || exit /b 1
 
-cl /Fehmm_test_cpp_no_sse.exe /DHANDMADE_MATH_NO_SSE ..\HandmadeMath.cpp ..\hmm_test.cpp
-hmm_test_cpp_no_sse
+cl /std:c++14 /Fehmm_test_cpp14.exe ..\HandmadeMath.cpp ..\hmm_test.cpp || exit /b 1
+hmm_test_cpp14 || exit /b 1
+
+cl /std:c++14 /Fehmm_test_cpp14_no_simd.exe /DHANDMADE_MATH_NO_SIMD ..\HandmadeMath.cpp ..\hmm_test.cpp || exit /b 1
+hmm_test_cpp14_no_simd || exit /b 1
+
+cl /std:c++17 /Fehmm_test_cpp17.exe ..\HandmadeMath.cpp ..\hmm_test.cpp || exit /b 1
+hmm_test_cpp17 || exit /b 1
+
+cl /std:c++20 /Fehmm_test_cpp20.exe ..\HandmadeMath.cpp ..\hmm_test.cpp || exit /b 1
+hmm_test_cpp20 || exit /b 1
 
 popd