Skip to contentSkip to conversation

should i18n.h include misc.h if internal ?

PATCH Carles Pina i Estany 2 participants 2 messages Nov 23, 2009 – Nov 24, 2009

lore
Share & tools
lore
#0 lore raw

Hello,

Imagine that I'm going to gettexttize commands/true.c . I need to add #include <grub/i18n.h> , but this include defines:

# define _(str) grub_gettext(str)

so I need #include <grub/misc.h>

Any problem with this patch:

=== modified file 'include/grub/i18n.h'

grub/i18n.h 2009-11-23 23:46:19 +0000 renamed from grub/i18n.h 2009-11-23 20:34:42 +0000 +1 -0
@@ -24,6 +24,7 @@
 # include <libintl.h>
 # define _(str) gettext(str)
 #else
+# include <grub/misc.h>
 # define _(str) grub_gettext(str)
 #endif
 

Other option would be to move these:
----
const char *EXPORT_FUNC(grub_gettext_dummy) (const char *s); extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
----

from misc.h to i18n.h (internal). I haven't tested but if it works it includes less things of course and could be better if it's not needed.

Thanks,

Signature · 2 lines
Carles Pina i Estany
	http://pinux.info
#1 lore raw
Quoted 8 lines · Carles Pina i Estany

Other option would be to move these:
----
const char *EXPORT_FUNC(grub_gettext_dummy) (const char *s); extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
----

from misc.h to i18n.h (internal).

Yes, they belong there. Make sure they're wrapped around #ifndef GRUB_UTIL.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."