mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
Fix compilation warning in unicode_norm.c
80f8eb7 has introduced in unicode_norm.c some new code that uses htonl(). On at least some FreeBSD environments, it is possible to find that this function is undeclared, causing a compilation warning. It is worth noting that no buildfarm members have reported this issue. Instead of adding a new inclusion to arpa/inet.h, switch to use the equivalent defined in pg_bswap.h, to benefit from any built-in function if the compiler has one. Reported-by: Masahiko Sawada Discussion: https://postgr.es/m/CA+fd4k7D4b12ShywWj=AbcHZzV1-OqMjNe7RZAu+tgz5rd_11A@mail.gmail.com
This commit is contained in:
parent
f0f13a3a08
commit
e578c17d81
@ -23,6 +23,7 @@
|
|||||||
#ifndef FRONTEND
|
#ifndef FRONTEND
|
||||||
#include "common/unicode_normprops_table.h"
|
#include "common/unicode_normprops_table.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "port/pg_bswap.h"
|
||||||
|
|
||||||
#ifndef FRONTEND
|
#ifndef FRONTEND
|
||||||
#define ALLOC(size) palloc(size)
|
#define ALLOC(size) palloc(size)
|
||||||
@ -475,7 +476,7 @@ qc_hash_lookup(pg_wchar ch, const pg_unicode_norminfo *norminfo)
|
|||||||
* Compute the hash function. The hash key is the codepoint with the bytes
|
* Compute the hash function. The hash key is the codepoint with the bytes
|
||||||
* in network order.
|
* in network order.
|
||||||
*/
|
*/
|
||||||
hashkey = htonl(ch);
|
hashkey = pg_hton32(ch);
|
||||||
h = norminfo->hash(&hashkey);
|
h = norminfo->hash(&hashkey);
|
||||||
|
|
||||||
/* An out-of-range result implies no match */
|
/* An out-of-range result implies no match */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user