Index: boost/atomic/atomic.hpp
===================================================================
--- a/boost/atomic/atomic.hpp	(revision 84804)
+++ b/boost/atomic/atomic.hpp	(revision 84805)
@@ -196,27 +196,11 @@
 typedef atomic<std::size_t> atomic_size_t;
 typedef atomic<std::ptrdiff_t> atomic_ptrdiff_t;
 
-// PGI seems to not support intptr_t/uintptr_t properly. BOOST_HAS_STDINT_H is not defined for this compiler by Boost.Config.
-#if !defined(__PGIC__)
-
-#if (defined(BOOST_WINDOWS) && !defined(_WIN32_WCE)) \
-    || (defined(_XOPEN_UNIX) && (_XOPEN_UNIX+0 > 0) && !defined(__UCLIBC__)) \
-    || defined(__CYGWIN__) \
-    || defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) \
-    || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+#if defined(BOOST_HAS_INTPTR_T)
 typedef atomic<intptr_t> atomic_intptr_t;
 typedef atomic<uintptr_t> atomic_uintptr_t;
-#elif defined(__GNUC__) || defined(__clang__)
-#if defined(__INTPTR_TYPE__)
-typedef atomic< __INTPTR_TYPE__ > atomic_intptr_t;
 #endif
-#if defined(__UINTPTR_TYPE__)
-typedef atomic< __UINTPTR_TYPE__ > atomic_uintptr_t;
-#endif
-#endif
 
-#endif
-
 #ifndef BOOST_ATOMIC_FLAG_LOCK_FREE
 #define BOOST_ATOMIC_FLAG_LOCK_FREE 0
 class atomic_flag
Index: boost/cstdint.hpp
===================================================================
--- a/boost/cstdint.hpp	(revision 84804)
+++ b/boost/cstdint.hpp	(revision 84805)
@@ -358,6 +358,40 @@
 
 #endif // BOOST_HAS_STDINT_H
 
+// intptr_t/uintptr_t are defined separately because they are optional and not universally available
+#if defined(BOOST_WINDOWS) && !defined(_WIN32_WCE) && !defined(BOOST_HAS_STDINT_H)
+// Older MSVC don't have stdint.h and have intptr_t/uintptr_t defined in stddef.h
+#include <stddef.h>
+#endif
+
+// PGI seems to not support intptr_t/uintptr_t properly. BOOST_HAS_STDINT_H is not defined for this compiler by Boost.Config.
+#if !defined(__PGIC__)
+
+#if (defined(BOOST_WINDOWS) && !defined(_WIN32_WCE)) \
+    || (defined(_XOPEN_UNIX) && (_XOPEN_UNIX+0 > 0) && !defined(__UCLIBC__)) \
+    || defined(__CYGWIN__) \
+    || defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) \
+    || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+
+namespace boost {
+    using ::intptr_t;
+    using ::uintptr_t;
+}
+#define BOOST_HAS_INTPTR_T
+
+// Clang pretends to be GCC, so it'll match this condition
+#elif defined(__GNUC__) && defined(__INTPTR_TYPE__) && defined(__UINTPTR_TYPE__)
+
+namespace boost {
+    typedef __INTPTR_TYPE__ intptr_t;
+    typedef __UINTPTR_TYPE__ uintptr_t;
+}
+#define BOOST_HAS_INTPTR_T
+
+#endif
+
+#endif // !defined(__PGIC__)
+
 #endif // BOOST_CSTDINT_HPP
 
 
--- a/boost/cstdint.hpp	2013-09-21 17:09:15.557769647 +0200
+++ b/boost/cstdint.hpp	2013-09-21 16:29:21.365226785 +0200
@@ -41,7 +41,10 @@
 // so we disable use of stdint.h when GLIBC does not define __GLIBC_HAVE_LONG_LONG.
 // See https://svn.boost.org/trac/boost/ticket/3548 and http://sources.redhat.com/bugzilla/show_bug.cgi?id=10990
 //
-#if defined(BOOST_HAS_STDINT_H) && (!defined(__GLIBC__) || defined(__GLIBC_HAVE_LONG_LONG))
+#if defined(BOOST_HAS_STDINT_H)					\
+  && (!defined(__GLIBC__)					\
+      || defined(__GLIBC_HAVE_LONG_LONG)			\
+      || (defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 17)))))
 
 // The following #include is an implementation artifact; not part of interface.
 # ifdef __hpux
