From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web10.3690.1608100184287089808 for ; Tue, 15 Dec 2020 22:29:47 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: zhuenze@byosoft.com.cn) Received: from localhost.localdomain ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Wed, 16 Dec 2020 14:29:39 +0800 X-WM-Sender: zhuenze@byosoft.com.cn From: "Enze Zhu" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen Subject: [PATCH] BaseTools/CommonLib.h: Build failed due to MAX_LONG_FILE_PATH Date: Wed, 16 Dec 2020 14:29:29 +0800 Message-Id: <20201216062929.527-1-zhuenze@byosoft.com.cn> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit We had a build fail due to the hard coded MAX_LONG_FILE_PATH value. We should use PATH_MAX if it is available. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Enze Zhu Reviewed-by: Liming Gao --- BaseTools/Source/C/Common/CommonLib.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BaseTools/Source/C/Common/CommonLib.h b/BaseTools/Source/C/Common/CommonLib.h index e1cce985f7..0f05d88db2 100644 --- a/BaseTools/Source/C/Common/CommonLib.h +++ b/BaseTools/Source/C/Common/CommonLib.h @@ -12,9 +12,17 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#ifndef _WIN32 +#include +#endif + #define PRINTED_GUID_BUFFER_SIZE 37 // including null-termination +#ifdef PATH_MAX +#define MAX_LONG_FILE_PATH PATH_MAX +#else #define MAX_LONG_FILE_PATH 500 +#endif #define MAX_UINT64 ((UINT64)0xFFFFFFFFFFFFFFFFULL) #define MAX_UINT32 ((UINT32)0xFFFFFFFF) -- 2.27.0.windows.1