On 03 Mar 2000 15:36:56 +0100, Jean-Marc Lasgouttes wrote:

>>>>>> "Claus" == Claus Hentschel <[EMAIL PROTECTED]> writes:
>
>Claus> Hi anybody! Maybe you Know, that I'm working on ports for Win32
>Claus> of Lyx. There were some messages a few weeks ago, concerning
>Claus> that port!
>
>Claus> Now some people asked me because it is not possible to enable
>Claus> german, dutch or whatever menus in Lyx? And of course this does
>Claus> not work with my port - But it works with Steven van Dijk's
>Claus> port of Lyx 1.0.4!
>
>Claus> So I analyzed the code and found (maybe) a bug:
>
>Claus>    intl/loadmsgcat.c line 88 fd = open(...,O_RDONLY)
>
>Claus> With this line Lyx hangs in the read system call, I think
>Claus> because of cr/nl-converison etc. there are only send less
>Claus> characters than fetched with fstat().
>
>Claus> If you change this line into
>
>Claus>    intl/loadmsgcat.c line 88 fd = open(...,O_RDONLY | O_BINARY)
>
>Claus> then all works fine!
>
>Claus>             So Lyx 1.1.4fix1 is international on Win32!
>
>Unfortunately, it seems to me that O_BINARY is not standard. I do not
>have it in my compaq Tru64 man pages.

O_BINARY ? :) 

Use fopen(foo, "rb"). It's ANSI C90 and the standard requires this flag
to be set explicitly for binary streams (which are the only form of
streams on common Unixes).

 But I know there are a number of broken UN*X's that cannot compile
ANSI C 90/C++ code (amongst them some - but definitely NOT all -
Linuxes ;). Emx-OS/2 has solved this hassle with -Zbin switch, so that
you can omit what the standard requires. But then - according to C90 -
ASCII text streams must be explicitly opened/set to 't', i.e. text
mode: fopen(foo, "rt"), etc.

I do not know who invented text mode, maybe CP/M. Unfortunately all
systems (except the UN*X family) need it, because printers and other
devices depend on this. This is why printing on UN*X often produces
staircase effects, etc.

All in all this problem is the best known reason, why porting to/from
Un*x involves so much tedious and in fact useless work.

Greets,


        Arnd

Reply via email to