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) {