add: bool hard = true; char const *p = setlocale (category, NULL);
context: hard_locale (int category){#if ! HAVE_SETLOCALE  return 0;#else  int hard = 1;  char const *p = setlocale (category, 0);  if (p)    {# if defined __GLIBC__ && 2 <= __GLIBC__      if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0)	hard = 0;# else      char *locale = malloc (strlen (p) + 1);      if (locale)	{	  strcpy (locale, p);	  /* Temporarily set the locale to the "C" and "POSIX" locales	     to find their names, so that we can determine whether one	     or the other is the caller's locale.  */	  if (((p = setlocale (category, "C"))	       && strcmp (p, locale) == 0)	      || ((p = setlocale (category, "POSIX"))		  && strcmp (p, locale) == 0))	    hard = 0;	  /* Restore the caller's locale.  */	  setlocale (category, locale);	  free (locale);	}# endif    }  return hard;#endif}