[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
- [Acl-devel] [PATCH attr 0/6 v2] modernize the build system, Mike Frysinger, 2014/01/09
- [Acl-devel] [PATCH attr 2/6 v2] move gettext logic into misc.h,
Mike Frysinger <=
- [Acl-devel] [PATCH attr 6/6 v2] disable installation of man(2) pages by default, Mike Frysinger, 2014/01/09
- [Acl-devel] [PATCH attr 1/6 v2] punt debian/rpm packaging logic, Mike Frysinger, 2014/01/09
- [Acl-devel] [PATCH attr 3/6 v2] test: make running parallel/out-of-tree safe, Mike Frysinger, 2014/01/09
- [Acl-devel] [PATCH attr 4/6 v2] modernize build system, Mike Frysinger, 2014/01/09
- [Acl-devel] [PATCH attr 5/6 v2] po: regenerate files after move, Mike Frysinger, 2014/01/09
- Re: [Acl-devel] [PATCH attr 0/6 v2] modernize the build system, Andreas Grünbacher, 2014/01/09