This patch disables the i18n feature to build powertop natively on
android. This patch can be disabled by removing the  DISABLE_I18N
flag in the Android.mk file.

Signed-off-by: John Mathew <[email protected]>
---
 lib.cpp  |    2 ++
 lib.h    |    7 ++++++-
 main.cpp |    3 ++-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/lib.cpp b/lib.cpp
index 3c411c9..ba6be7a 100644
--- a/lib.cpp
+++ b/lib.cpp
@@ -51,7 +51,9 @@ extern "C" {
 #include <sys/stat.h>
 #include <dirent.h>
 #include <locale.h>
+#ifndef DISABLE_I18N
 #include <libintl.h>
+#endif
 #include <limits>
 #include <math.h>
 
diff --git a/lib.h b/lib.h
index 0a62163..ae53d45 100644
--- a/lib.h
+++ b/lib.h
@@ -25,11 +25,16 @@
 #ifndef INCLUDE_GUARD_LIB_H
 #define INCLUDE_GUARD_LIB_H
 
+#ifndef DISABLE_I18N
 #include <libintl.h>
+#endif
 #include <stdint.h>
 
-
+#ifndef DISABLE_I18N
 #define _(STRING)    gettext(STRING)
+#else
+#define _(STRING)    (STRING)
+#endif
 
 #define POWERTOP_VERSION "1.98 beta 1"
 #define POWERTOP_SHORT_VERSION "1.98"
diff --git a/main.cpp b/main.cpp
index a3ef1f2..7e5a242 100644
--- a/main.cpp
+++ b/main.cpp
@@ -271,9 +271,10 @@ int main(int argc, char **argv)
        set_new_handler(out_of_memory);
 
        setlocale (LC_ALL, "");
+#ifndef DISABLE_I18N
        bindtextdomain ("powertop", "/usr/share/locale");
        textdomain ("powertop");
-
+#endif
        uid = getuid();
 
        if (uid != 0) {
-- 
1.7.1

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Power mailing list
[email protected]
https://bughost.org/mailman/listinfo/power

Reply via email to