From f17b8de907258274c0942568c414810410b970f6 Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Thu, 7 Mar 2024 15:22:08 +0900 Subject: [PATCH 1/2] fallback to _POSIX_HOST_NAME_MAX if HOST_NAME_MAX is not defined --- Grid/util/Init.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Grid/util/Init.cc b/Grid/util/Init.cc index 9a0b4376..363d9ef4 100644 --- a/Grid/util/Init.cc +++ b/Grid/util/Init.cc @@ -77,6 +77,10 @@ feenableexcept (unsigned int excepts) } #endif +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX +#endif + NAMESPACE_BEGIN(Grid); ////////////////////////////////////////////////////// From 2b4399f8b1a76ea38702b7c95276328b0a1a785d Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Thu, 7 Mar 2024 15:26:01 +0900 Subject: [PATCH 2/2] more HOST_NAME_MAX fix --- tests/Test_dwf_mixedcg_prec.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/Test_dwf_mixedcg_prec.cc b/tests/Test_dwf_mixedcg_prec.cc index 13cc0bb6..e8d36b7f 100644 --- a/tests/Test_dwf_mixedcg_prec.cc +++ b/tests/Test_dwf_mixedcg_prec.cc @@ -30,6 +30,10 @@ Author: Peter Boyle using namespace std; using namespace Grid; +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX +#endif + int main (int argc, char ** argv) { char hostname[HOST_NAME_MAX+1];