diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-01-31 12:01:39 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-01-31 13:01:52 +0900 |
commit | cdd75d4e7f0402a0537c516b7331a036347b0fa9 (patch) | |
tree | 84e64cd8924489dc07fcc33cfd9b8e471e6bb666 /configure.ac | |
parent | 4942adf68cd2d8ab0a3ca64a787bdf55e119b337 (diff) | |
download | ruby-cdd75d4e7f0402a0537c516b7331a036347b0fa9.tar.gz |
support C++ std::nullptr_t
C++ keyword `nullptr` represents a null pointer (note also that NULL is
an integer in C++ due to its design flaw). Its type is `std::nullptr_t`,
defined in <cstddef> standard header. Why not support it when the
backend implementation can take a null pointer as an argument.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 548849d612..b0e09a5f85 100644 --- a/configure.ac +++ b/configure.ac @@ -1437,6 +1437,17 @@ AS_IF([test "$rb_cv_CentOS6_CXX_workaround" != no],[ AC_DEFINE([RUBY_CXX_DEPRECATED(msg)], [__attribute__((__deprecated__(msg)))])]) +AC_CACHE_CHECK([for std::nullptr_t], rb_cv_CXX_nullptr, [ + AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [@%:@include <cstddef>], + [static std::nullptr_t const *const conftest = nullptr;])], + [rb_cv_CXX_nullptr=yes], + [rb_cv_CXX_nullptr=no]) + AC_LANG_POP()]) +AS_IF([test "$rb_cv_CXX_nullptr" != no],[AC_DEFINE(HAVE_NULLPTR)]) + if_i386=${universal_binary+[defined __i386__]} RUBY_FUNC_ATTRIBUTE(__stdcall__, FUNC_STDCALL, rb_cv_func_stdcall, ${if_i386}) RUBY_FUNC_ATTRIBUTE(__cdecl__, FUNC_CDECL, rb_cv_func_cdecl, ${if_i386}) |