diff options
| author | fig02 <fig02srl@gmail.com> | 2025-04-26 18:17:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-26 18:17:02 -0400 |
| commit | bed76a3bf3cd89456e3331b2c2b50dbc5f79fe48 (patch) | |
| tree | 49f4c9741975a6c68d8cb6dbb7902e6a6d3d428d /include | |
| parent | 25b2fa4bca1f1d2d155db2610191af1075e813b3 (diff) | |
add array_count.h (#2514)
Diffstat (limited to 'include')
| -rw-r--r-- | include/array_count.h | 8 | ||||
| -rw-r--r-- | include/macros.h | 4 | ||||
| -rw-r--r-- | include/z64.h | 1 |
3 files changed, 9 insertions, 4 deletions
diff --git a/include/array_count.h b/include/array_count.h new file mode 100644 index 000000000..9e5f6ed4c --- /dev/null +++ b/include/array_count.h @@ -0,0 +1,8 @@ +#ifndef ARRAY_COUNT_H +#define ARRAY_COUNT_H + +#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) +#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0])) +#define ARRAY_COUNT_2D(arr) (s32)(sizeof(arr) / sizeof(arr[0][0])) + +#endif diff --git a/include/macros.h b/include/macros.h index 7c964150e..98efe590c 100644 --- a/include/macros.h +++ b/include/macros.h @@ -1,10 +1,6 @@ #ifndef MACROS_H #define MACROS_H -#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) -#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0])) -#define ARRAY_COUNT_2D(arr) (s32)(sizeof(arr) / sizeof(arr[0][0])) - #define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask)) #endif diff --git a/include/z64.h b/include/z64.h index 8a259e70f..bb2518e6e 100644 --- a/include/z64.h +++ b/include/z64.h @@ -4,6 +4,7 @@ // TODO: This file still exists ONLY to provide neccesary headers to extracted assets. // After assets are modified to include the headers they need directly, delete this file. +#include "array_count.h" #include "gfx.h" #include "sequence.h" #include "sys_matrix.h" |
