Commit 5e8b6ed5 authored by Chad Versace's avatar Chad Versace

core: Define intptr_t variants of wcore_attrib_list functions

When designing the original Waffle 1.0 API, I made a mistake when
I chose to declare attribute lists as arrays of int32_t. Instead, they
should have been arrays of intptr_t.

A new public function, waffle_window_create2, will have a `const
intptr_t attrib_list[]` parameter. Therefore waffle needs intptr_t
variants of the wcore_attrib_list functions.
Signed-off-by: default avatarChad Versace <chad.versace@intel.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com> (msvc/wgl)
Reviewed-by: Emil Velikov's avatarEmil Velikov <emil.l.velikov@gmail.com>
parent abc8fbf5
...@@ -113,3 +113,9 @@ WCORE_ATTRIB_LIST_COMMON_FUNCS(int32_t, ...@@ -113,3 +113,9 @@ WCORE_ATTRIB_LIST_COMMON_FUNCS(int32_t,
wcore_attrib_list32_get, wcore_attrib_list32_get,
wcore_attrib_list32_get_with_default, wcore_attrib_list32_get_with_default,
wcore_attrib_list32_update) wcore_attrib_list32_update)
WCORE_ATTRIB_LIST_COMMON_FUNCS(intptr_t,
wcore_attrib_list_length,
wcore_attrib_list_get,
wcore_attrib_list_get_with_default,
wcore_attrib_list_update)
...@@ -28,6 +28,29 @@ ...@@ -28,6 +28,29 @@
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h>
size_t
wcore_attrib_list_length(const intptr_t attrib_list[]);
bool
wcore_attrib_list_get(
const intptr_t *attrib_list,
intptr_t key,
intptr_t *value);
bool
wcore_attrib_list_get_with_default(
const intptr_t attrib_list[],
intptr_t key,
intptr_t *value,
intptr_t default_value);
bool
wcore_attrib_list_update(
intptr_t *attrib_list,
intptr_t key,
intptr_t value);
size_t size_t
wcore_attrib_list32_length(const int32_t attrib_list[]); wcore_attrib_list32_length(const int32_t attrib_list[]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment