shithub: tinygl

Download patch

ref: deea003bb85ae4b9549dc465755a8508b9b6c72b
parent: c4285492260419bcb6cebf8c211743b3bc60523a
author: MHS <gek@katherine>
date: Mon Apr 12 19:23:06 EDT 2021

Automatic commit.

--- a/config.mk
+++ b/config.mk
@@ -12,7 +12,7 @@
 
 #extract the maximum possible performance from gcc.
 CFLAGS= -Wall -Ofast -std=c99 -DNDEBUG -fopenmp -mtune=native -Wno-unused-function
-CFLAGS_LIB= -Wall -Ofast -std=c89 -DNDEBUG -fopenmp -mtune=native -Wno-unused-function
+CFLAGS_LIB= -Wall -Ofast -std=c89 -pedantic -DNDEBUG -fopenmp -mtune=native -Wno-unused-function
 #CFLAGS= -Wall -Ofast -std=gnu99 -DNDEBUG -mtune=native
 #uncomment the following line for compiling the lib with tinyc
 #keep these flags for compiling with gcc if you are linking with tinygl compiled with tcc.
--- a/src/init.c
+++ b/src/init.c
@@ -68,22 +68,17 @@
 
 #if TGL_FEATURE_TINYGL_RUNTIME_COMPAT_TEST == 1
 
-#define TGL_RUNT_UNION_CAST(i)                                                                                                                                 \
-	((union {                                                                                                                                                  \
-		GLuint l;                                                                                                                                              \
-		GLint ii;                                                                                                                                              \
-		GLfloat f;                                                                                                                                             \
-	}){i})
 #define TGL_FLOAT_ERR(a, b) ((a - b) / b)
 static int TinyGLRuntimeCompatibilityTest() {
 	GLfloat t = -0, tf2;
 	GLint t2 = 1 << 31;
-	if (TGL_RUNT_UNION_CAST(t2).f != t)
-		return 1;
+	memcpy(&tf2, &t2, 4);
+	if (tf2 != t) return 1;
 	t2 = 3212836864;
 	t = -1;
-	if (TGL_RUNT_UNION_CAST(t2).f != t)
-		return 1;
+	memcpy(&tf2, &t2, 4);
+	if (tf2 != t)return 1;
+	
 	if (((GLint)255 << 8) != 65280)
 		return 1;
 	if ((GLint)65280 >> 8 != 255)
--- a/src/zgl.h
+++ b/src/zgl.h
@@ -444,21 +444,7 @@
 /* specular buffer "api" */
 GLSpecBuf* specbuf_get_buffer(const GLint shininess_i, const GLfloat shininess);
 
-#ifdef __BEOS__
-void dprintf(const char*, ...);
 
-#else /* !BEOS */
-
-#ifdef DEBUG
-
-#define dprintf(format, args...) tgl_warning("In '%s': " format "\n", __FUNCTION__, ##args);
-
-#else
-
-#define dprintf(format, args...)
-
-#endif
-#endif /* !BEOS */
 
 /* glopXXX functions */