Eric Blake wrote: > > Why not use this instead? > > > > #define c_isalpha(c) (((unsigned int) (c) | ('a' - 'A')) - 'a' <= 'z' - > > 'a') > > This is a slick definition, but it is different than what c-ctype.h > provided, and that definition was not guarded. Bruno, would you accept > the following patch to c-ctype, so that the order between "c-ctype.h" and > my patched "dirname.h" won't matter? > (c_isalpha) [C_CTYPE_ASCII]: Guard against redefinition.
No, I don't think that would be good: It's not dirname.h's job to define macros for testing character properties. dirname.h should only export things related to filenames and pathnames. Any other macro in it should be made private, i.e. renamed to something like _DIRNAME_ISALPHA or so, so that it is clear that it is not meant to be used for other purposes. > An alternative to editing c-ctype is naming the dirname.h version > IS_DRIVE_LETTER instead of c_isalpha. Yes, this is much better. Also it reflects more closely what the macro is used for. Bruno _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib