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

Re: [PATCH/RFC v7 1/2] Add infrastructure for translating Git with gettext

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jun 5, 2010, 18:59 UTC
Message-ID
<20100605185926.GA5273@progeny.tock>
In-Reply-To
<AANLkTim3PcoLrYb46Bh3tK7Ir3v-K0EQ0czPaD5DIIOK@mail.gmail.com>
Hi Ævar,
Thanks for trying it out.
Ævar Arnfjörð Bjarmason wrote:
Show 12 quoted lines
> --- a/gettext.c
> +++ b/gettext.c
> @@ -1,11 +1,8 @@
> -#ifdef NO_GETTEXT
> -void git_setup_gettext(void) {}
> -#else
>  #include "exec_cmd.h"
>  #include <libintl.h>
>  #include <stdlib.h>
> 
> -void git_setup_gettext(void) {
> +inline void git_setup_gettext(void) {

This should not be inline when NO_GETTEXT is unset, since other translation units don’t get a chance to see the definition.

Show 14 quoted lines
> diff --git a/gettext.h b/gettext.h
> index a99da6a..8d44808 100644
> --- a/gettext.h
> +++ b/gettext.h
> @@ -1,7 +1,11 @@
>  #ifndef GETTEXT_H
>  #define GETTEXT_H
> 
> -void git_setup_gettext(void);
> +#ifdef NO_GETTEXT
> +static inline void git_setup_gettext(void) {}
> +#else
> +inline void git_setup_gettext(void);
> +#endif
With s/^inline \(.*;\)/extern &/, to make it:
 -void git_setup_gettext(void);
 +#ifdef NO_GETTEXT
 +static inline void git_setup_gettext(void) {}
 +#else
 +extern void git_setup_gettext(void);
 +#endif

this part is exactly how I was imagining it (i.e., like might_fault() in linux-2.6/include/linux/kernel.h and many other examples).

Thanks again. Jonathan

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 14 of 19 in “Add infrastructure for translating Git with gettext”
  1. 0/2 Add infrastructure for translating Git with gettextÆvar Arnfjörð Bjarmason, Jun 5, 2010
  2. 1/2 Add infrastructure for translating Git with gettextÆvar Arnfjörð Bjarmason, Jun 5, 2010
  3. Jonathan NiederJun 5, 2010
  4. Ævar Arnfjörð BjarmasonJun 5, 2010
  5. Jonathan NiederJun 5, 2010
  6. Ævar Arnfjörð BjarmasonJun 5, 2010
  7. Jonathan NiederJun 5, 2010
  8. Ævar Arnfjörð BjarmasonJun 5, 2010
  9. Jonathan NiederJun 12, 2010
  10. Jonathan NiederJun 5, 2010
  11. Ævar Arnfjörð BjarmasonJun 5, 2010
  12. Jonathan NiederJun 5, 2010
  13. Ævar Arnfjörð BjarmasonJun 5, 2010
  14. Jonathan NiederJun 5, 2010
  15. Ævar Arnfjörð BjarmasonJun 5, 2010
  16. Inline functions (Re: [PATCH/RFC v7 1/2] Add infrastructure for translating Git with gettext)Jonathan Nieder, Jun 5, 2010
  17. Jakub NarebskiJun 5, 2010
  18. Ævar Arnfjörð BjarmasonJun 5, 2010
  19. 2/2 Add initial C, Shell and Perl gettext translationsÆvar Arnfjörð Bjarmason, Jun 5, 2010

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.