summaryrefslogtreecommitdiff
path: root/ext/mysql/libmysql/strto.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysql/libmysql/strto.c')
-rw-r--r--ext/mysql/libmysql/strto.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ext/mysql/libmysql/strto.c b/ext/mysql/libmysql/strto.c
index 0e1af5d2e7..b858ef19ea 100644
--- a/ext/mysql/libmysql/strto.c
+++ b/ext/mysql/libmysql/strto.c
@@ -28,13 +28,17 @@ This file is public domain and comes with NO WARRANTY of any kind */
#include "my_sys.h" /* defines errno */
#include <errno.h>
-#ifdef MYSQL_LONGLONG
+#undef strtoull
+#undef strtoll
+#undef strtoul
+#undef strtol
+#ifdef USE_LONGLONG
#define UTYPE_MAX (~(ulonglong) 0)
#define TYPE_MIN LONGLONG_MIN
#define TYPE_MAX LONGLONG_MAX
#define longtype longlong
#define ulongtype ulonglong
-#ifdef UNSIGNED
+#ifdef USE_UNSIGNED
#define function ulongtype strtoull
#else
#define function longtype strtoll
@@ -45,7 +49,7 @@ This file is public domain and comes with NO WARRANTY of any kind */
#define TYPE_MAX LONG_MAX
#define longtype long
#define ulongtype unsigned long
-#ifdef UNSIGNED
+#ifdef USE_UNSIGNED
#define function ulongtype strtoul
#else
#define function longtype strtol
@@ -156,7 +160,7 @@ function (const char *nptr,char **endptr,int base)
if (endptr != NULL)
*endptr = (char *) s;
-#ifndef UNSIGNED
+#ifndef USE_UNSIGNED
/* Check for a value that is within the range of
`unsigned long int', but outside the range of `long int'. */
if (negative)
@@ -171,7 +175,7 @@ function (const char *nptr,char **endptr,int base)
if (overflow)
{
my_errno=ERANGE;
-#ifdef UNSIGNED
+#ifdef USE_UNSIGNED
return UTYPE_MAX;
#else
return negative ? TYPE_MIN : TYPE_MAX;
@@ -179,7 +183,7 @@ function (const char *nptr,char **endptr,int base)
}
/* Return the result of the appropriate sign. */
- return (negative ? -((longtype) i) : i);
+ return (negative ? -((longtype) i) : (longtype) i);
noconv:
/* There was no number to convert. */