This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ebcdic support for binutils...


On Tue, Dec 11, 2001 at 03:09:18PM -0500, DJ Delorie wrote:
> 
> > Hmm. Then what would you suggest in its place?
> 
> #else
> #if ...
> 
> #else
> 
> #endif
> #endif

hm. That's better? What happens when you get 50 different charsets? 

Ed

( ps - what was the rationale for the hex replacement anyways?  I thought the
other file was much cleaner.)

( pps - here goes...)

diff -cr binutils-011211/libiberty/hex.c binutils-011211.new/libiberty/hex.c
*** binutils-011211/libiberty/hex.c	Tue Oct 23 08:32:45 2001
--- binutils-011211.new/libiberty/hex.c	Tue Dec 11 18:34:12 2001
***************
*** 105,111 ****
--- 105,186 ----
    _hex_bad, _hex_bad, _hex_bad, _hex_bad,
    _hex_bad, _hex_bad, _hex_bad, _hex_bad,
    _hex_bad, _hex_bad, _hex_bad, _hex_bad,
+ };				
+ 			/* EBCDIC */
+ #else
+ #if 	'\n' == 0x15 &&    ' ' == 0x40 &&     '0' == 0xF0 \
+   &&     'A'  == 0xC1 &&    'a' == 0x81 &&     '!' == 0x5A \
+   &&     EOF == 0
+ 
+ const char _hex_value[_hex_array_size] =
+ {
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* NUL   SOH   STX    ETX   */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* SEL   HT    RNL    DEL   */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* GE    SPS   RPT    VT    */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* FF    CR    SO     SI    */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* DLE   DC1   DC2    DC3   */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* RES   LF    BS     POC   */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* CAN   EM    UBS    CU1   */ 
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* FS    GS    RS     US    */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* DS    SOS   fs     WUS   */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* BYP   LF    ETB    ESC   */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* SA    SFE   SM     CSP   */ 
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* MFA   ENQ   ACK    BEL   */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* UND   UND   SYN    IR    */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* PP    TRN   NBS    EOT   */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* SBS   IT    RFF    CU3   */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* DC4   NAK   UND    SUB   */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* SP01  SP30  LA15   LA17  */ 
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LA13  LA11  LA19   LA27  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LC41  LN19  SC04   SP11  */ 
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* <     (     +      |     */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* &     LE11  LE15   LE17  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LE13  LI11  LI15   LI17  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LI13  LS61  !      $     */ 
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* *     )     ;      ^     */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* -     /     LA16   LA18  */ 
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LA14  LA12  LA20   LA28  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LC42  LN20  SM65   ,     */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* %     _     >      ?     */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LO61  LE12  LE16   LE18  */ 
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LE14  LI12  LI16   LI18  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LI14  SD13  :      #     */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* @     '     =      "     */
+   _hex_bad, 10,       11,       13,       /* LO62  a     b      c     */
+   13,       14,       15,       _hex_bad, /* d     e     f      g     */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* h     i     SP17   SP18  */  
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LD63  LY11   LT63   SA02 */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* SM19  j      k      l    */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* m     n      o      p    */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* q     r     SM21   SM20  */  
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LA51  SD41  LA52   SC01  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* SM17  SD19  s      t     */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* u     v     w      x     */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* y     z     SP03   SP16  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LD62  [     LT64   SM53  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* SM66  SC02  SC05   SD63  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* SM52  SM24  SM25   NF04  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* NF01  NF05  LY12   SD17  */  
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* SM15  ]     SD11   SA07  */
+   _hex_bad, 10,       11,       12,       /* {     A     B      C     */
+   13,       14,       15,       _hex_bad, /* D     E     F      G     */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* H     I     SP32   LO15  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LO17  LO13  LO11   LO19  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* }     J     K      L     */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* M     N     O      P     */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* Q     R     ND011  LU15  */  
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LU17  LU13  LU11   LY17  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* \     SA06  S      T     */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* U     V     W      X     */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* Y     Z    ND021   LO16  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* LO18  LO14 LO12    LO20  */
+   0,        1,        2,        3,        /* 0     1    2       3     */
+   4,        5,        6,        7,        /* 4     5    6       7     */
+   8,        9,        _hex_bad, _hex_bad, /* 8     9    ND031   LU16  */
+   _hex_bad, _hex_bad, _hex_bad, _hex_bad  /* LU18 LU14  LU12   EOF    */
  };
+ 
  #else
   #error "Unsupported host character set"
  #endif /* not ASCII */
