From 4b6b67b08e5c3b4c20ab3c22a292e835b3b27588 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 3 May 2013 16:29:51 +0000 Subject: [PATCH] Allow building clang on older FreeBSD releases, where log2() does not exist yet. With this change, I have verified that building head on 8.1-RELEASE works. Noticed by: Ryan Stone --- lib/clang/include/llvm/Config/config.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/clang/include/llvm/Config/config.h b/lib/clang/include/llvm/Config/config.h index e9dd43c67267..b7462f54d438 100644 --- a/lib/clang/include/llvm/Config/config.h +++ b/lib/clang/include/llvm/Config/config.h @@ -5,6 +5,9 @@ #ifndef CONFIG_H #define CONFIG_H +/* Get __FreeBSD_version. */ +#include + /* Bug report URL. */ #define BUG_REPORT_URL "http://llvm.org/bugs/" @@ -248,7 +251,9 @@ #define HAVE_LOG10 1 /* Define to 1 if you have the `log2' function. */ +#if __FreeBSD_version >= 900027 || (__FreeBSD_version < 900000 && __FreeBSD_version >= 802502) #define HAVE_LOG2 1 +#endif /* Define to 1 if you have the `longjmp' function. */ #define HAVE_LONGJMP 1