Change to dclare `strlcat` and `strlcpy` conditionally

They should be declared only for the case missing.
Current prototype signatures should be for suppliment implementations
in TDE core library.
It may differ than platform builtin one, 3rd argment is `size_t',
so it cause prototype mismatch for the case `size_t` != `unsigned long`.

Signed-off-by: OBATA Akio <obache@wizdas.com>
(cherry picked from commit d3b49e3ec5)
pull/38/head
OBATA Akio 6 years ago committed by Slávek Banko
parent 5b86cdcea2
commit 9e4dd173ab
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -45,3 +45,6 @@ if( WITH_SLP )
tde_message_fatal( "openslp is required, but was not found on your system" )
endif( )
endif( )
check_symbol_exists( strlcat "string.h" HAVE_STRLCAT_PROTO )
check_symbol_exists( strlcpy "string.h" HAVE_STRLCPY_PROTO )

@ -62,9 +62,24 @@
// wifi
#cmakedefine WITHOUT_ARTS 1
/* Define if you have the strlcat prototype */
#cmakedefine HAVE_STRLCAT_PROTO
/* Define if you have the strlcpy prototype */
#cmakedefine HAVE_STRLCPY_PROTO
#if !defined(HAVE_STRLCAT_PROTO)
#ifdef __cplusplus
extern "C" {
unsigned long strlcpy(char*, const char*, unsigned long);
unsigned long strlcat(char*, const char*, unsigned long);
}
#endif
#endif
#if !defined(HAVE_STRLCPY_PROTO)
#ifdef __cplusplus
extern "C" {
unsigned long strlcpy(char*, const char*, unsigned long);
}
#endif
#endif

Loading…
Cancel
Save