Skip to content

Commit 3a92b20

Browse files
authored
[libc] Add backup definition for LONG_WIDTH in limits-macros.h. (#79375)
1 parent ce21721 commit 3a92b20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libc/include/llvm-libc-macros/limits-macros.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
#elif defined(__WORDSIZE)
7171
#define LONG_WIDTH __WORDSIZE
7272
#else
73-
#error "Unknown WORDSIZE to define LONG_WIDTH."
73+
// Use sizeof(long) * CHAR_BIT as backup. This is needed for clang-13 or before.
74+
#define LONG_WIDTH (sizeof(long) * CHAR_BIT)
7475
#endif // __LONG_WIDTH__
7576
#endif // LONG_WIDTH
7677

0 commit comments

Comments
 (0)