Fix undefined HOST_NAME_MAX on Windows.
The Windows build was broken by commit
826ad11e41
which introduced a dependency
on the HOST_NAME_MAX macro, which is not defined on Windows. According
to MSDN for gethostname(), the maximum length of the returned string
is 256 bytes (including the terminating null byte), so let's use that
as a fallback.
This commit is contained in:
parent
0f09260b13
commit
9ad656b512
1 changed files with 5 additions and 0 deletions
|
@ -191,6 +191,11 @@ bool check_id(const char *id) {
|
|||
return true;
|
||||
}
|
||||
|
||||
/* Windows doesn't define HOST_NAME_MAX. */
|
||||
#ifndef HOST_NAME_MAX
|
||||
#define HOST_NAME_MAX 255
|
||||
#endif
|
||||
|
||||
char *replace_name(const char *name) {
|
||||
char *ret_name;
|
||||
|
||||
|
|
Loading…
Reference in a new issue