From bc7752a9ddbde06c1418734d003a9607bafcc6df Mon Sep 17 00:00:00 2001 From: Michael Hashizume Date: Fri, 12 Dec 2025 09:30:31 -0800 Subject: [PATCH] Remove extraneous logic Every version of Ruby released for at least the last decade was set to use the -DRUBY19 flag. This commit sets the behavior in the flag as the default. --- extconf.rb | 9 +-------- pwd/shadow.c | 4 ---- shadow/shadow.c | 5 ----- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/extconf.rb b/extconf.rb index 6f43ae2..72afa23 100644 --- a/extconf.rb +++ b/extconf.rb @@ -7,13 +7,6 @@ require 'mkmf' require 'rbconfig' -$CFLAGS = case RUBY_VERSION - when /^1\.9/; '-DRUBY19' - when /^2\./; '-DRUBY19' - when /^3\./; '-DRUBY19' - else; '' - end - implementation = case RbConfig::CONFIG['host_os'] when /linux/i; 'shadow' when /sunos|solaris/i; 'shadow' @@ -42,7 +35,7 @@ if ok if !have_func("sgetspent") - $CFLAGS += ' -DSOLARIS' + $CFLAGS = '-DSOLARIS' end end when 'pwd' diff --git a/pwd/shadow.c b/pwd/shadow.c index 46313d4..9b47a68 100644 --- a/pwd/shadow.c +++ b/pwd/shadow.c @@ -23,11 +23,7 @@ #include "rubyio.h" #endif -#ifdef RUBY19 #define file_ptr(x) (x)->stdio_file -#else -#define file_ptr(x) (x)->f -#endif static VALUE rb_mShadow; static VALUE rb_mPasswd; diff --git a/shadow/shadow.c b/shadow/shadow.c index 9d02310..3ea06bb 100644 --- a/shadow/shadow.c +++ b/shadow/shadow.c @@ -15,12 +15,7 @@ #include "rubyio.h" #endif -#ifdef RUBY19 #define file_ptr(x) rb_io_stdio_file(x) -#else -#define file_ptr(x) (x)->f -#endif - #define NUM_FIELDS 10 static VALUE rb_mShadow;