[gnumeric] Compilation: avoid textdomain as a Gnumeric variable, part 2



commit 64f1410b73eb6aa1bfafcd2d7db1ac6fd59c8624
Author: Morten Welinder <terra gnome org>
Date:   Mon Dec 25 16:06:04 2017 -0500

    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.

 src/dialogs/dialog-function-select.c |    2 +-
 src/func.c                           |   26 +++++++++++++-------------
 src/func.h                           |    6 +++---
 src/sstest.c                         |    2 +-
 4 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/src/dialogs/dialog-function-select.c b/src/dialogs/dialog-function-select.c
index dc654fe..d1d0cbe 100644
--- a/src/dialogs/dialog-function-select.c
+++ b/src/dialogs/dialog-function-select.c
@@ -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"
diff --git a/src/func.c b/src/func.c
index 6a82392..53ba25a 100644
--- a/src/func.c
+++ b/src/func.c
@@ -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);
diff --git a/src/func.h b/src/func.h
index a6bcd56..85fccc0 100644
--- a/src/func.h
+++ b/src/func.h
@@ -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);
 
diff --git a/src/sstest.c b/src/sstest.c
index 3b8a4d3..acda80e 100644
--- a/src/sstest.c
+++ b/src/sstest.c
@@ -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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]