threads / patch / 22901

patchFix _XOPEN_SOURCE problem on DragonFly

Subject: [PATCH] Fix _XOPEN_SOURCE problem on DragonFly

## tl;dr

4 messages between Mar 4, 2010 and Apr 2, 2010. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

YONETANI Tomokazu· Mar 4, 2010, 02:05 UTC · lore

Hi. DragonFly has the same problem that FreeBSD used to have. Since the return value of implicitly declared functions defaults to int, it can cause disasters on architectures where sizeof(int) < sizeof(void *). The patch below should address this issue.

Best regards, YONETANI Tomokazu.

Show changes to git-compat-util.h +2 −1
diff --git a/git-compat-util.h b/git-compat-util.h
index a3c4537..e292926 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -55,7 +55,8 @@
 # else
 # define _XOPEN_SOURCE 500
 # endif
-#elif !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX) && !defined(sgi)
+#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
+      !defined(_M_UNIX) && !defined(sgi) && !defined(__DragonFly__)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
YONETANI Tomokazu· Apr 1, 2010, 07:37 UTC · re: YONETANI Tomokazu · lore

Re: [PATCH] Fix _XOPEN_SOURCE problem on DragonFly

Hello. Is there anything else I need to do to get this in?

On Thu, Mar 04, 2010 at 11:05:22AM +0900, YONETANI Tomokazu wrote:
Show 23 quoted lines
> Hi.
> DragonFly has the same problem that FreeBSD used to have.  Since the
> return value of implicitly declared functions defaults to int, it can
> cause disasters on architectures where sizeof(int) < sizeof(void *).
> The patch below should address this issue.
> 
> Best regards,
> YONETANI Tomokazu.
> 
> diff --git a/git-compat-util.h b/git-compat-util.h
> index a3c4537..e292926 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -55,7 +55,8 @@
>  # else
>  # define _XOPEN_SOURCE 500
>  # endif
> -#elif !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX) && !defined(sgi)
> +#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
> +      !defined(_M_UNIX) && !defined(sgi) && !defined(__DragonFly__)
>  #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
>  #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
>  #endif
Tay Ray Chuan· Apr 1, 2010, 14:37 UTC · re: YONETANI Tomokazu · lore

Re: [PATCH] Fix _XOPEN_SOURCE problem on DragonFly

Hi,
On Thu, Apr 1, 2010 at 3:37 PM, YONETANI Tomokazu <qhwt+git@les.ath.cx> wrote:
> Hello.
> Is there anything else I need to do to get this in?
you should read Documentation/SubmittingPatches:
  http://github.com/git/git/blob/HEAD/Documentation/SubmittingPatches
Briefly,
1. Generate your patch with git-format-patch.
2. s-o-b.
-- 
Cheers,
Ray Chuan
YONETANI Tomokazu· Apr 2, 2010, 08:02 UTC · re: Tay Ray Chuan · lore

Re: [PATCH] Fix _XOPEN_SOURCE problem on DragonFly

On Thu, Apr 01, 2010 at 10:37:48PM +0800, Tay Ray Chuan wrote:
Show 13 quoted lines
> On Thu, Apr 1, 2010 at 3:37 PM, YONETANI Tomokazu <qhwt+git@les.ath.cx> wrote:
> > Hello.
> > Is there anything else I need to do to get this in?
> 
> you should read Documentation/SubmittingPatches:
> 
>   http://github.com/git/git/blob/HEAD/Documentation/SubmittingPatches
> 
> Briefly,
> 
> 1. Generate your patch with git-format-patch.
> 
> 2. s-o-b.

I *thought* having read something like that before :) Thanks for the hint. I just re-submitted the patch to meet the requirement. Hopefully the new one won't annoy anyone.

Best regards, YONETANI Tomokazu.

← back to recent threads