From 5d7a8127c294e9088817a0d396e299dd9adc9f06 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 10 Sep 2024 19:00:09 +0900 Subject: [PATCH] [qfcc] Add is_handle type check function --- tools/qfcc/include/type.h | 1 + tools/qfcc/source/type.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/tools/qfcc/include/type.h b/tools/qfcc/include/type.h index b4182b310..30aeff685 100644 --- a/tools/qfcc/include/type.h +++ b/tools/qfcc/include/type.h @@ -229,6 +229,7 @@ int is_nonscalar (const type_t *type) __attribute__((pure)); int is_matrix (const type_t *type) __attribute__((pure)); int is_math (const type_t *type) __attribute__((pure)); int is_struct (const type_t *type) __attribute__((pure)); +int is_handle (const type_t *type) __attribute__((pure)); int is_union (const type_t *type) __attribute__((pure)); int is_array (const type_t *type) __attribute__((pure)); int is_structural (const type_t *type) __attribute__((pure)); diff --git a/tools/qfcc/source/type.c b/tools/qfcc/source/type.c index d35744f79..89300882d 100644 --- a/tools/qfcc/source/type.c +++ b/tools/qfcc/source/type.c @@ -1353,6 +1353,15 @@ is_struct (const type_t *type) return 0; } +int +is_handle (const type_t *type) +{ + type = unalias_type (type); + if (type->type == ev_invalid && type->meta == ty_handle) + return 1; + return 0; +} + int is_union (const type_t *type) {