From f1288e212ebecfe2b75d51a53590040d8b55d682 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Thu, 16 May 2019 16:05:47 +0800 Subject: [PATCH] Add C99 api(macro) BGFX_HANDLE_IS_VALID --- include/bgfx/c99/bgfx.h | 2 ++ scripts/temp.bgfx.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/bgfx/c99/bgfx.h b/include/bgfx/c99/bgfx.h index 877dd7e64..f0c1bc58d 100644 --- a/include/bgfx/c99/bgfx.h +++ b/include/bgfx/c99/bgfx.h @@ -463,6 +463,8 @@ typedef struct bgfx_vertex_buffer_handle_s { uint16_t idx; } bgfx_vertex_buffer_ typedef struct bgfx_vertex_decl_handle_s { uint16_t idx; } bgfx_vertex_decl_handle_t; +#define BGFX_HANDLE_IS_VALID(h) ((h).idx != UINT16_MAX) + /** * Memory release callback. * diff --git a/scripts/temp.bgfx.h b/scripts/temp.bgfx.h index 995c53096..e1dde4ccf 100644 --- a/scripts/temp.bgfx.h +++ b/scripts/temp.bgfx.h @@ -106,6 +106,8 @@ typedef struct bgfx_callback_vtbl_s $chandles +#define BGFX_HANDLE_IS_VALID(h) ((h).idx != UINT16_MAX) + $cfuncptrs $cstructs