Common: refactors time formatting to use a shared buffer and utility macro

This commit is contained in:
李通洲
2025-08-19 09:49:43 +08:00
parent 4f88e1f26d
commit ea86273a0e
5 changed files with 34 additions and 23 deletions
+1 -11
View File
@@ -15,6 +15,7 @@
#define __attribute__(x)
#endif
#include "util/arrayUtils.h"
#include "util/FFstrbuf.h"
#include "util/FFlist.h"
#include "util/platform/FFPlatform.h"
@@ -24,17 +25,6 @@
#include "options/display.h"
#include "options/general.h"
#ifdef __has_builtin
#if __has_builtin(__is_array)
#define ARRAY_SIZE(x) ({ static_assert(__is_array(__typeof__(x)), "Must be an array"); (uint32_t) (sizeof(x) / sizeof(*(x))); })
#elif __has_builtin(__builtin_types_compatible_p)
#define ARRAY_SIZE(x) ({ static_assert(!__builtin_types_compatible_p(__typeof__(x), __typeof__(&*(x))), "Must not be a pointer"); (uint32_t) (sizeof(x) / sizeof(*(x))); })
#endif
#endif
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) ((uint32_t) (sizeof(x) / sizeof(*(x))))
#endif
typedef struct FFconfig
{