From 020ec963048340c9eaf9799471167d769239bcfc Mon Sep 17 00:00:00 2001 From: Enze Zhu Date: Thu, 17 Dec 2020 10:19:52 +0800 Subject: BaseTools/CommonLib.h: Build failed due to MAX_LONG_FILE_PATH 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 Reviewed-by: Liming Gao Reviewed-by: Bob Feng --- 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 e1cce98..0f05d88 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) -- cgit v1.1