Fix limits.h for linux, as glibc does a #include_next unless

_GCC_LIMITS_H_ is defined, when __GNUC__ is defined.

Also, we need to stay away from possible conflicts with header guards.
We should use CLANG_ to prefix all header guards.

llvm-svn: 64408
This commit is contained in:
Mike Stump 2009-02-12 23:06:31 +00:00
parent eb6be650ce
commit 6b63074de9
2 changed files with 12 additions and 3 deletions

View File

@ -22,8 +22,14 @@
*
\*===----------------------------------------------------------------------===*/
#ifndef __LIMITS_H
#define __LIMITS_H
#ifndef __CLANG_LIMITS_H
#define __CLANG_LIMITS_H
/* The system's limits.h may, in turn, try to #include_next GCC's limits.h.
Avert this #include_next madness. */
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
#define _GCC_LIMITS_H_
#endif
/* System headers include a number of constants from POSIX in <limits.h>. */
#include_next <limits.h>
@ -90,4 +96,4 @@
#define ULLONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL)
#endif
#endif /* __LIMITS_H */
#endif /* __CLANG_LIMITS_H */

View File

@ -0,0 +1,3 @@
// RUN: clang -E %s
#include <limits.h>