yes of course I use define EBCDIC in file *.c and *.h . 

but in file charclass_invlist.h 
 
1 /* -*- buffer-read-only: t -*-
2  * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
3  * This file is built by regen/mk_invlists.pl from Unicode::UCD.
4  * Any changes made here will be lost!
5  */

script regen/mk_invlists.pl does not work correctly on z/OS .

------------------------------------------------------------------------
 Yaroslav Kuzmin
Developer C/C++ ,z/OS , Linux
3 Zhukovskiy Street · Miass, Chelyabinsk region 456318 · Russia
Tel:  +7.922.2.38.33.38
Email: [email protected]
Web: www.rocketsoftware.com

________________________________________
From: [email protected] <[email protected]> on behalf of Jarkko Hietaniemi 
<[email protected]>
Sent: 10 April 2014 18:05
To: Yaroslav Kuzmin; demerphq
Cc: [email protected]; [email protected]; Perl5 Porters
Subject: Re: НА: Fwd: Re: USSP-37: Info Request for Perl Fwd: EBCDIC support is 
onthe chopping block

On Thursday-201404-10, 7:11, Yaroslav Kuzmin wrote:
> 1 In source code perl is found cod :
>
> if (variable == 0x41 )  // variable == 'A'
>   or
> if (variable == 0x20 ) // variable == ' '
>   or
> if (variable == 0x7F) // variable == DEL
>
>   In code has a numeric value
>
> 2 Create some files *.h  using perl scripts
>
>    These scripts do not work on z/OS , I edit the file charclass_invlist.h 
> manually.

... but in general, editing the source code manually is only a
workaround.  Either the code (or in some cases, the scripts generating
the code) needs to be corrected so that it works correctly either in
ASCII-based or EBCDIC-based.  Usually this means things like

#if 'A' == 0x41
...
#else
#if 'A' == 0xC1
...
#else
#error what the heck are you?
#endif
#endif

But of course for better maintainability one should use the predefined
things like #ifdef EBCDIC.  (One may have to do more specific tests for
the subvariants of EBCDIC, where some of the characters dance around.)
As a general principle, the *.c should not do testing like this, and
instead the *.h files should define things (like macros) so that the
code just can be character-set-independent straight code.

Reply via email to