about summary refs log tree commit diff
path: root/intl
diff options
context:
space:
mode:
Diffstat (limited to 'intl')
-rw-r--r--intl/bindtextdom.c23
-rw-r--r--intl/dcigettext.c12
2 files changed, 24 insertions, 11 deletions
diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c
index 1e6efe2ad0..56a4223270 100644
--- a/intl/bindtextdom.c
+++ b/intl/bindtextdom.c
@@ -59,6 +59,11 @@
 
 /* Contains the default location of the message catalogs.  */
 extern const char _nl_default_dirname[];
+#ifdef _LIBC
+extern const char _nl_default_dirname_internal[] attribute_hidden;
+#else
+# define INTUSE(name) name
+#endif
 
 /* List with bindings of specific domains.  */
 extern struct binding *_nl_domain_bindings;
@@ -147,8 +152,8 @@ set_binding_values (domainname, dirnamep, codesetp)
 	      char *result = binding->dirname;
 	      if (strcmp (dirname, result) != 0)
 		{
-		  if (strcmp (dirname, _nl_default_dirname) == 0)
-		    result = (char *) _nl_default_dirname;
+		  if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
+		    result = (char *) INTUSE(_nl_default_dirname);
 		  else
 		    {
 #if defined _LIBC || defined HAVE_STRDUP
@@ -163,7 +168,7 @@ set_binding_values (domainname, dirnamep, codesetp)
 
 		  if (__builtin_expect (result != NULL, 1))
 		    {
-		      if (binding->dirname != _nl_default_dirname)
+		      if (binding->dirname != INTUSE(_nl_default_dirname))
 			free (binding->dirname);
 
 		      binding->dirname = result;
@@ -217,7 +222,7 @@ set_binding_values (domainname, dirnamep, codesetp)
     {
       /* Simply return the default values.  */
       if (dirnamep)
-	*dirnamep = _nl_default_dirname;
+	*dirnamep = INTUSE(_nl_default_dirname);
       if (codesetp)
 	*codesetp = NULL;
     }
@@ -239,11 +244,11 @@ set_binding_values (domainname, dirnamep, codesetp)
 
 	  if (dirname == NULL)
 	    /* The default value.  */
-	    dirname = _nl_default_dirname;
+	    dirname = INTUSE(_nl_default_dirname);
 	  else
 	    {
-	      if (strcmp (dirname, _nl_default_dirname) == 0)
-		dirname = _nl_default_dirname;
+	      if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
+		dirname = INTUSE(_nl_default_dirname);
 	      else
 		{
 		  char *result;
@@ -266,7 +271,7 @@ set_binding_values (domainname, dirnamep, codesetp)
 	}
       else
 	/* The default value.  */
-	new_binding->dirname = (char *) _nl_default_dirname;
+	new_binding->dirname = (char *) INTUSE(_nl_default_dirname);
 
       new_binding->codeset_cntr = 0;
 
@@ -322,7 +327,7 @@ set_binding_values (domainname, dirnamep, codesetp)
       if (0)
 	{
 	failed_codeset:
-	  if (new_binding->dirname != _nl_default_dirname)
+	  if (new_binding->dirname != INTUSE(_nl_default_dirname))
 	    free (new_binding->dirname);
 	failed_dirname:
 	  free (new_binding);
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index 344736e9de..2fb8a2f048 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -236,6 +236,13 @@ transcmp (p1, p2)
 }
 #endif
 
+#ifndef INTVARDEF
+# define INTVARDEF
+#endif
+#ifndef INTUSE
+# define INTUSE(name) name
+#endif
+
 /* Name of the default domain used for gettext(3) prior any call to
    textdomain(3).  The default value for this is "messages".  */
 const char _nl_default_default_domain[] attribute_hidden = "messages";
@@ -246,6 +253,7 @@ const char *_nl_current_default_domain attribute_hidden
 
 /* Contains the default location of the message catalogs.  */
 const char _nl_default_dirname[] = LOCALEDIR;
+INTVARDEF (_nl_default_dirname)
 
 /* List with bindings of specific domains created by bindtextdomain()
    calls.  */
@@ -439,7 +447,7 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
     }
 
   if (binding == NULL)
-    dirname = (char *) _nl_default_dirname;
+    dirname = (char *) INTUSE(_nl_default_dirname);
   else if (binding->dirname[0] == '/')
     dirname = binding->dirname;
   else
@@ -1109,7 +1117,7 @@ free_mem (void)
     {
       struct binding *oldp = _nl_domain_bindings;
       _nl_domain_bindings = _nl_domain_bindings->next;
-      if (oldp->dirname != _nl_default_dirname)
+      if (oldp->dirname != INTUSE(_nl_default_dirname))
 	/* Yes, this is a pointer comparison.  */
 	free (oldp->dirname);
       free (oldp->codeset);