From: WATANABE Tetsuya Date: 1998-10-15T09:54:22+09:00 Subject: [ruby-list:10120] Re: ruby on HP-UX In message "[ruby-list:10066] Re: ruby on HP-UX" on 98/10/13, WATANABE Tetsuya writes: |動いてよかったですね。 わたなべさんのパッチだと、HP-UX 10.20 のヘッダファ イルではダメみたいです。 ------------------------------ $ make snprintf.o gcc -O -I. -I/gnu/include -c ./missing/snprintf.c ./missing/snprintf.c:122: conflicting types for `fpos_t' /usr/include/sys/types.h:60: previous declaration of `fpos_t' make: *** [snprintf.o] Error 1 $ cc -O -I. -I/gnu/include -c ./missing/snprintf.c cc: "missing/snprintf.c", line 122: error 1584: Inconsistent type declaration: "fpos_t". cc: "missing/snprintf.c", line 122: warning 525: Redeclaration of identifier "fpos_t". cc -O -I. -I/gnu/include -c ./missing/snprintf.c 0.82s user 0.22s system 22% cpu 4.604 total ------------------------------ /usr/include/sys/types.h HP-UX 10.20 ------------------------------ # ifndef _FPOS_T # define _FPOS_T # ifdef _FILE64 typedef int64_t fpos_t; /* 64bit position inside a file */ # else typedef int32_t fpos_t; /* 32bit position inside a file */ # endif # endif /* _FPOS_T */ ------------------------------ 私は HP-UX 10.10 の経験がないのですが、この定義は HP-UX 10.20 からかもしれません。 cc とか gcc レベルで HP-UX の version を見破るのは ちょっと... どうしたらいいかな。プリプロセッサが OS の version を返したりはしないのです(これがけっ こう困るのでした)。 「_FOPS_T」を定義してしまうか? -- WATANABE Tetsuya HP Japan e-mail Tetsuya_WATANABE@hp.com tetsu@jpn.hp.com