#ifndef GLOAM_IMPL_UTIL_C_
#define GLOAM_IMPL_UTIL_C_
/* MSVC vs GCC/Clang sscanf */
#ifdef _MSC_VER
# define GLOAM_IMPL_UTIL_SSCANF sscanf_s
#else
# define GLOAM_IMPL_UTIL_SSCANF sscanf
#endif
/* GLOAM_NO_INLINE — suppress inlining on functions that should stay out of
the hot path (sort, hash, etc.) to avoid code bloat at call sites. */
#ifdef _MSC_VER
# define GLOAM_NO_INLINE __declspec(noinline)
#else
# define GLOAM_NO_INLINE __attribute__((noinline))
#endif
#define GLOAM_ARRAYSIZE(x) (sizeof(x) / sizeof((x)[0]))
#define GLOAM_UNUSED(x) ((void)(x))
/* Opaque function pointer type — the common return type for all load
callbacks. Callers cast to the specific PFN type they need. */
typedef void (*GloamAPIProc)(void);
/* Load function pointer type: plain proc-addr callback (GL / EGL / GLX / WGL). */
typedef GloamAPIProc (*GloamLoadFunc)(const char *name);
/* Contiguous run of pfnArray slots belonging to one feature or extension.
Used by the range-based PFN loading loop. */
typedef struct {
uint16_t extension; /* index into featArray or extArray */
uint16_t start; /* first pfnArray index in this run */
uint16_t count; /* number of consecutive slots */
} GloamPfnRange_t;
{% if alias -%}
/* Bijective alias pair: if canonical slot is null but secondary is loaded
(or vice versa), the loaded pointer is propagated to both slots. */
typedef struct {
uint16_t first; /* canonical (shortest name) pfnArray index */
uint16_t second; /* alias pfnArray index */
} GloamAliasPair_t;
{% endif -%}
#endif /* GLOAM_IMPL_UTIL_C_ */