From 15a98ab42838be248a5b59ca342033ee338357ad Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 20 Feb 2019 06:54:23 +0000 Subject: Try statx syscall * file.c (rb_file_s_birthtime): export for pathname to check if birthtime is supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/pathname/extconf.rb | 2 +- ext/pathname/pathname.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'ext') diff --git a/ext/pathname/extconf.rb b/ext/pathname/extconf.rb index c9133bc153..84e68277aa 100644 --- a/ext/pathname/extconf.rb +++ b/ext/pathname/extconf.rb @@ -1,4 +1,4 @@ # frozen_string_literal: false require 'mkmf' -have_struct_member("struct stat", "st_birthtimespec", "sys/stat.h") +have_func("rb_file_s_birthtime") create_makefile('pathname') diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c index d5e58c52d8..9cf6c32039 100644 --- a/ext/pathname/pathname.c +++ b/ext/pathname/pathname.c @@ -512,7 +512,7 @@ path_atime(VALUE self) return rb_funcall(rb_cFile, id_atime, 1, get_strpath(self)); } -#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC) || defined(_WIN32) +#if defined(HAVE_RB_FILE_S_BIRTHTIME) /* * call-seq: * pathname.birthtime -> time @@ -528,6 +528,7 @@ path_birthtime(VALUE self) return rb_funcall(rb_cFile, id_birthtime, 1, get_strpath(self)); } #else +/* check at compilation time for `respond_to?` */ # define path_birthtime rb_f_notimplement #endif -- cgit v1.2.3