Use remove_i_from_array in a few more places

Also simplify the REMOVER macro
This commit is contained in:
Kovid Goyal
2019-06-07 14:25:33 +05:30
parent 4a55eb9e7f
commit 656916e0fa
4 changed files with 15 additions and 24 deletions

7
glfw/internal.h vendored
View File

@@ -197,11 +197,12 @@ typedef void (APIENTRY * PFN_vkVoidFunction)(void);
#endif
#define remove_i_from_array(array, i, count) { \
count--; \
if (i < count) { \
memmove(array + i, array + i + 1, sizeof(array[0]) * (count - i)); \
(count)--; \
if ((i) < (count)) { \
memmove((array) + (i), (array) + (i) + 1, sizeof((array)[0]) * ((count) - (i))); \
}}
// Constructs a version number string from the public header macros
#define _GLFW_CONCAT_VERSION(m, n, r) #m "." #n "." #r
#define _GLFW_MAKE_VERSION(m, n, r) _GLFW_CONCAT_VERSION(m, n, r)