git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Eric Sunshine <sunshine@sunshineco.com>,
	Haritha via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	Haritha D <harithamma.d@ibm.com>
Subject: Re: [PATCH v2] This PR enables a successful git build on z/OS.
Date: Tue, 5 Dec 2023 21:58:25 +0100	[thread overview]
Message-ID: <ea020e16-7d07-4fa0-84b1-5d2f76a6fe34@web.de> (raw)
In-Reply-To: <CAPig+cQ8eEU0TOoBf2KavTyf0OLhNtmOzs8+WqZy9JMXa=ydPQ@mail.gmail.com>

Am 04.12.23 um 22:46 schrieb Eric Sunshine:
> On Mon, Dec 4, 2023 at 9:19 AM Haritha via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>> diff --git a/fetch-negotiator.h b/fetch-negotiator.h
>> @@ -47,7 +47,7 @@ struct fetch_negotiator {
>> -       void (*release)(struct fetch_negotiator *);
>> +       void (*release_negotiator)(struct fetch_negotiator *);> diff --git a/fetch-pack.c b/fetch-pack.c
>> @@ -1232,7 +1232,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
>>         if (negotiator)
>> -               negotiator->release(negotiator);
>> +               negotiator->release_negotiator(negotiator);
>>         return ref;
>>  }
>> diff --git a/git-compat-util.h b/git-compat-util.h
>> @@ -223,7 +223,15 @@ struct strbuf;
>> +#ifdef __MVS__
>> +       #define release stdlib_release
>> +       #define fetch stdlib_fetch
>> +#endif
>>  #include <stdlib.h>
>> +#ifdef __MVS__
>> +       #undef fetch
>> +       #undef release
>> +#endif
>
> So, the problem is that z/OS is polluting the C namespace or the
> preprocessor namespace with names "release" and "fetch"? When we've
> run across this problem on other platforms, we modify
> git-compat-util.h or some other files in compat/ to suppress the
> pollution introduced by the platform headers rather than "fixing" the
> Git source code. For instance, if "release" and "fetch" are macros on
> z/OS, then you may be able to simply #undef them after pulling in
> whichever z/OS header defines them. If they are actual system
> functions (rather than macros), you may be able to employ the
> #undef/#define dance to rename them to something else, such as
> "zos_release" and "zos_fetch" _before_ including the system header
> which declares those functions.

I assume that [1] and [2] link to the documentation of these functions.
Both pages include the following paragraph:

   "To avoid infringing on the user's name space, this nonstandard
    function has two names. One name is prefixed with two underscore
    characters, and one name is not. The name without the prefix
    underscore characters is exposed only when using the runtime library
    extensions."

[3] defines "runtime library extensions" and mentions the macro __EXT
and LANGLVL(EXTENDED).  Do you need those extensions?  If you don't then
perhaps turning them off avoids the name collisions without needing to
change the code?

René


[1] https://www.ibm.com/docs/en/zos/3.1.0?topic=functions-fetch-get-load-module
[2] https://www.ibm.com/docs/en/zos/3.1.0?topic=functions-release-delete-load-module
[3] https://www.ibm.com/docs/en/zos/3.1.0?topic=reference-zos-cc-compiler-feature#compiler_feature__ext_lib_func


      reply	other threads:[~2023-12-05 20:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13 10:24 [PATCH 00/13] Enabling z/OS workflow for git Haritha  via GitGitGadget
2023-11-13 10:24 ` [PATCH 01/13] " Haritha D via GitGitGadget
2023-11-13 10:24 ` [PATCH 02/13] Enable builds for z/OS Haritha D via GitGitGadget
2023-11-13 23:03   ` brian m. carlson
2023-11-14  1:47     ` Junio C Hamano
2023-11-14  0:48   ` Junio C Hamano
2023-11-13 10:24 ` [PATCH 03/13] spaces and errors fix Handled git pipeline errors Haritha D via GitGitGadget
2023-11-14  0:38   ` Junio C Hamano
2023-11-13 10:24 ` [PATCH 04/13] fixes for build errors Handled git pipeline errorse Haritha D via GitGitGadget
2023-11-13 10:24 ` [PATCH 05/13] fixes for build errors Haritha D via GitGitGadget
2023-11-13 10:24 ` [PATCH 06/13] spaces and errors fix Handled git pipeline errors Haritha D via GitGitGadget
2023-11-13 10:24 ` [PATCH 07/13] " Haritha D via GitGitGadget
2023-11-13 10:24 ` [PATCH 08/13] platform_name " Haritha D via GitGitGadget
2023-11-13 10:24 ` [PATCH 09/13] strncpy " Haritha D via GitGitGadget
2023-11-13 10:24 ` [PATCH 10/13] " Haritha D via GitGitGadget
2023-11-13 10:24 ` [PATCH 11/13] " Haritha D via GitGitGadget
2023-11-13 10:24 ` [PATCH 12/13] Handled git pipeline errors - Memory leak Haritha D via GitGitGadget
2023-11-13 10:24 ` [PATCH 13/13] Handled git pipeline errors - z/OS enable Haritha D via GitGitGadget
2023-12-04 14:19 ` [PATCH v2] This PR enables a successful git build on z/OS Haritha  via GitGitGadget
2023-12-04 21:46   ` Eric Sunshine
2023-12-05 20:58     ` René Scharfe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea020e16-7d07-4fa0-84b1-5d2f76a6fe34@web.de \
    --to=l.s.r@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=harithamma.d@ibm.com \
    --cc=sandals@crustytoothpaste.net \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).