So okay. Should we for this approach number 1:
typedef GLfloat GLMvec2f[2];
typedef GLfloat GLMmat4f[16];
void glmVecSet2f(GLMvec2f out, GLfloat x, GLfloat y);
void glmVecAdd2f(GLMvec2f out, const GLMve2f v1, const GLMvec2f v2);
GLMvec2f a, b, c;
glmVecSet2f(a, 1.0f, 1.0f);
glmVecSet2f(b, 2.0f, 2.0f);
glmVecAdd2f(c, a, b);
GLMmat4f mat;
glmMatIdentity4f(mat);
glLoadMatrixf(mat);
Or the approac number 2:
typedef struct { GLfloat x, y; } GLMvec2f;
typedef struct { GLfloat m[16]; } GLMmat4f;
GLMvec2f *glmVecSet2f(GLMvec2f *out, GLfloat x, GLfloat y);
GLMvec2f *glmVecAdd2f(GLMvec2f *out, const GLMve2f *v1, const GLMvec2f *v2);
GLMvec2f a, b, c;
glmVecAdd2f(&c, glmVecSet2f(&a, 1.0f, 1.0f), glmVecSet2f(&b, 2.0f, 2.0f);
a.x = 1.0f;
a.y = 2.0f;
GLMmat4f mat;
glmMatIdentity4f(&mat);
glLoadMatrixf(mat.m);
As a sidenote, they used approach number 2 in DirectX mathlib.
There are pros and cons. The struct approac allows functions to be chained, but array approach allows data to be passed for OpenGL functions directly.
Edit: The use of structs may also be more streamlined if we are going to make other libraries as well (which may need complex data structures as structs).
Edit: My personal choice would be the struct way.