]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/CommonLib.h: Build failed due to MAX_LONG_FILE_PATH
authorEnze Zhu <zhuenze@byosoft.com.cn>
Thu, 17 Dec 2020 02:19:52 +0000 (10:19 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 6 Jan 2021 04:01:12 +0000 (04:01 +0000)
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 <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Enze Zhu <zhuenze@byosoft.com.cn>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/C/Common/CommonLib.h

index e1cce985f7f931efc13b3b31b138c8da50abd5b6..0f05d88db206ad7405ee1c552a8db4a0642ef60a 100644 (file)
@@ -12,9 +12,17 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Common/UefiBaseTypes.h>\r
 #include <Common/BuildVersion.h>\r
 #include <assert.h>\r
+#ifndef _WIN32\r
+#include <limits.h>\r
+#endif\r
+\r
 #define PRINTED_GUID_BUFFER_SIZE  37  // including null-termination\r
 \r
+#ifdef PATH_MAX\r
+#define MAX_LONG_FILE_PATH PATH_MAX\r
+#else\r
 #define MAX_LONG_FILE_PATH 500\r
+#endif\r
 \r
 #define MAX_UINT64 ((UINT64)0xFFFFFFFFFFFFFFFFULL)\r
 #define MAX_UINT32 ((UINT32)0xFFFFFFFF)\r