aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/encode.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-02-28 18:33:45 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2018-02-28 18:33:45 -0500
commit679df2b8d8a517388a3456f9826c0ceadc2ac4e1 (patch)
treecbf4977f57af3750be0591a6bff0acf1e71a254a /src/backend/utils/adt/encode.c
parente459eb9fb0c2af5c1363327df7ed0db3ab0042d2 (diff)
downloadpostgresql-679df2b8d8a517388a3456f9826c0ceadc2ac4e1.tar.gz
postgresql-679df2b8d8a517388a3456f9826c0ceadc2ac4e1.zip
Rename base64 routines to avoid conflict with Solaris built-in functions.
Solaris 11.4 has built-in functions named b64_encode and b64_decode. Rename ours to something else to avoid the conflict (fortunately, ours are static so the impact is limited). One could wish for less duplication of code in this area, but that would be a larger patch and not very suitable for back-patching. Since this is a portability fix, we want to put it into all supported branches. Report and initial patch by Rainer Orth, reviewed and adjusted a bit by Michael Paquier Discussion: https://postgr.es/m/ydd372wk28h.fsf@CeBiTec.Uni-Bielefeld.DE
Diffstat (limited to 'src/backend/utils/adt/encode.c')
-rw-r--r--src/backend/utils/adt/encode.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/utils/adt/encode.c b/src/backend/utils/adt/encode.c
index f4216fb7950..352f6cc83d9 100644
--- a/src/backend/utils/adt/encode.c
+++ b/src/backend/utils/adt/encode.c
@@ -215,7 +215,7 @@ static const int8 b64lookup[128] = {
};
static unsigned
-b64_encode(const char *src, unsigned len, char *dst)
+pg_base64_encode(const char *src, unsigned len, char *dst)
{
char *p,
*lend = dst + 76;
@@ -262,7 +262,7 @@ b64_encode(const char *src, unsigned len, char *dst)
}
static unsigned
-b64_decode(const char *src, unsigned len, char *dst)
+pg_base64_decode(const char *src, unsigned len, char *dst)
{
const char *srcend = src + len,
*s = src;
@@ -332,14 +332,14 @@ b64_decode(const char *src, unsigned len, char *dst)
static unsigned
-b64_enc_len(const char *src, unsigned srclen)
+pg_base64_enc_len(const char *src, unsigned srclen)
{
/* 3 bytes will be converted to 4, linefeed after 76 chars */
return (srclen + 2) * 4 / 3 + srclen / (76 * 3 / 4);
}
static unsigned
-b64_dec_len(const char *src, unsigned srclen)
+pg_base64_dec_len(const char *src, unsigned srclen)
{
return (srclen * 3) >> 2;
}
@@ -532,7 +532,7 @@ static const struct
{
"base64",
{
- b64_enc_len, b64_dec_len, b64_encode, b64_decode
+ pg_base64_enc_len, pg_base64_dec_len, pg_base64_encode, pg_base64_decode
}
},
{