... | ... |
@@ -134,6 +134,8 @@ m4_include([m4/reorganization/libs/curl.m4]) |
134 | 134 |
|
135 | 135 |
m4_include([m4/reorganization/substitutions.m4]) |
136 | 136 |
|
137 |
+m4_include([m4/reorganization/strni.m4]) |
|
138 |
+ |
|
137 | 139 |
AM_CONDITIONAL([ENABLE_CLAMSUBMIT], [test "$have_curl" = "yes"]) |
138 | 140 |
|
139 | 141 |
AC_CONFIG_FILES([ |
... | ... |
@@ -460,7 +460,7 @@ const char* cli_strcasestr(const char* a, const char *b) |
460 | 460 |
} |
461 | 461 |
#endif |
462 | 462 |
|
463 |
-#ifndef HAVE_STRNLEN |
|
463 |
+#if !defined(HAVE_STRNLEN) || defined(HAVE_STRNI) |
|
464 | 464 |
size_t cli_strnlen(const char *s, size_t n) |
465 | 465 |
{ |
466 | 466 |
size_t i = 0; |
... | ... |
@@ -469,7 +469,7 @@ size_t cli_strnlen(const char *s, size_t n) |
469 | 469 |
} |
470 | 470 |
#endif |
471 | 471 |
|
472 |
-#ifndef HAVE_STRNDUP |
|
472 |
+#if !defined(HAVE_STRNDUP) || defined(HAVE_STRNI) |
|
473 | 473 |
char *cli_strndup(const char *s, size_t n) |
474 | 474 |
{ |
475 | 475 |
char *alloc; |
... | ... |
@@ -33,13 +33,13 @@ |
33 | 33 |
const char *cli_strcasestr(const char *haystack, const char *needle); |
34 | 34 |
#endif |
35 | 35 |
|
36 |
-#ifdef HAVE_STRNDUP |
|
36 |
+#if defined(HAVE_STRNDUP) && !defined(HAVE_STRNI) |
|
37 | 37 |
#define cli_strndup strndup |
38 | 38 |
#else |
39 | 39 |
char *cli_strndup(const char *s, size_t n); |
40 | 40 |
#endif |
41 | 41 |
|
42 |
-#ifdef HAVE_STRNLEN |
|
42 |
+#if defined(HAVE_STRNLEN) && !defined(HAVE_STRNI) |
|
43 | 43 |
#define cli_strnlen strnlen |
44 | 44 |
#else |
45 | 45 |
size_t cli_strnlen(const char *s, size_t n); |
46 | 46 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,12 @@ |
0 |
+ |
|
1 |
+AC_ARG_ENABLE([strni], |
|
2 |
+[AS_HELP_STRING([--enable-strni], |
|
3 |
+[enables explicit use of internal strn functions to support cross-compilation against older libs])], |
|
4 |
+enable_strni=$enableval, enable_strni="no") |
|
5 |
+ |
|
6 |
+if test "$enable_strni" = "yes"; then |
|
7 |
+ AC_DEFINE([HAVE_STRNI],1,[using internal strn functions]) |
|
8 |
+ AC_SUBST([HAVE_STRNI]) |
|
9 |
+fi |
|
10 |
+ |
|
11 |
+ |