diff options
author | Enze Zhu <zhuenze@byosoft.com.cn> | 2020-12-17 10:19:52 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-01-06 04:01:12 +0000 |
commit | 020ec963048340c9eaf9799471167d769239bcfc (patch) | |
tree | c7f4597b43bb42973d2e869f83f236650e22ded1 /BaseTools/Source/C | |
parent | 21e1dc286e799830bb159e3afc6f1be71a3c382a (diff) | |
download | edk2-020ec963048340c9eaf9799471167d769239bcfc.tar.gz |
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 <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>
Diffstat (limited to 'BaseTools/Source/C')
-rw-r--r-- | BaseTools/Source/C/Common/CommonLib.h | 8 |
1 files changed, 8 insertions, 0 deletions
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 <Common/UefiBaseTypes.h>
#include <Common/BuildVersion.h>
#include <assert.h>
+#ifndef _WIN32
+#include <limits.h>
+#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)
|