summaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-04-23 16:53:15 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-04-23 16:53:15 -0400
commitbdf7744f7375128be4eae6a72a9c9e3c65043558 (patch)
tree329ff77f97f3748eba8d2c5ab374f72632e1a9f0 /src/interfaces
parent3debaa603ffbc3927e263ae3c7c23b0fcfbd8def (diff)
Rename strtoi() to strtoint().
NetBSD has seen fit to invent a libc function named strtoi(), which conflicts with the long-established static functions of the same name in datetime.c and ecpg's interval.c. While muttering darkly about intrusions on application namespace, we'll rename our functions to avoid the conflict. Back-patch to all supported branches, since this would affect attempts to build any of them on recent NetBSD. Thomas Munro
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/ecpg/pgtypeslib/interval.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/pgtypeslib/interval.c b/src/interfaces/ecpg/pgtypeslib/interval.c
index 01825bd688e..7e1c13d56d4 100644
--- a/src/interfaces/ecpg/pgtypeslib/interval.c
+++ b/src/interfaces/ecpg/pgtypeslib/interval.c
@@ -16,7 +16,7 @@
/* copy&pasted from .../src/backend/utils/adt/datetime.c */
static int
-strtoi(const char *nptr, char **endptr, int base)
+strtoint(const char *nptr, char **endptr, int base)
{
long val;
@@ -448,7 +448,7 @@ DecodeInterval(char **field, int *ftype, int nf, /* int range, */
}
errno = 0;
- val = strtoi(field[i], &cp, 10);
+ val = strtoint(field[i], &cp, 10);
if (errno == ERANGE)
return DTERR_FIELD_OVERFLOW;
@@ -457,7 +457,7 @@ DecodeInterval(char **field, int *ftype, int nf, /* int range, */
/* SQL "years-months" syntax */
int val2;
- val2 = strtoi(cp + 1, &cp, 10);
+ val2 = strtoint(cp + 1, &cp, 10);
if (errno == ERANGE || val2 < 0 || val2 >= MONTHS_PER_YEAR)
return DTERR_FIELD_OVERFLOW;
if (*cp != '\0')