1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index 0652cb4..02b6ebf 100644
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -559,41 +559,6 @@ long long int rep_strtoll(const char *str, char **endptr, int base)
#endif /* HAVE_STRTOLL */
-#ifndef HAVE_STRTOULL
-unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
-{
-#ifdef HAVE_STRTOUQ
- return strtouq(str, endptr, base);
-#elif defined(HAVE___STRTOULL)
- return __strtoull(str, endptr, base);
-#elif SIZEOF_LONG == SIZEOF_LONG_LONG
- return (unsigned long long int) strtoul(str, endptr, base);
-#else
-# error "You need a strtoull function"
-#endif
-}
-#else
-#ifdef HAVE_BSD_STRTOLL
-#undef strtoull
-unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
-{
- int saved_errno = errno;
- unsigned long long int nb = strtoull(str, endptr, base);
- /* With glibc EINVAL is only returned if base is not ok */
- if (errno == EINVAL) {
- if (base == 0 || (base >1 && base <37)) {
- /* Base was ok so it's because we were not
- * able to make the conversion.
- * Let's reset errno.
- */
- errno = saved_errno;
- }
- }
- return nb;
-}
-#endif /* HAVE_BSD_STRTOLL */
-#endif /* HAVE_STRTOULL */
-
#ifndef HAVE_SETENV
int rep_setenv(const char *name, const char *value, int overwrite)
{
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index a8910e2..854b1a7 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -394,16 +394,6 @@ long long int rep_strtoll(const char *str, char **endptr, int base);
#endif
#endif
-#ifndef HAVE_STRTOULL
-#define strtoull rep_strtoull
-unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
-#else
-#ifdef HAVE_BSD_STRTOLL /* yes, it's not HAVE_BSD_STRTOULL */
-#define strtoull rep_strtoull
-unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
-#endif
-#endif
-
#ifndef HAVE_FTRUNCATE
#define ftruncate rep_ftruncate
int rep_ftruncate(int,off_t);
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 4c774d9..a1dc6d0 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -411,7 +411,7 @@ def configure(conf):
conf.CHECK_FUNCS('initgroups pread pwrite strndup strcasestr strsep')
conf.CHECK_FUNCS('strtok_r mkdtemp dup2 dprintf vdprintf isatty chown lchown')
conf.CHECK_FUNCS('link readlink symlink realpath snprintf vsnprintf')
- conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
+ conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen')
conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memalign posix_memalign')
conf.CHECK_FUNCS('fmemopen')
@@ -866,7 +866,7 @@ REPLACEMENT_FUNCTIONS = {
'memmove', 'strdup', 'setlinebuf', 'vsyslog', 'strnlen',
'strndup', 'waitpid', 'seteuid', 'setegid', 'chroot',
'mkstemp', 'mkdtemp', 'pread', 'pwrite', 'strcasestr',
- 'strsep', 'strtok_r', 'strtoll', 'strtoull', 'setenv', 'unsetenv',
+ 'strsep', 'strtok_r', 'strtoll', 'setenv', 'unsetenv',
'utime', 'utimes', 'dup2', 'chown', 'link', 'readlink',
'symlink', 'lchown', 'realpath', 'memmem', 'vdprintf',
'dprintf', 'get_current_dir_name', 'copy_file_range',
|