Skip to content

Commit 359304c

Browse files
committed
Error out when LIBC_ERRNO_MODE is set to something different from LIBC_ERRNO_MODE_SYSTEM_INLINE in shared/libc_common.h
1 parent 97e3121 commit 359304c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libc/shared/libc_common.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@
1010
#define LLVM_LIBC_SHARED_LIBC_COMMON_H
1111

1212
// Use system errno.
13-
#undef LIBC_ERRNO_MODE
13+
#ifdef LIBC_ERRNO_MODE
14+
#if LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SYSTEM_INLINE
15+
#error \
16+
"LIBC_ERRNO_MODE was set to something different from LIBC_ERRNO_MODE_SYSTEM_INLINE."
17+
#endif // LIBC_ERRNO_MODE != LIBC_ERRNO_MODE_SYSTEM_INLINE
18+
#else
1419
#define LIBC_ERRNO_MODE LIBC_ERRNO_MODE_SYSTEM_INLINE
20+
#endif // LIBC_ERRNO_MODE
1521

1622
#ifndef LIBC_NAMESPACE
1723
#define LIBC_NAMESPACE __llvm_libc

0 commit comments

Comments
 (0)