Skip to content

Commit

Permalink
Include stddef.h before including cxxabi.h
Browse files Browse the repository at this point in the history
On FreeBSD 10.0, size_t needs to be defined before including cxxabi.h.
Currenty HAVE_CXXABI_H is not defined on FreeBSD because of that reason.
This patch teaches cmake and configure how to include it.

http://reviews.llvm.org/D5940



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220665 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
rui314 committed Oct 27, 2014
1 parent fe58be3 commit baa8acd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 363 deletions.
6 changes: 5 additions & 1 deletion autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1592,8 +1592,12 @@ AC_HEADER_SYS_WAIT
AC_HEADER_TIME

AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([cxxabi.h])
dnl size_t must be defined before including cxxabi.h on FreeBSD 10.0.
AC_CHECK_HEADERS([cxxabi.h], [], [],
[#include <stddef.h>
])
AC_LANG_POP([C++])

AC_CHECK_HEADERS([dlfcn.h execinfo.h fcntl.h inttypes.h link.h])
AC_CHECK_HEADERS([malloc.h setjmp.h signal.h stdint.h termios.h unistd.h])
AC_CHECK_HEADERS([utime.h])
Expand Down
7 changes: 6 additions & 1 deletion cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ function(check_type_exists type files variable)
endfunction()

# include checks
check_include_file_cxx(cxxabi.h HAVE_CXXABI_H)
check_include_file(dirent.h HAVE_DIRENT_H)
check_include_file(dlfcn.h HAVE_DLFCN_H)
check_include_file(errno.h HAVE_ERRNO_H)
Expand Down Expand Up @@ -81,6 +80,12 @@ check_symbol_exists(FE_INEXACT "fenv.h" HAVE_DECL_FE_INEXACT)
check_include_file(mach/mach.h HAVE_MACH_MACH_H)
check_include_file(mach-o/dyld.h HAVE_MACH_O_DYLD_H)

# size_t must be defined before including cxxabi.h on FreeBSD 10.0.
check_cxx_source_compiles("
#include <stddef.h>
#include <cxxabi.h>
" HAVE_CXXABI_H)

# library checks
if( NOT PURE_WINDOWS )
check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD)
Expand Down
Loading

0 comments on commit baa8acd

Please sign in to comment.