Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib/atoi/a2i.[ch]: Add const-generic macros
These overloaded macros allow passing either a const or a non-const endp, and will call the appropriate function. This kind of const overloading has prior art in C23's string functions, such as memchr(3). Martin suggested using an artificial function pointer in _Generic(3); it allows switching on various types at the same time. Also add a comment referring to liba2i's PDF manual for documentation. Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf#subsubsection.7.26.5.2> Link: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114731> Link: <http:https://www.alejandro-colomar.es/share/dist/liba2i/git/HEAD/liba2i-HEAD.pdf> Co-developed-by: Martin Uecker <[email protected]> Signed-off-by: Alejandro Colomar <[email protected]>
- Loading branch information