All of lore.kernel.org
 help / color / mirror / Atom feed
* should i18n.h include misc.h if internal ?
@ 2009-11-23 23:50 Carles Pina i Estany
  2009-11-24 12:12 ` Robert Millan
  0 siblings, 1 reply; 2+ messages in thread
From: Carles Pina i Estany @ 2009-11-23 23:50 UTC (permalink / raw)
  To: grub-devel


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'
--- include/grub/i18n.h 2009-11-23 20:34:42 +0000
+++ include/grub/i18n.h 2009-11-23 23:46:19 +0000
@@ -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,

-- 
Carles Pina i Estany
	http://pinux.info



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: should i18n.h include misc.h if internal ?
  2009-11-23 23:50 should i18n.h include misc.h if internal ? Carles Pina i Estany
@ 2009-11-24 12:12 ` Robert Millan
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Millan @ 2009-11-24 12:12 UTC (permalink / raw)
  To: The development of GNU GRUB

On Mon, Nov 23, 2009 at 11:50:20PM +0000, Carles Pina i Estany wrote:
> 
> 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.

-- 
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."



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-24 12:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-23 23:50 should i18n.h include misc.h if internal ? Carles Pina i Estany
2009-11-24 12:12 ` Robert Millan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.