From f108bc32af99b0802614c680e43013d828a68d29 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Thu, 29 Apr 2021 15:17:49 +0200 Subject: [PATCH] HAVE_* macros should not be defined with value 0 * See [Feature #17752] --- include/ruby/backward/2/attributes.h | 4 ---- include/ruby/ruby.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/ruby/backward/2/attributes.h b/include/ruby/backward/2/attributes.h index eaff9e3381..0389f82190 100644 --- a/include/ruby/backward/2/attributes.h +++ b/include/ruby/backward/2/attributes.h @@ -90,16 +90,12 @@ #define ERRORFUNC(mesg, x) RBIMPL_ATTR_ERROR(mesg) x #if RBIMPL_HAS_ATTRIBUTE(error) # define HAVE_ATTRIBUTE_ERRORFUNC 1 -#else -# define HAVE_ATTRIBUTE_ERRORFUNC 0 #endif #undef WARNINGFUNC #define WARNINGFUNC(mesg, x) RBIMPL_ATTR_WARNING(mesg) x #if RBIMPL_HAS_ATTRIBUTE(warning) # define HAVE_ATTRIBUTE_WARNINGFUNC 1 -#else -# define HAVE_ATTRIBUTE_WARNINGFUNC 0 #endif /* diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index ce5f6c652d..341a716953 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -72,7 +72,7 @@ VALUE rb_get_path_no_checksafe(VALUE); ((argc) == 0 ? (vargc) <= 1 : /* [ruby-core:85266] [Bug #14425] */ \ (argc) == (vargc)) # if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P) -# if HAVE_ATTRIBUTE_ERRORFUNC +# ifdef HAVE_ATTRIBUTE_ERRORFUNC ERRORFUNC((" argument length doesn't match"), int rb_varargs_bad_length(int,int)); # else # define rb_varargs_bad_length(argc, vargc) \