From afdc64a717d3b284f920944146952bcbbc111cd0 Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sat, 17 Jan 2015 16:26:20 -0800
Subject: [PATCH 3004/3005] Fix missing long long math prototypes when using
 the Snow Leopard SDK

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
 include/cmath | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git llvm_master/projects/libcxx/include/cmath macports_master/projects/libcxx/include/cmath
index d3aa4be..eb91dfb 100644
--- llvm_master/projects/libcxx/include/cmath
+++ macports_master/projects/libcxx/include/cmath
@@ -301,6 +301,22 @@ long double    truncl(long double x);
 #include <math.h>
 #include <type_traits>
 
+#ifdef __APPLE__
+#include <Availability.h>
+#if __MAC_OS_X_VERSION_MAX_ALLOWED < 1070
+/* These prototypes are incorrectly omitted from <math.h> on Snow Leopard despite being available */
+extern "C" {
+    extern long long int llrintl(long double);
+    extern long long int llrint(double);
+    extern long long int llrintf(float);
+
+    extern long long int llroundl(long double);
+    extern long long int llround(double);
+    extern long long int llroundf(float);
+}
+#endif
+#endif // __APPLE__
+
 #ifdef _LIBCPP_MSVCRT
 #include "support/win32/math_win32.h"
 #endif
-- 
2.2.2

