From 45a5ce385bcba62620701ac3f2f0cf1ec734ebac Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 18 May 2025 12:23:54 -0600 Subject: [PATCH] Allow z/OS to work in either EBCDIC or ASCII mode IBM has an initiative underway to port various open source projects to work on z/OS, running under ASCII. But its native character set is IBM 1047. This requires a bunch of fancy footwork that they have undertaken. One of the necessary things is to be able to set the character set of a file descriptor. The __setfdccsid() function does that, but it and its header file, zos.h, are only defined in ASCII builds. This commit allows perl to work in both modes. --- os390/os390.c | 1 - perl.h | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/os390/os390.c b/os390/os390.c index 9831b8b0df..2d34a5f7b3 100644 --- a/os390/os390.c +++ b/os390/os390.c @@ -11,7 +11,6 @@ #include #include #include -#include #include "EXTERN.h" #include "perl.h" #include "XSUB.h" diff --git a/perl.h b/perl.h index 9cabb503a4..6250ced643 100644 --- a/perl.h +++ b/perl.h @@ -4470,7 +4470,16 @@ intrinsic function, see its documents for more details. #endif #if defined(__CYGWIN__) || defined(__MVS__) + void init_os_extras(void); + +#endif +#if defined(__MVS__) +# ifdef EBCDIC +# define __setfdccsid(to_fd, bits) 0 +# else +# include +# endif #endif union any {