Subject: Re: [PATCH] Undefine strlcpy if needed.

From: Ramsay Jones <[email-masked]>
Date: Sun, 24 Aug 2014 12:10:16 +0100

On 24/08/14 05:35, Benoit Sigoure wrote:
> On OS X, strlcpy is already #define'd, which causes warnings
> in all the files that include `git-compat-util.h'.  Note that
> this only occurs when building without running ./configure.
> 
> Signed-off-by: Benoit Sigoure <[email-masked]>
> ---
> 
> Resending with the SOB line I forgot.
> 
>  git-compat-util.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/git-compat-util.h b/git-compat-util.h
> index f587749..8c001e2 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -495,6 +495,9 @@ extern char *gitstrcasestr(const char *haystack, const char *needle);
>  #endif
>  
>  #ifdef NO_STRLCPY
> +#ifdef strlcpy
> +#undef strlcpy
> +#endif

If strlcpy is #defined, then presumably NO_STRLCPY should not be set, no?

>  #define strlcpy gitstrlcpy
>  extern size_t gitstrlcpy(char *, const char *, size_t);
>  #endif
> 

Hmm, which version of OS X are we talking about?

config.mak.uname contains this:

        ifeq ($(shell expr "$(uname_R)" : '[15]\.'),2)
                NO_STRLCPY = YesPlease

What does ./configure put in config.mak.autogen for NO_STRLCPY?

(sorry, I don't have access to any version of OS X, so I can't
offer much help on this).

ATB,
Ramsay Jones