mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-30 21:41:18 +02:00
From: t-ishii@sra.co.jp
6.3 postmaster is supposed to work with pre 6.3 protocol. This is true for little endian architecture servers. But for big endian machines such as Sparc the backward compatibility function do not work. Attached are patches to fix the problem.
This commit is contained in:
parent
b64a7549b4
commit
e4dccfdc6e
@ -34,12 +34,20 @@
|
|||||||
#else
|
#else
|
||||||
#if BYTE_ORDER == BIG_ENDIAN
|
#if BYTE_ORDER == BIG_ENDIAN
|
||||||
|
|
||||||
|
/*
|
||||||
#define ntoh_s(n) (uint16)(((u_char *)&n)[1] << 8 \
|
#define ntoh_s(n) (uint16)(((u_char *)&n)[1] << 8 \
|
||||||
| ((u_char *)&n)[0])
|
| ((u_char *)&n)[0])
|
||||||
#define ntoh_l(n) (uint32)(((u_char *)&n)[3] << 24 \
|
#define ntoh_l(n) (uint32)(((u_char *)&n)[3] << 24 \
|
||||||
| ((u_char *)&n)[2] << 16 \
|
| ((u_char *)&n)[2] << 16 \
|
||||||
| ((u_char *)&n)[1] << 8 \
|
| ((u_char *)&n)[1] << 8 \
|
||||||
| ((u_char *)&n)[0])
|
| ((u_char *)&n)[0])
|
||||||
|
*/
|
||||||
|
#define ntoh_s(n) (uint16)((((uint16)n & 0x00ff) << 8) | \
|
||||||
|
(((uint16)n & 0xff00) >> 8))
|
||||||
|
#define ntoh_l(n) (uint32)((((uint32)n & 0x000000ff) << 24) | \
|
||||||
|
(((uint32)n & 0x0000ff00) << 8) | \
|
||||||
|
(((uint32)n & 0x00ff0000) >> 8) | \
|
||||||
|
(((uint32)n & 0xff000000) >> 24))
|
||||||
#define hton_s(n) (ntoh_s(n))
|
#define hton_s(n) (ntoh_s(n))
|
||||||
#define hton_l(n) (ntoh_l(n))
|
#define hton_l(n) (ntoh_l(n))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user