Skip to content

Commit 2b4bb33

Browse files
committed
limits.h: prevent GlibC from include_next'ing GCC's limits.h
1 parent 82ab3f1 commit 2b4bb33

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/limits.h

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
#pragma once
44

5+
/* GlibC will try to include_next GCC's limits.h which will fail.
6+
Define _GCC_LIMITS_H_ to prevent it. */
7+
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
8+
#define _GCC_LIMITS_H_
9+
#endif
10+
11+
/* Include the system's limits.h */
512
#if __STDC_HOSTED__ && __has_include_next(<limits.h>)
613
#include_next <limits.h>
714
#endif

0 commit comments

Comments
 (0)