Commit 64f1410b authored by Morten Welinder's avatar Morten Welinder

Compilation: avoid textdomain as a Gnumeric variable, part 2

It can evidently be a macro on some systems and we get into problems
with order-of-includes or worse.
parent c57ac947
......@@ -46,7 +46,7 @@
#include <gtk/gtk.h>
#include <string.h>
#define F2(func,s) dgettext ((func)->textdomain->str, (s))
#define F2(func,s) dgettext ((func)->tdomain->str, (s))
#define FUNCTION_SELECT_KEY "function-selector-dialog"
#define FUNCTION_SELECT_HELP_KEY "function-selector-dialog-help-mode"
......
......@@ -35,7 +35,7 @@
#include <string.h>
#include <stdlib.h>
#define F2(func,s) dgettext ((func)->textdomain->str, (s))
#define F2(func,s) dgettext ((func)->tdomain->str, (s))
static GList *categories;
static GnmFuncGroup *unknown_cat;
......@@ -370,8 +370,8 @@ gnm_func_free (GnmFunc *func)
g_free ((char *)func->name);
if (func->textdomain)
go_string_unref (func->textdomain);
if (func->tdomain)
go_string_unref (func->tdomain);
gnm_func_clear_arg_names (func);
......@@ -483,7 +483,7 @@ gnm_func_lookup_prefix (char const *prefix, Workbook *scope, gboolean trans)
GnmFunc *
gnm_func_add (GnmFuncGroup *fn_group,
GnmFuncDescriptor const *desc,
const char *textdomain)
const char *tdomain)
{
static char const valid_tokens[] = "fsbraAES?|";
GnmFunc *func;
......@@ -494,12 +494,12 @@ gnm_func_add (GnmFuncGroup *fn_group,
func = g_new (GnmFunc, 1);
if (!textdomain)
textdomain = GETTEXT_PACKAGE;
if (!tdomain)
tdomain = GETTEXT_PACKAGE;
func->name = g_strdup (desc->name);
func->help = desc->help ? desc->help : NULL;
func->textdomain = go_string_new (textdomain);
func->tdomain = go_string_new (tdomain);
func->linker = desc->linker;
func->usage_notify = desc->usage_notify;
func->flags = desc->flags;
......@@ -560,14 +560,14 @@ unknownFunctionHandler (GnmFuncEvalInfo *ei,
* gnm_func_upgrade_placeholder:
* @fd:
* @fn_group:
* @textdomain:
* @tdomain:
* @load_desc: (scope async):
* @opt_usage_notify: (scope async):
**/
void
gnm_func_upgrade_placeholder (GnmFunc *fd,
GnmFuncGroup *fn_group,
const char *textdomain,
const char *tdomain,
GnmFuncLoadDesc load_desc,
GnmFuncUsageNotify opt_usage_notify)
{
......@@ -575,8 +575,8 @@ gnm_func_upgrade_placeholder (GnmFunc *fd,
g_return_if_fail (fd->flags & GNM_FUNC_IS_PLACEHOLDER);
g_return_if_fail (fn_group != NULL);
if (!textdomain)
textdomain = GETTEXT_PACKAGE;
if (!tdomain)
tdomain = GETTEXT_PACKAGE;
/* Remove from unknown_cat */
gnm_func_group_remove_func (fd->fn_group, fd);
......@@ -585,8 +585,8 @@ gnm_func_upgrade_placeholder (GnmFunc *fd,
fd->fn.load_desc = load_desc;
fd->usage_notify = opt_usage_notify;
go_string_unref (fd->textdomain);
fd->textdomain = go_string_new (textdomain);
go_string_unref (fd->tdomain);
fd->tdomain = go_string_new (tdomain);
/* Clear localized_name so we can deduce the proper name. */
gnm_func_set_localized_name (fd, NULL);
......
......@@ -190,7 +190,7 @@ struct _GnmFunc {
char const *name;
GPtrArray *arg_names_p;
GnmFuncHelp const *help;
GOString *textdomain;
GOString *tdomain;
char *localized_name;
GnmFuncType fn_type;
union {
......@@ -236,7 +236,7 @@ GSList *gnm_func_lookup_prefix (char const *prefix, Workbook *scope,
gboolean trans);
GnmFunc *gnm_func_add (GnmFuncGroup *group,
GnmFuncDescriptor const *descriptor,
const char *textdomain);
const char *tdomain);
GnmFunc *gnm_func_add_placeholder (Workbook *optional_scope,
char const *name,
char const *type);
......@@ -245,7 +245,7 @@ GnmFunc *gnm_func_lookup_or_add_placeholder (char const *name);
void gnm_func_upgrade_placeholder
(GnmFunc *fd,
GnmFuncGroup *fn_group,
const char *textdomain,
const char *tdomain,
GnmFuncLoadDesc load_desc,
GnmFuncUsageNotify opt_usage_notify);
......
......@@ -91,7 +91,7 @@ static GOptionEntry const sstest_options [] = {
/* ------------------------------------------------------------------------- */
#define UNICODE_ELLIPSIS "\xe2\x80\xa6"
#define F2(func,s) dgettext ((func)->textdomain->str, (s))
#define F2(func,s) dgettext ((func)->tdomain->str, (s))
static char *
split_at_colon (char const *s, char **rest)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment