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.web12.2223.1608171605250716974 for ; Wed, 16 Dec 2020 18:20:05 -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 ; Thu, 17 Dec 2020 10:20:00 +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: Thu, 17 Dec 2020 10:19:52 +0800 Message-Id: <20201217021952.1937-1-zhuenze@byosoft.com.cn> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3032 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 --- 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