git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] This PR enables a successful git build on z/OS.

From
René Scharfe <l.s.r@web.de>
Date
Dec 5, 2023, 20:58 UTC
Message-ID
<ea020e16-7d07-4fa0-84b1-5d2f76a6fe34@web.de>
In-Reply-To
<CAPig+cQ8eEU0TOoBf2KavTyf0OLhNtmOzs8+WqZy9JMXa=ydPQ@mail.gmail.com>
Am 04.12.23 um 22:46 schrieb Eric Sunshine:
Show 36 quoted lines
> 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

Previous: Eric Sunshine
Message 21 of 21 in “Enabling z/OS workflow for git”
  1. 00/13 Enabling z/OS workflow for gitHaritha via GitGitGadget, Nov 13, 2023
  2. 01/13 Enabling z/OS workflow for gitHaritha D via GitGitGadget, Nov 13, 2023
  3. 03/13 spaces and errors fix Handled git pipeline errorsHaritha D via GitGitGadget, Nov 13, 2023
  4. Junio C HamanoNov 14, 2023
  5. 04/13 fixes for build errors Handled git pipeline errorseHaritha D via GitGitGadget, Nov 13, 2023
  6. 05/13 fixes for build errorsHaritha D via GitGitGadget, Nov 13, 2023
  7. 06/13 spaces and errors fix Handled git pipeline errorsHaritha D via GitGitGadget, Nov 13, 2023
  8. 02/13 Enable builds for z/OS.Haritha D via GitGitGadget, Nov 13, 2023
  9. brian m. carlsonNov 13, 2023
  10. Junio C HamanoNov 14, 2023
  11. Junio C HamanoNov 14, 2023
  12. 07/13 spaces and errors fix Handled git pipeline errorsHaritha D via GitGitGadget, Nov 13, 2023
  13. 08/13 platform_name fix Handled git pipeline errorsHaritha D via GitGitGadget, Nov 13, 2023
  14. 09/13 strncpy fix Handled git pipeline errorsHaritha D via GitGitGadget, Nov 13, 2023
  15. 10/13 strncpy fix Handled git pipeline errorsHaritha D via GitGitGadget, Nov 13, 2023
  16. 11/13 strncpy fix Handled git pipeline errorsHaritha D via GitGitGadget, Nov 13, 2023
  17. 12/13 Handled git pipeline errors - Memory leakHaritha D via GitGitGadget, Nov 13, 2023
  18. 13/13 Handled git pipeline errors - z/OS enableHaritha D via GitGitGadget, Nov 13, 2023
  19. This PR enables a successful git build on z/OS.Haritha via GitGitGadget, Dec 4, 2023
  20. Eric SunshineDec 4, 2023
  21. René ScharfeDec 5, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.