shithub: tinygl

Download patch

ref: fd32c75dbf30198c07896341c4717825c8f5a8cd
parent: e6ead58e38cac4293da8643822e6386b3ab61a03
author: MHS <gek@katherine>
date: Sat May 1 11:45:23 EDT 2021

Automatic commit.

--- a/include-demo/3dMath.h
+++ b/include-demo/3dMath.h
@@ -4,14 +4,22 @@
 
 #ifndef CHAD_MATH_H
 #define CHAD_MATH_H
+/* Default behavior- compatibility.
 
+*/
+#ifndef CHAD_MATH_NO_ALIGN
+#define CHAD_MATH_NO_ALIGN
+#endif
+
 #ifdef __TINYC__
 #define CHAD_MATH_NO_ALIGN
 #endif
 
+
 #ifndef CHAD_MATH_NO_ALIGN
 #include <stdalign.h>
 #define CHAD_ALIGN alignas(16)
+#warning "Chad math library compiling with alignas of 16, malloc and realloc MUST return 16-byte-aligned pointers."
 #else
 #define CHAD_ALIGN /*a comment*/
 #endif
--- a/include-demo/tobjparse.h
+++ b/include-demo/tobjparse.h
@@ -10,6 +10,7 @@
 
 #ifndef TOBJ_PARSE_H
 #define TOBJ_PARSE_H
+/*TODO: fix.*/
 #include "3dMath.h"
 #include <stdio.h>
 #include <string.h>
--- a/include/zfeatures.h
+++ b/include/zfeatures.h
@@ -81,7 +81,15 @@
 
 #define TGL_FEATURE_MULTITHREADED_ZB_COPYBUFFER 0
 
-#define TGL_FEATURE_ALIGNAS 1
+/*
+!!!!!WARNING!!!!!
+TGL_FEATURE_ALIGNAS assumes that the implementation's malloc (AND REALLOC) are 16-byte aligned.
+
+Disabled by default for compatibility- you should only enable this if you KNOW that the target ALWAYS
+returns 16-byte aligned pointers.
+*/
+
+#define TGL_FEATURE_ALIGNAS 0
 /*
 Optimization hint- cost of branching.
 0- branching has zero cost, avoid extraneous code.