# HG changeset patch # User Paper # Date 1695179895 14400 # Node ID 8a4122caaf2fc4dee3a016be52e9d4b56d39f36d # Parent d05b1be2f3a6eb34625b3101c8e433dae6631ff9 *: redefine ARRAYSIZE on platforms that don't include it diff -r d05b1be2f3a6 -r 8a4122caaf2f include/core/array.h --- a/include/core/array.h Tue Sep 19 23:10:49 2023 -0400 +++ b/include/core/array.h Tue Sep 19 23:18:15 2023 -0400 @@ -1,7 +1,9 @@ #ifndef __core__array_h #define __core__array_h +#ifndef ARRAYSIZE #define ARRAYSIZE(x) \ - (x / x[0]) + (sizeof(x) / sizeof(x[0])) +#endif #endif // __core__array_h \ No newline at end of file