All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky at gmail.com>
To: powertop@lists.01.org
Subject: Re: [Powertop] [PATCH] Optionally disable NLS
Date: Fri, 09 May 2014 10:29:15 +0300	[thread overview]
Message-ID: <20140509072915.GA937@swordfish> (raw)
In-Reply-To: 61074.10.24.17.174.1399566842.squirrel@linux.intel.com

[-- Attachment #1: Type: text/plain, Size: 3867 bytes --]

On (05/08/14 09:34), Alexandra Yates wrote:
> > On (04/16/14 11:21), Rick "Zero_Chaos" Farina wrote:
> >> A report on Gentoo's bug tracker
> >> (https://bugs.gentoo.org/show_bug.cgi?id=505366) notes that while the
> >> configure script support --disable-nls, the nls code is not
> >> conditionally disabled which causes build failures on uclibc.  This
> >> patch from René Rhéaume fixes the affected code:
> >>
> >
> > looks good.
> >
> > 	-ss
> >
> >> - --- powertop-2.5/src/lib.h
> >> +++ powertop-2.5-nls/src/lib.h
> >> @@ -33,7 +33,11 @@
> >>  #include "config.h"
> >>  #endif
> >>
> >> +#ifdef ENABLE_NLS
> >>  #define _(STRING)    gettext(STRING)
> >> +#else
> >> +#define _(STRING)    (STRING)
> >> +#endif
> >>
> >>  #define POWERTOP_VERSION "v"PACKAGE_VERSION
> >>  #define POWERTOP_SHORT_VERSION PACKAGE_VERSION
> >> - --- powertop-2.5/src/main.cpp
> >> +++ powertop-2.5-nls/src/main.cpp
> >> @@ -369,8 +369,10 @@ int main(int argc, char **argv)
> >>  	set_new_handler(out_of_memory);
> >>
> >>  	setlocale (LC_ALL, "");
> >> +#ifdef ENABLE_NLS
> >>  	bindtextdomain (PACKAGE, LOCALEDIR);
> >>  	textdomain (PACKAGE);
> >> +#endif
> >>
> >>  	while (1) { /* parse commandline options */
> >>  		c = getopt_long (argc, argv, "ch:C:i:t:uVw:q", long_options,
> >> &option_index);
> >> - --- powertop-2.5/src/report/report-maker.h
> >> +++ powertop-2.5-nls/src/report/report-maker.h
> >> @@ -75,8 +75,13 @@
> >>  #include <string>
> >>
> >>  /* Conditional gettext. We need original strings for CSV. */
> >> +#ifdef ENABLE_NLS
> >>  #define __(STRING) \
> >>  	((report.get_type() == REPORT_CSV) ? (STRING) : gettext(STRING))
> >> +#else
> >> +#define __(STRING) (STRING)
> >> +#endif
> >> +
> >>
> >>  #ifndef UNUSED
> >>  #define UNUSED __attribute__((unused))
> >>
> >>
> >> original patch: https://505366.bugs.gentoo.org/attachment.cgi?id=373272
> >>
> >> Please accept this patch.
> >>
> >> Thanks,
> >> Zero
> I'm having issues adding this patch to the repo.  I get error:
> 
> Patch is empty.  Was it split wrong?
> 
> Sergey, did you have any problems applying this patch to your branch?
> 
> Rick, please check your patch and send it?
> 

I guess this is because of

--- powertop-2.5
+++ powertop-2.5-nls
	^^^^^^^^^^^^

the following one seems to work.

Rick, can you resend using `git send-email'?

---

 src/lib.h                 | 4 ++++
 src/main.cpp              | 2 ++
 src/report/report-maker.h | 5 +++++
 3 files changed, 11 insertions(+)

diff --git a/src/lib.h b/src/lib.h
index adcc4a2..78391a4 100644
--- a/src/lib.h
+++ b/src/lib.h
@@ -33,7 +33,11 @@
 #include "config.h"
 #endif
 
+#ifdef ENABLE_NLS
 #define _(STRING)    gettext(STRING)
+#else
+#define _(STRING)    (STRING)
+#endif
 
 #define POWERTOP_VERSION "v"PACKAGE_VERSION
 #define POWERTOP_SHORT_VERSION PACKAGE_VERSION
diff --git a/src/main.cpp b/src/main.cpp
index 4e34ee6..8bbc1ff 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -369,8 +369,10 @@ int main(int argc, char **argv)
 	set_new_handler(out_of_memory);
 
 	setlocale (LC_ALL, "");
+#ifdef ENABLE_NLS
 	bindtextdomain (PACKAGE, LOCALEDIR);
 	textdomain (PACKAGE);
+#endif
 
 	while (1) { /* parse commandline options */
 		c = getopt_long (argc, argv, "ch:C:i:t:uVw:q", long_options, &option_index);
diff --git a/src/report/report-maker.h b/src/report/report-maker.h
index 75e0d06..a72aa47 100644
--- a/src/report/report-maker.h
+++ b/src/report/report-maker.h
@@ -75,8 +75,13 @@
 #include <string>
 
 /* Conditional gettext. We need original strings for CSV. */
+#ifdef ENABLE_NLS
 #define __(STRING) \
 	((report.get_type() == REPORT_CSV) ? (STRING) : gettext(STRING))
+#else
+#define __(STRING) (STRING)
+#endif
+
 
 #ifndef UNUSED
 #define UNUSED __attribute__((unused))

             reply	other threads:[~2014-05-09  7:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09  7:29 Sergey Senozhatsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-05-08 16:34 [Powertop] [PATCH] Optionally disable NLS Alexandra Yates
2014-04-16 19:58 Sergey Senozhatsky
2014-04-16 15:21 Rick Zero_Chaos Farina

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=20140509072915.GA937@swordfish \
    --to=powertop@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.