From f2c926f3b6b9a0d62fa787ea003ade1ef5f45d71 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Nov 2018 11:12:03 +0100 Subject: [PATCH] zeroconf/glue: add fallback value for HOST_NAME_MAX `HOST_NAME_MAX` is not a portable macro; it is undefined on some systems. Closes #402 --- src/zeroconf/ZeroconfGlue.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/zeroconf/ZeroconfGlue.cxx b/src/zeroconf/ZeroconfGlue.cxx index 2514e6b86..a6c9bf6fa 100644 --- a/src/zeroconf/ZeroconfGlue.cxx +++ b/src/zeroconf/ZeroconfGlue.cxx @@ -32,6 +32,12 @@ #include #include +#ifndef HOST_NAME_MAX +/* HOST_NAME_MAX is not a portable macro; it is undefined on some + systems */ +#define HOST_NAME_MAX 255 +#endif + static constexpr Domain zeroconf_domain("zeroconf"); /* The default service name to publish