Re: Bool values under Mac OS X

From: lothar(dot)behrens(at)lollisoft(dot)de
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Bool values under Mac OS X
Date: 2005-04-26 18:37:51
Message-ID: 426EA69F.16768.26D21DA@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Am 26 Apr 2005 um 10:24 hat Tom Lane geschrieben:

> lothar(dot)behrens(at)lollisoft(dot)de writes:
> > My conversion is these:
> > bool b = *(bool*) buffer;
>
> What's the data type of "buffer"?
>

void*

> On Intel hardware the above will fetch the low-order byte of "buffer",
> but on PPC (and other big-endian) hardware, it will fetch the high-order
> byte. I suspect strongly that your problem has nothing to do with OS X
> versus Windows and everything to do with being careless about endianness
> issues.

I have tried out ByteAsChar and got 0 or 1. Then I have done an int conversion
instead of bool. Then I got it working. 0 is false and all other values threaded true.

Lothar

>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>

--
Lothar Behrens www.lollisoft.de
Rosmarinstr 3 My public project:
40235 Düsseldorf http://sourceforge.net/projects/lbdmf

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Harry Sufehmi 2005-04-27 07:37:14 Problem connecting from Windows 9x/Me
Previous Message Tom Lane 2005-04-26 14:24:11 Re: Bool values under Mac OS X