util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: maximilian attems <max@stro.at>
To: util-linux@vger.kernel.org
Cc: maximilian attems <max@stro.at>
Subject: [PATCH] lib/strutils: circumvent missing localeconv()
Date: Thu, 31 May 2012 19:40:49 +0200	[thread overview]
Message-ID: <1338486050-7490-1-git-send-email-max@stro.at> (raw)

Add stub too nls.h, include it instead of locale.h.
Code in strutils handles already returned NULL.

Signed-off-by: maximilian attems <max@stro.at>
---
 include/nls.h  |    6 ++++++
 lib/strutils.c |    2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/nls.h b/include/nls.h
index 9a9311b..3eabfe6 100644
--- a/include/nls.h
+++ b/include/nls.h
@@ -12,6 +12,12 @@ int main(int argc, char *argv[]);
 #else
 # undef setlocale
 # define setlocale(Category, Locale) /* empty */
+struct lconv
+{
+	char *decimal_point;
+};
+# undef localeconv
+# define localeconv() NULL
 #endif
 
 #ifdef ENABLE_NLS
diff --git a/lib/strutils.c b/lib/strutils.c
index 6bdc01d..036ae06 100644
--- a/lib/strutils.c
+++ b/lib/strutils.c
@@ -9,10 +9,10 @@
 #include <ctype.h>
 #include <errno.h>
 #include <sys/stat.h>
-#include <locale.h>
 #include <string.h>
 
 #include "c.h"
+#include "nls.h"
 #include "strutils.h"
 #include "bitops.h"
 
-- 
1.7.10


             reply	other threads:[~2012-05-31 17:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 17:40 maximilian attems [this message]
2012-06-05 13:01 ` [PATCH] lib/strutils: circumvent missing localeconv() Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1338486050-7490-1-git-send-email-max@stro.at \
    --to=max@stro.at \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).