[libc-commits] [PATCH] D156961: [libc] Add limits.h
Alfred Persson Forsberg via Phabricator via libc-commits
libc-commits at lists.llvm.org
Thu Aug 10 16:17:30 PDT 2023
alfredfo updated this revision to Diff 549195.
alfredfo added a comment.
only define SSIZE_MAX if not already defined
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156961/new/
https://reviews.llvm.org/D156961
Files:
libc/include/llvm-libc-macros/limits-macros.h
libc/spec/posix.td
Index: libc/spec/posix.td
===================================================================
--- libc/spec/posix.td
+++ libc/spec/posix.td
@@ -228,6 +228,7 @@
HeaderSpec Limits = HeaderSpec<
"limits.h",
[
+ Macro<"SSIZE_MAX">,
],
[], // Types
[], // Enumerations
Index: libc/include/llvm-libc-macros/limits-macros.h
===================================================================
--- libc/include/llvm-libc-macros/limits-macros.h
+++ libc/include/llvm-libc-macros/limits-macros.h
@@ -5,12 +5,8 @@
#include <linux/limits.h>
#endif
-#if __LP64__
-#define __LONG_MAX 0x7fffffffffffffffL
-#else
-#define __LONG_MAX 0x7fffffffL
-#endif // __LP64__
-
-#define LONG_MAX __LONG_MAX
+#ifndef SSIZE_MAX
+#define SSIZE_MAX __LONG_MAX__
+#endif
#endif // __LLVM_LIBC_MACROS_LIMITS_MACROS_H
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156961.549195.patch
Type: text/x-patch
Size: 825 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230810/d9acc054/attachment.bin>
More information about the libc-commits
mailing list