commit fad3441ba9cd67fb34b6a5e28b3161c075c0b14f from: Omar Polo date: Sun Oct 30 07:30:23 2022 UTC work around missing LOGIN_NAME_MAX Both Linux and OpenBSD have LOGIN_NAME_MAX available when including limits.h, FreeBSD, Darwin and possibly others don't. FreeBSD (and maybe Darwin) have MAXLOGNAME, so try to use that if available. Otherwise use _POSIX_LOGIN_NAME_MAX, but only has a fallback since it has a lower value (9 at the time of writing). If everything fails, use 32 which is what OpenBSD use by default; OpenSMTPd also defaults to it. (compat copied from kamid.) commit - 50a8f9107c1e3cf94a2c9e548d55cd5349e5434f commit + fad3441ba9cd67fb34b6a5e28b3161c075c0b14f blob - 1e179aeede1e962fe30c8fc3b09538b6a033655b blob + c0d10271c63c76e9dced4a8fd13afd7268055ce0 --- configure +++ configure @@ -319,6 +319,7 @@ echo "#include " echo "#include " echo "#include " echo "#include " +echo "#include " cat <<__HEREDOC__ @@ -422,6 +423,17 @@ cat <<__HEREDOC__ #ifndef __dead #define __dead __attribute__((noreturn)) +#endif + +/* Linux and OpenBSD have LOGIN_NAME_MAX, FreeBSD MAXLOGNAME. */ +#ifndef LOGIN_NAME_MAX +# if defined(MAXLOGNAME) +# define LOGIN_NAME_MAX MAXLOGNAME +# elif defined(_POSIX_LOGIN_NAME_MAX) +# define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX +# else +# define LOGIN_NAME_MAX 32 +# endif #endif __HEREDOC__