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. Bruno