+ #endif
Only in binutils-011211.new/libiberty: hex.c~
diff -cr binutils-011211/libiberty/safe-ctype.c binutils-011211.new/libiberty/safe-ctype.c
*** binutils-011211/libiberty/safe-ctype.c	Sat Dec 16 19:07:49 2000
--- binutils-011211.new/libiberty/safe-ctype.c	Tue Dec 11 18:46:46 2001
***************
*** 158,163 ****
   240,241,242,243, 244,245,246,247, 248,249,250,251, 252,253,254,255,
  };
  
  #else
   #error "Unsupported host character set"
! #endif /* not ASCII */
--- 158,284 ----
   240,241,242,243, 244,245,246,247, 248,249,250,251, 252,253,254,255,
  };
  
+    /* EBCDIC */  
+ 
+ #else
+ #if 	'\n' == 0x15 &&    ' ' == 0x40 &&     '0' == 0xF0 \
+   &&     'A'  == 0xC1 &&    'a' == 0x81 &&     '!' == 0x5A \
+   &&     EOF == 0
+ 
+ const unsigned short _sch_istable[256] =  
+ {
+   Z, C, C, C, 0, T, 0, 0, /* NUL   SOH   STX    ETX   SEL  HT    RNL    DEL  */
+   0, 0, 0, C, C, V, C, C, /* GE    SPS   RPT    VT    FF   CR    SO     SI   */
+   C, C, C, C, 0, V, C, 0, /* DLE   DC1   DC2    DC3   RES  LF    BS     POC  */
+   C, C, 0, 0, 0, 0, C, C, /*  CAN   EM    UBS    CU1   FS   GS    RS     US   */
+   0, 0, 0, 0, 0, 0, C, C, /*  DS    SOS   fs     WUS   BYP  LF    ETB    ESC  */
+   0, 0, 0, 0, 0, C, C, C, /*  SA    SFE   SM     CSP   MFA  ENQ   ACK    BEL  */
+   0, 0, C, 0, 0, 0, 0, C, /*  UND   UND   SYN    IR    PP   TRN   NBS    EOT  */
+   0, 0, 0, 0, C, C, 0, C, /*  SBS   IT    RFF    CU3   DC4  NAK   UND    SUB  */
+   S, 0, 0, 0, 0, 0, 0, 0, /*  SP01  SP30  LA15   LA17  LA13 LA11  LA19   LA27 */
+   0, 0, 0, P, P, P, P, P, /*  LC41  LN19  SC04   SP11  <    (     +      |    */
+   P, 0, 0, 0, 0, 0, 0, 0, /*  &     LE11  LE15   LE17  LE13 LI11  LI15   LI17 */
+   0, 0, P, P, P, P, P, P, /*  LI13  LS61  !      $     *    )     ;      ^    */
+   P, P, 0, 0, 0, 0, 0, 0, /*  -     /     LA16   LA18  LA14 LA12  LA20   LA28 */
+   0, 0, 0, P, P, _, P, P, /*  LC42  LN20  SM65   ,     %    _     >      ?    */
+   0, 0, 0, 0, 0, 0, 0, 0, /*  LO61  LE12  LE16   LE18  LE14 LI12  LI16   LI18 */
+   0, P, P, P, P, P, P, P, /*  LI14  SD13  :      #     @    '     =      "    */
+   0,XL,XL,XL,XL,XL,XL, L, /*  LO62  a     b      c     d    e     f      g    */
+   L, L, 0, 0, 0, 0, 0, 0, /*  h     i     SP17   SP18  LD63 LY11  LT63   SA02 */
+   0, L, L, L, L, L, L, L, /*  SM19  j     k      l     m    n     o      p    */
+   L, L, 0, 0, 0, 0, 0, 0, /*  q     r     SM21   SM20  LA51 SD41  LA52   SC01 */
+   0, 0, L, L, L, L, L, L, /*  SM17  SD19  s      t     u    v     w      x    */
+   L, L, 0, 0, 0, 0, 0, 0, /*  y     z     SP03   SP16  LD62 [     LT64   SM53 */
+   0, 0, 0, 0, 0, 0, 0, 0, /*  SM66  SC02  SC05   SD63  SM52 SM24  SM25   NF04 */
+   0, 0, 0, 0, 0, P, 0, 0, /*  NF01  NF05  LY12   SD17  SM15 ]     SD11   SA07 */
+   P,XU,XU,XU,XU,XU,XU, U, /*  {     A     B      C     D    E     F      G    */
+   U, U, 0, 0, 0, 0, 0, 0, /*  H     I     SP32   LO15  LO17 LO13  LO11   LO19 */
+   P, U, U, U, U, U, U, U, /*  }     J     K      L     M    N     O      P    */
+   U, U, 0, 0, 0, 0, 0, 0, /*  Q     R     ND011  LU15  LU17 LU13  LU11   LY17 */
+   P, 0, U, U, U, U, U, U, /*  \     SA06  S      T     U    V     W      X    */
+   U, U, 0, 0, 0, 0, 0, 0, /*  Y     Z     ND021  LO16  LO18 LO14  LO12   LO20 */
+   D, D, D, D, D, D, D, D, /*  0     1     2      3     4    5     6      7    */
+   D, D, 0, 0, 0, 0, 0, 0  /*  8     9     ND031  LU16  LU18 LU14  LU12   EOF  */
+ };
+ 
+ const unsigned char _sch_tolower [256] =
+ {
+    0,  1,  2,  3,   4,  5,  6,  7,   8,  9, 10, 11,  12, 13, 14, 15,
+   16, 17, 18, 19,  20, 21, 22, 23,  24, 25, 26, 27,  28, 29, 30, 31,
+   32, 33, 34, 35,  36, 37, 38, 39,  40, 41, 42, 43,  44, 45, 46, 47,
+   48, 49, 50, 51,  52, 53, 54, 55,  56, 57, 58, 59,  60, 61, 62, 63,
+   64, 65, 66, 67,  68, 69, 70, 71,  72, 73, 74, 75,  76, 77, 78, 79,
+   80, 81, 82, 83,  84, 85, 86, 87,  88, 89, 90, 91,  92, 93, 94, 95,
+   96, 97, 98, 99, 100,101,102,103, 104,105,106,107, 108,109,110,111,
+  112,113,114,115, 116,117,118,119, 120,121,122,123, 124,125,126,127,
+  128,
+  
+  'a','b','c','d', 'e','f','g','h', 'i',
+  
+  138,139,140,141, 142,143,144,
+ 
+  'j','k','l','m', 'n','o','p','q', 'r',
+  
+  154,155,156,157, 158,159,160,161,
+  
+  's','t','u','v', 'w','x','y','z',
+  
+  170,171,172,173, 174,175,176,177, 178,179,180,181, 182,183,184,185,
+  186,187,188,189, 190,191,192,
+  
+  'a','b','c','d', 'e','f','g','h', 'i',
+ 
+  202,203,204,205, 206,207,208,
+  
+  'j','k','l','m', 'n','o','p','q', 'r',
+  
+  218,219, 220,221,222,223,224,225,
+  
+  's','t','u','v', 'w','x','y','z',
+  
+  234,235,236,237, 238,239,240,241, 242,243,244,245, 246,247,248,249,
+  250,251,252,253, 254,255,
+ };
+ 
+ const unsigned char _sch_toupper[256] =
+ {
+    0,  1,  2,  3,   4,  5,  6,  7,   8,  9, 10, 11,  12, 13, 14, 15,
+   16, 17, 18, 19,  20, 21, 22, 23,  24, 25, 26, 27,  28, 29, 30, 31,
+   32, 33, 34, 35,  36, 37, 38, 39,  40, 41, 42, 43,  44, 45, 46, 47,
+   48, 49, 50, 51,  52, 53, 54, 55,  56, 57, 58, 59,  60, 61, 62, 63,
+   64, 65, 66, 67,  68, 69, 70, 71,  72, 73, 74, 75,  76, 77, 78, 79,
+   80, 81, 82, 83,  84, 85, 86, 87,  88, 89, 90, 91,  92, 93, 94, 95,
+   96, 97, 98, 99, 100,101,102,103, 104,105,106,107, 108,109,110,111,
+  112,113,114,115, 116,117,118,119, 120,121,122,123, 124,125,126,127,
+  128,
+  
+  'A','B','C','D', 'E','F','G','H', 'I',
+  
+  138,139,140,141, 142,143,144,
+ 
+  'J','K','L','M', 'N','O','P','Q', 'R',
+  
+  154,155,156,157, 158,159,160,161,
+  
+  'S','T','U','V', 'W','X','Y','Z',
+  
+  170,171,172,173, 174,175,176,177, 178,179,180,181, 182,183,184,185,
+  186,187,188,189, 190,191,192,
+  
+  'A','B','C','D', 'E','F','G','H', 'I',
+ 
+  202,203,204,205, 206,207,208,
+  
+  'J','K','L','M', 'N','O','P','Q', 'R',
+  
+  218,219, 220,221,222,223,224,225,
+  
+  'S','T','U','V', 'W','X','Y','Z',
+  
+  234,235,236,237, 238,239,240,241, 242,243,244,245, 246,247,248,249,
+  250,251,252,253, 254,255,
+ };
  #else
   #error "Unsupported host character set"
! #endif
! #endif /* not ASCII or EBCDIC */

Ed


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]