Compile variant_byte_number() for EBCDIC
authorKarl Williamson <khw@cpan.org>
Tue, 30 Jan 2018 03:33:14 +0000 (20:33 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 30 Jan 2018 18:38:12 +0000 (11:38 -0700)
Future commits will use this without regard to platform.

embed.fnc
embed.h
inline.h
proto.h

index fadd45b..b0aef42 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -806,9 +806,7 @@ AndmoR      |bool   |is_utf8_invariant_string|NN const U8* const s              \
 AnidR  |bool   |is_utf8_invariant_string_loc|NN const U8* const s          \
                |STRLEN len                                                 \
                |NULLOK const U8 ** ep
-#ifndef EBCDIC
 AniR   |unsigned int|_variant_byte_number|PERL_UINTMAX_T word
-#endif
 #if defined(PERL_CORE) || defined(PERL_EXT)
 EinR   |Size_t |variant_under_utf8_count|NN const U8* const s              \
                |NN const U8* const e
diff --git a/embed.h b/embed.h
index c633b57..f8cc703 100644 (file)
--- a/embed.h
+++ b/embed.h
@@ -46,6 +46,7 @@
 #define _to_utf8_lower_flags(a,b,c,d,e,f,g)    Perl__to_utf8_lower_flags(aTHX_ a,b,c,d,e,f,g)
 #define _to_utf8_title_flags(a,b,c,d,e,f,g)    Perl__to_utf8_title_flags(aTHX_ a,b,c,d,e,f,g)
 #define _to_utf8_upper_flags(a,b,c,d,e,f,g)    Perl__to_utf8_upper_flags(aTHX_ a,b,c,d,e,f,g)
+#define _variant_byte_number   S__variant_byte_number
 #define amagic_call(a,b,c,d)   Perl_amagic_call(aTHX_ a,b,c,d)
 #define amagic_deref_call(a,b) Perl_amagic_deref_call(aTHX_ a,b)
 #define apply_attrs_string(a,b,c,d)    Perl_apply_attrs_string(aTHX_ a,b,c,d)
 #if !(defined(HAS_SIGACTION) && defined(SA_SIGINFO))
 #define csighandler            Perl_csighandler
 #endif
-#if !defined(EBCDIC)
-#define _variant_byte_number   S__variant_byte_number
-#endif
 #if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP)
 #define my_chsize(a,b)         Perl_my_chsize(aTHX_ a,b)
 #endif
index 21151e3..3cd90e5 100644 (file)
--- a/inline.h
+++ b/inline.h
@@ -476,8 +476,6 @@ S_is_utf8_invariant_string_loc(const U8* const s, STRLEN len, const U8 ** ep)
     return TRUE;
 }
 
-#ifndef EBCDIC
-
 PERL_STATIC_INLINE unsigned int
 S__variant_byte_number(PERL_UINTMAX_T word)
 {
@@ -585,7 +583,6 @@ S__variant_byte_number(PERL_UINTMAX_T word)
     return (unsigned int) word;
 }
 
-#endif /* ! EBCDIC */
 #if defined(PERL_CORE) || defined(PERL_EXT)
 
 /*
diff --git a/proto.h b/proto.h
index 61a4db8..b1b7987 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -137,6 +137,11 @@ PERL_CALLCONV UV   Perl__to_utf8_title_flags(pTHX_ const U8 *p, const U8* e, U8* u
 PERL_CALLCONV UV       Perl__to_utf8_upper_flags(pTHX_ const U8 *p, const U8 *e, U8* ustrp, STRLEN *lenp, bool flags, const char * const file, const int line);
 #define PERL_ARGS_ASSERT__TO_UTF8_UPPER_FLAGS  \
        assert(p); assert(ustrp); assert(file)
+#ifndef PERL_NO_INLINE_FUNCTIONS
+PERL_STATIC_INLINE unsigned int        S__variant_byte_number(PERL_UINTMAX_T word)
+                       __attribute__warn_unused_result__;
+#endif
+
 PERL_CALLCONV void     Perl__warn_problematic_locale(void);
 PERL_CALLCONV_NO_RET void      Perl_abort_execution(pTHX_ const char * const msg, const char * const name)
                        __attribute__noreturn__;
@@ -3860,13 +3865,6 @@ PERL_CALLCONV_NO_RET int Perl_magic_regdatum_set(pTHX_ SV* sv, MAGIC* mg)
 #define PERL_ARGS_ASSERT_MAGIC_REGDATUM_SET    \
        assert(sv); assert(mg)
 
-#endif
-#if !defined(EBCDIC)
-#ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE unsigned int        S__variant_byte_number(PERL_UINTMAX_T word)
-                       __attribute__warn_unused_result__;
-#endif
-
 #endif
 #if !defined(HAS_GETENV_LEN)
 PERL_CALLCONV char*    Perl_getenv_len(pTHX_ const char *env_elem, unsigned long *len);