[ruby_1_9_2] $B%3%s%Q%$%k%(%i!<(B

ruby_1_9_2e$B%V%i%s%A$N%3%s%Q%$%k$G%(%i!<$,5/$-$^$9!#e(B

gcc -I. -I.ext/include/i386-netbsdelf5.99.29 -I./include -I.
-DONIG_ENC_REGISTER=rb_enc_register -fPIC -g -Wextra
-Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializers -Wno-long-long -fPIC -pipe -o
enc/cp949.o -c ./enc/cp949.c
./enc/cp949.c:56: error: ‘A’ undeclared here (not in a function)
./enc/cp949.c:56: error: ‘F’ undeclared here (not in a function)
./enc/cp949.c:68: error: expected ‘,’ or ‘;’ before ‘}’ token
./enc/cp949.c: In function ‘cp949_mbc_enc_len’:
./enc/cp949.c:76: error: ‘state_t’ undeclared (first use in this
function)
./enc/cp949.c:76: error: (Each undeclared identifier is reported only
once
./enc/cp949.c:76: error: for each function it appears in.)
./enc/cp949.c:76: error: expected ‘;’ before ‘s’
./enc/cp949.c:80: error: ‘s’ undeclared (first use in this function)
./enc/cp949.c:80: error: ‘ACCEPT’ undeclared (first use in this
function)
./enc/cp949.c:82: error: ‘trans’ undeclared (first use in this function)
*** Error code 1

Stop.
make: stopped in /usr/local/src/ruby_1_9_2
*** Error code 1

e$BC1=c$J%3!<%I$NDI2C%_%9$H;W$$$^$9!#e(B

Index: enc/cp949.c

— enc/cp949.c (e$B%j%S%8%g%se(B 27668)
+++ enc/cp949.c (e$B:n6H%3%T!<e(B)
@@ -48,6 +48,8 @@
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
};

+#define A ACCEPT
+#define F FAILURE
static const char CP949_CAN_BE_TRAIL_TABLE[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

e$B$H$3$m$G!"$3$Ne(B A e$B$H$+e(B F e$B$H$$$C$?%^%/%m$G$9$,!"e(B

% egrep ‘define[ \t]A[ \t]’ enc/*
enc/big5.c:#define A ACCEPT
enc/emacs_mule.c:#define A ACCEPT
enc/euc_jp.c:#define A ACCEPT
enc/euc_kr.c:#define A ACCEPT
enc/euc_tw.c:#define A ACCEPT
enc/gb18030.c:#define A ACCEPT
enc/gbk.c:#define A ACCEPT
enc/shift_jis.c:#define A ACCEPT
enc/utf_8.c:#define A ACCEPT

e$B$H!“F1$8$b$N$,e(B copy & paste
e$B$5$l$?$h$&$K;6:_$7$F$$$^$9!#2?$+$^$H$a$?e(B
e$BJ}$,NI$$$N$G$O$J$$$G$7$g$&$+!”:#2s$N$h$&$J8m$j$rKI$00UL#$G$b!#e(B

In message [email protected]
on Sat, 8 May 2010 13:22:22 +0900,
Takahiro K. [email protected] wrote:

+#define A ACCEPT
+#define F FAILURE
static const char CP949_CAN_BE_TRAIL_TABLE[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
e$B$“!”$3$l$@$1$G$O%@%a$G$7$?!"2?$+B-$j$J$$!#e(B;-(

gcc -I. -I.ext/include/i386-netbsdelf5.99.29 -I./include -I.
-DONIG_ENC_REGISTER=rb_enc_register -fPIC -g -Wextra
-Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializers -Wno-long-long -fPIC -pipe -o
enc/cp949.o -c ./enc/cp949.c
./enc/cp949.c:58: error: ‘ACCEPT’ undeclared here (not in a function)
./enc/cp949.c:58: error: ‘FAILURE’ undeclared here (not in a function)
./enc/cp949.c:70: error: expected ‘,’ or ‘;’ before ‘}’ token

e$B$I$C$+$GJT=8%_%9$G$b$"$C$?$N$G$7$g$&$+e(B?
trunke$B$HHf$Y$k$HItJ,E*$K7gMn$7e(B
e$B$F$k$h$&$G$9!#e(B


e$B?@8Me(B e$BN4Gne(B (e$B$+$s$Ye(B e$B$?$+$R$me(B) at e$B;E;v>le(B

Index: enc/cp949.c

— enc/cp949.c (e$B%j%S%8%g%se(B 27668)
+++ enc/cp949.c (e$B:n6H%3%T!<e(B)
@@ -53,8 +53,35 @@
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

  • 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, A, A, A, A, A, A, A, A, A, A, A,
    F, F, F, F, F,
  • /* 6 */ F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
  • 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  • 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  • 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  • 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
  • 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  • 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  • 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  • 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  • 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  • 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  • 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  • 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0
    +};

+#define CP949_ISMB_FIRST(byte) (EncLen_CP949[byte] > 1)
+#define CP949_ISMB_TRAIL(byte) CP949_CAN_BE_TRAIL_TABLE[(byte)]
+
+typedef enum { FAILURE = -2, ACCEPT = -1, S0 = 0, S1 } state_t;
+#define A ACCEPT
+#define F FAILURE
+static const signed char trans[][0x100] = {

  • { /* S0 0 1 2 3 4 5 6 7 8 9 a b c d e f */
  • /* 0 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
  • /* 1 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
  • /* 2 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
  • /* 3 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
  • /* 4 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
  • /* 5 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
  • /* 6 / A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
    /
    7 / A, A, A, A, A, A, A, A, A, A, A, F, F, F, F, F,
    /
    8 / F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,
    /
    9 */ A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,

In message
[email protected]
on Sat, 8 May 2010 15:49:45 +0900,
Tanaka A. [email protected] wrote:

2010e$BG/e(B5e$B7ne(B8e$BF|e(B13:31 Takahiro K. [email protected]:

e$B$I$C$+$GJT=8%_%9$G$b$"$C$?$N$G$7$g$&$+e(B? trunke$B$HHf$Y$k$HItJ,E*$K7gMn$7e(B
e$B$F$k$h$&$G$9!#e(B

e$B%j%]%8%H%j$NCf$G$O%U%!%$%k$K0c$$$OL5$$$h$&$G$9!#e(B
e$B$&$%$`!"$?$$$X$s<:Ni$7$^$7$?!#e(B

e$B%m%0$r$_$F$be(B r27657 e$B$GJ,4t$7$F$+$iJQ99$5$l$F$$$^$;$s!#e(B

% svn log -v http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_2/enc/cp949.c|less
e$B$3$A$i$b8+$F$*$+$7$$$H;W$C$F$$$?$N$G$9$,!“B>$N%^%7%s$Ge(Bcheckoute$B$7$?$b$Ne(B
e$B$OLdBj$”$j$^$;$s$G$7$?!#e(B

e$B$*A{$,$;$7$?$3$H$r$*OM$S$7$^$9!#e(B

2010e$BG/e(B5e$B7ne(B8e$BF|e(B13:31 Takahiro K.
[email protected]:

e$B$I$C$+$GJT=8%_%9$G$b$"$C$?$N$G$7$g$&$+e(B? trunke$B$HHf$Y$k$HItJ,E*$K7gMn$7e(B
e$B$F$k$h$&$G$9!#e(B

e$B%j%]%8%H%j$NCf$G$O%U%!%$%k$K0c$$$OL5$$$h$&$G$9!#e(B

% svn diff
http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_2/enc/cp949.c
http://svn.ruby-lang.org/repos/ruby/trunk/enc/cp949.c

e$B%m%0$r$_$F$be(B r27657 e$B$GJ,4t$7$F$+$iJQ99$5$l$F$$$^$;$s!#e(B

% svn log -v
http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_2/enc/cp949.c|less