Re: [HACKERS] problems with sunos4 port, endian?

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема Re: [HACKERS] problems with sunos4 port, endian?
Дата
Msg-id 4eae6bff222d35769fc998bbac7937ac
обсуждение исходный текст
Ответ на [HACKERS] problems with sunos4 port, endian?  (Chris McGonagle <pglist@FOUR.net>)
Список pgsql-hackers
Thomas,

>Tatsuo Ishii wrote:
>> Here is a patch to fix the endian problem of 6.1. With this patch,
>> your big endian postgres server will begin to speak little endian as
>> 6.0!
>
>I have tested this patch on my Linux/i686/little-endian machine with
>v6.1 and it does not damage my already working installation.
>
>Tatsuo I. reports successful tests on several platforms. I vaguely
>recall that someone else reported success on a mixed-endian pair of
>platforms. Is there any reason to not introduce it into the source tree?
>
>If no one expresses reservations in the next couple of days, and if no
>one claims the job, I will go ahead and commit this to the source tree
>as a candidate change for the upcoming jumbo-patch.
>
>            - Tom
>
>btw, I used the patch which was re-posted by Tatsuo a couple of days ago
>and which included as new patch for postgres.h as well as the original
>patch for pqcomprim.c

Sorry. I forgot to explain about this.

pqcomprim.c goes into trouble if BYTE_ORDER macro is not properly
defined. For example, in the src/include/port/sparc_solaris.h there
are statements trying to define the value of BYTE_ORDER macro:

    #ifndef        BYTE_ORDER
    #define        BYTE_ORDER    BIG_ENDIAN
    #endif

Since sparc solaris does not have the endian.h, the value of
BIG_ENDIAN is not defined anywhere. As a result, following statement
in the pqcomprim.c:

    #if BYTE_ORDER == LITTLE_ENDIAN

always falls into true. The patch for postgres.h defines values of
BIG_ENDIAN, LITTLE_ENDIAN and PDP_ENDIAN if endian.h does not exist. I
a little bit hesitate to patch postgres.h. But I couldn'y find more
proper place.
- --
Tatsuo Ishii
t-ishii@sra.co.jp

------------------------------

В списке pgsql-hackers по дате отправления: