Bruno Haible <[EMAIL PROTECTED]> writes: > Simon Josefsson wrote: >> I'd prefer to solve it by having m4 code check whether >> the non-portable code works or not, and then AC_SUBST in the proper >> replacement function, either getline-fast.c or getline-slow.c. This >> allows a gnulib module 'getline-slow' for when people prefer a small and >> simple implementation over a faster but more complex. > > Even in this scenario, I would prefer a constant conditional that chooses > among two implementation. This allows to keep common parts of the two > implementations in one place, and guarantees that the unused code is > still syntactically checked by the compiler - guarding against bitrot.
Yes, that's a good idea. Possibly it could be done with #include's of *.c files, in order to retain the functions in different files. /Simon