Commits


Geoffrey Martin-Noble authored and Dominic Hamon committed 7411874d956
Define HOST_NAME_MAX for NaCl and RTEMS (#876) These OS's don't always have HOST_NAME_MAX defined, resulting in build errors. A few related changes as well: * Only define HOST_NAME_MAX if it's not already defined. There are some cases where this is already defined, e.g. with NaCl if __USE_POSIX is set. To avoid all of these, only define it if it's not already defined. * Default HOST_NAME_MAX to 64 and issue a #warning. Having the wrong max length is pretty harmless. The name just ends up getting truncated and this is only for printing debug info. Because we're constructing a std::string from a char[] (so defined length), we don't need to worry about gethostname's undefined behavior for whether the truncation is null-terminated when the hostname doesn't fit in HOST_NAME_MAX. Of course, this doesn't help people who have -Werror set, since they'll still get a warning.