[cfe-commits] r68169 - /cfe/trunk/lib/Headers/limits.h

Chris Lattner sabre at nondot.org
Tue Mar 31 17:44:37 PDT 2009


Author: lattner
Date: Tue Mar 31 19:44:37 2009
New Revision: 68169

URL: http://llvm.org/viewvc/llvm-project?rev=68169&view=rev
Log:
add support for the LONG_LONG_MIN/LONG_LONG_MAX/ULONG_LONG_MAX limits.h GNU extensions.
rdar://6740292

Modified:
    cfe/trunk/lib/Headers/limits.h

Modified: cfe/trunk/lib/Headers/limits.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/limits.h?rev=68169&r1=68168&r2=68169&view=diff

==============================================================================
--- cfe/trunk/lib/Headers/limits.h (original)
+++ cfe/trunk/lib/Headers/limits.h Tue Mar 31 19:44:37 2009
@@ -96,4 +96,19 @@
 #define ULLONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL)
 #endif
 
+/* LONG_LONG_MIN/LONG_LONG_MAX/ULONG_LONG_MAX are a GNU extension.  It's too bad
+   that we don't have something like #pragma poison that could be used to
+   deprecate a macro - the code should just use LLONG_MAX and friends.
+ */
+#if defined(__GNU_LIBRARY__) ? defined(__USE_GNU) : !defined(__STRICT_ANSI__)
+
+#undef   LONG_LONG_MIN
+#undef   LONG_LONG_MAX
+#undef   ULONG_LONG_MAX
+
+#define LONG_LONG_MAX  __LONG_LONG_MAX__
+#define LONG_LONG_MIN  (-__LONG_LONG_MAX__-1LL)
+#define ULONG_LONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL)
+#endif
+
 #endif /* __CLANG_LIMITS_H */





More information about the cfe-commits mailing list