Introduce ARRAY_SIZE macro
See if you find that (or a variation of it) worthwhile. This macro name is pretty widely used these days. There are better (much more complicated) implementations that also make sure that the argument is an actual array, but this is the bare minimum version.
Hi. I just learned of this project moments ago, so this is a bit of a flyby comment, but...
ARRAY_SIZE is an extremely common name, with approximately this same definition - and the same problems. GitHub has about 96,000 defintions in various projects.
https://github.com/search?q=%22define+ARRAY_SIZE%22&type=code
by comparison, "only" 8,000 files call it ARRAY_LENGTH
https://github.com/search?q=%22define+ARRAY_LENGTH%22&type=code
That doesn't make it perfect, and it may not be right for this project. I'm just saying that it IS a popular spelling. (Duly noted that these counts aren't perfect, but they do reflect common mindshare. When an experienced programmer sees that, they know what it is, just like when they see anything from ISO C.
In fact, in the official C spec https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf, this is the definition, albeit not the name, given in 6.5.3.4.6 on page 90. I've seen lengthof and countof, so your proposal would still "click" for me. Keeping it "LPRINT_COUNTOF" would be one way to keep it in your own namespace in case you include a system header with polluted namespace. While technically allowable, in practice, this symbol is so widespread that if a system did it, the world would burst into flames. It would be like stdio declaring a function named "i" or something.
Microsoft provides a _countof in their stdlib. That is, of course, in C implementation-reserved namespace and they're free to change or drop that definition at any time. I'd imagine they won't. I wouldn't use that in a cross-platform project like this. I'm just offering that it's a thing. Even C++ didn't bless their version of this consistently until C++17.
I struggled with this in my own open source software years ago.
So take it or don't take it, but I'd say that ARRAY_SIZE is the settled consensus for the name. If you wanted to go LPRINT_ARRAY_SIZE in an attempt to keep it in your own namespace, that would communicate it fine, too. The original code is so clear that this doesn't bother my personally either way. (Not that anybody asked. :-) )
I'll probably become a user of the sii driver for my SLP 450 when I come back to that project next week or so, so thank you in advance for keeping that from the e-waste ewaste pile since Seiko can't maintain their own stinking macOS drivers.