acl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Acl-devel] [PATCH attr 2/6 v2] move gettext logic into misc.h


From: Mike Frysinger
Subject: [Acl-devel] [PATCH attr 2/6 v2] move gettext logic into misc.h
Date: Thu, 9 Jan 2014 16:30:15 -0500

This lets us autogenerate config.h using autoheader rather than
hand maintain it.
---
 attr/attr.c    |  5 ++++-
 include/misc.h | 10 ++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/attr/attr.c b/attr/attr.c
index c691d57..798fe84 100644
--- a/attr/attr.c
+++ b/attr/attr.c
@@ -16,6 +16,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "config.h"
+
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/stat.h>
@@ -28,7 +30,8 @@
 #include <locale.h>
 
 #include <attr/attributes.h>
-#include "config.h"
+
+#include "misc.h"
 
 #define        SETOP           1               /* do a SET operation */
 #define        GETOP           2               /* do a GET operation */
diff --git a/include/misc.h b/include/misc.h
index 0c5fdcc..ae2570a 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -21,3 +21,13 @@ extern const char *quote(const char *str, const char 
*quote_chars);
 extern char *unquote(char *str);
 
 extern char *next_line(FILE *file);
+
+#ifdef ENABLE_NLS
+# include <libintl.h>
+# define _(x)                  gettext(x)
+#else
+# define _(x)                  (x)
+# define textdomain(d)         do { } while (0)
+# define bindtextdomain(d,dir) do { } while (0)
+#endif
+#include <locale.h>
-- 
1.8.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]