Compare commits

...

4 Commits

Author SHA1 Message Date
Recep Aslantas
f8784ffe8a win: enable anonymous structs for Visual Studio 2015 and later 2020-01-17 23:55:35 +03:00
Recep Aslantas
cf8dc82783 fix tests on windows (msvc) 2020-01-17 23:29:36 +03:00
Recep Aslantas
9af0ebd142 win: fix glms_quat_imagn if use struct option is disabled 2020-01-17 23:27:20 +03:00
Recep Aslantas
82a195f26a now owrkin on v0.6.2 2020-01-17 23:26:40 +03:00
9 changed files with 31 additions and 32 deletions

View File

@@ -7,7 +7,7 @@
#*****************************************************************************
AC_PREREQ([2.69])
AC_INIT([cglm], [0.6.1], [info@recp.me])
AC_INIT([cglm], [0.6.2], [info@recp.me])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects serial-tests])
# Don't use the default cflags (-O2 -g), we set ours manually in Makefile.am.

View File

@@ -62,9 +62,9 @@ author = u'Recep Aslantas'
# built documents.
#
# The short X.Y version.
version = u'0.6.1'
version = u'0.6.2'
# The full version, including alpha/beta/rc tags.
release = u'0.6.1'
release = u'0.6.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@@ -251,7 +251,7 @@ CGLM_INLINE
vec3s
glms_quat_imagn(versors q) {
vec3s dest;
glm_normalize_to(q.imag.raw, dest.raw);
glm_normalize_to(q.raw, dest.raw);
return dest;
}

View File

@@ -18,22 +18,26 @@
* compatible, cglm doesn't use the anonymous structs internally.
*/
#ifndef CGLM_USE_ANONYMOUS_STRUCT
/* If the user doesn't explicitly specify if they want anonymous structs or
* not, then we'll try to intuit an appropriate choice. */
# if defined(CGLM_NO_ANONYMOUS_STRUCT)
/* The user has defined CGLM_NO_ANONYMOUS_STRUCT. This used to be the
* only #define governing the use of anonymous structs, so for backward
* compatibility, we still honor that choice and disable them. */
# define CGLM_USE_ANONYMOUS_STRUCT 0
# elif __STDC_VERSION__ >= 20112L || defined(_MSVC_VER)
/* We're compiling for C11 or this is the MSVC compiler. In either
* case, anonymous structs are available, so use them. */
# define CGLM_USE_ANONYMOUS_STRUCT 1
# else
/* Otherwise, we're presumably building for C99 or C89 and can't rely
* on anonymous structs being available. Turn them off. */
# define CGLM_USE_ANONYMOUS_STRUCT 0
# endif
/* If the user doesn't explicitly specify if they want anonymous structs or
* not, then we'll try to intuit an appropriate choice. */
# if defined(CGLM_NO_ANONYMOUS_STRUCT)
/* The user has defined CGLM_NO_ANONYMOUS_STRUCT. This used to be the
* only #define governing the use of anonymous structs, so for backward
* compatibility, we still honor that choice and disable them. */
# define CGLM_USE_ANONYMOUS_STRUCT 0
# elif __STDC_VERSION__ >= 20112L || defined(_MSVC_VER)
/* We're compiling for C11 or this is the MSVC compiler. In either
* case, anonymous structs are available, so use them. */
# define CGLM_USE_ANONYMOUS_STRUCT 1
# elif defined(_MSC_VER) && (_MSC_VER >= 1900) /* Visual Studio 2015 */
/* We can support anonymous structs
* since Visual Studio 2015 or 2017 (1910) maybe? */
# define CGLM_USE_ANONYMOUS_STRUCT 1
# else
/* Otherwise, we're presumably building for C99 or C89 and can't rely
* on anonymous structs being available. Turn them off. */
# define CGLM_USE_ANONYMOUS_STRUCT 0
# endif
#endif
typedef union vec2s {

View File

@@ -10,6 +10,6 @@
#define CGLM_VERSION_MAJOR 0
#define CGLM_VERSION_MINOR 6
#define CGLM_VERSION_PATCH 1
#define CGLM_VERSION_PATCH 2
#endif /* cglm_version_h */

View File

@@ -25,6 +25,8 @@ main(int argc, const char * argv[]) {
fprintf(stderr, CYAN "\nWelcome to cglm tests\n\n" RESET);
srand((unsigned int)time(NULL));
for (i = 0; i < count; i++) {
int32_t len;

View File

@@ -9,8 +9,6 @@
void
test_rand_mat4(mat4 dest) {
glm_mat4_copy(GLM_MAT4_IDENTITY, dest);
srand((unsigned int)time(NULL));
/* random position */
dest[3][0] = drand48();
@@ -28,8 +26,6 @@ void
test_rand_mat3(mat3 dest) {
mat4 m4;
srand((unsigned int)time(NULL));
/* random rotatation around random axis with random angle */
glm_rotate_make(m4, drand48(), (vec3){drand48(), drand48(), drand48()});
glm_mat4_pick3(m4, dest);
@@ -37,8 +33,6 @@ test_rand_mat3(mat3 dest) {
void
test_rand_vec3(vec3 dest) {
srand((unsigned int)time(NULL));
dest[0] = drand48();
dest[1] = drand48();
dest[2] = drand48();
@@ -53,8 +47,6 @@ test_rand_vec3s() {
void
test_rand_vec4(vec4 dest) {
srand((unsigned int)time(NULL));
dest[0] = drand48();
dest[1] = drand48();
dest[2] = drand48();
@@ -70,14 +62,11 @@ test_rand_vec4s() {
float
test_rand(void) {
srand((unsigned int)time(NULL));
return drand48();
}
void
test_rand_quat(versor q) {
srand((unsigned int)time(NULL));
glm_quat(q, drand48(), drand48(), drand48(), drand48());
glm_quat_normalize(q);
}

View File

@@ -30,6 +30,7 @@
<ClCompile Include="..\test\src\test_mat4.c" />
<ClCompile Include="..\test\src\test_project.c" />
<ClCompile Include="..\test\src\test_quat.c" />
<ClCompile Include="..\test\src\test_struct.c" />
<ClCompile Include="..\test\src\test_vec3.c" />
<ClCompile Include="..\test\src\test_vec4.c" />
</ItemGroup>

View File

@@ -50,6 +50,9 @@
<ClCompile Include="..\test\src\test_vec4.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\test\src\test_struct.c">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\test\tests.h">