12 #define PG_BSWAP32(x) bswap_32(x)
13 #define PG_BSWAP64(x) bswap_64(x)
15 #include <sys/endian.h>
16 #define PG_BSWAP32(x) bswap32(x)
17 #define PG_BSWAP64(x) bswap64(x)
19 #error "No appropriate byteswap found for your system."
22 #if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
23 #define PGint32(x) (x)
24 #define PGint64(x) (x)
25 #elif defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
26 #define PGint32(x) PG_BSWAP32(x)
27 #define PGint64(x) PG_BSWAP64(x)
28 #elif defined(_BYTE_ORDER) && (_BYTE_ORDER == _BIG_ENDIAN)
29 #define PGint32(x) (x)
30 #define PGint64(x) (x)
31 #elif defined(_BYTE_ORDER) && (_BYTE_ORDER == _LITTLE_ENDIAN)
32 #define PGint32(x) PG_BSWAP32(x)
33 #define PGint64(x) PG_BSWAP64(x)
35 #error "Cannot determine byte order."
38 const char *build_conninfo(const char *db, const char *username, const char *password, const char *host, const char *port);