[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Fri, 12 Mar 2021 16:31:11 -0500 (EST) |
branch: master
commit a8064b7325ddcd0be1ef4f6468a8ba4534e74673
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri Mar 12 21:30:45 2021 +0000
Fix NetBSD build
* tp/Texinfo/XS/parsetexi/api.c,
* tp/Texinfo/XS/parsetexi/errors.c: Surround calls to gettext
with #ifdef ENABLE_NLS.
---
ChangeLog | 12 ++++++++++++
tp/Texinfo/XS/parsetexi/api.c | 13 ++++++++++++-
tp/Texinfo/XS/parsetexi/errors.c | 9 ++++++++-
3 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6bab4e6..4f0e1e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2021-03-12 Gavin Smith <gavinsmith0123@gmail.com>
+
+ Fix NetBSD build
+
+ * tp/Texinfo/XS/parsetexi/api.c,
+ * tp/Texinfo/XS/parsetexi/errors.c: Surround calls to gettext
+ with #ifdef ENABLE_NLS.
+
+2021-03-12 Gavin Smith <gavinsmith0123@gmail.com>
+
+ * tp/Texinfo/XS/parsetexi/errors.c (bug): Don't call abort.
+
2021-03-11 Gavin Smith <gavinsmith0123@gmail.com>
* tp/tests/coverage_macro.texi: Add blank lines to isolate
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 4ad00d1..f85ceff 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -1,4 +1,4 @@
-/* Copyright 2010-2020 Free Software Foundation, Inc.
+/* Copyright 2010-2021 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,6 +40,7 @@
ELEMENT *Root;
+#ifdef ENABLE_NLS
#define LOCALEDIR DATADIR "/locale"
@@ -93,6 +94,16 @@ init (int texinfo_uninstalled, char *builddir)
return 1;
}
+#else
+
+int
+init (int texinfo_uninstalled, char *builddir)
+{
+ return 1;
+}
+
+#endif
+
static void
reset_floats ()
{
diff --git a/tp/Texinfo/XS/parsetexi/errors.c b/tp/Texinfo/XS/parsetexi/errors.c
index 9acdfe3..522bd34 100644
--- a/tp/Texinfo/XS/parsetexi/errors.c
+++ b/tp/Texinfo/XS/parsetexi/errors.c
@@ -14,7 +14,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+
+
+#ifdef ENABLE_NLS
#include <libintl.h>
+#endif
#include <stdlib.h>
#include <stdarg.h>
@@ -27,7 +31,6 @@
void bug (char *message)
{
fprintf (stderr, "texi2any (XS parser): bug: %s\n", message);
- abort ();
}
void fatal (char *message)
@@ -52,7 +55,11 @@ line_error_internal (enum error_type type, LINE_NR
*cmd_line_nr,
char *format, va_list v)
{
char *message;
+#ifdef ENABLE_NLS
vasprintf (&message, gettext(format), v);
+#else
+ vasprintf (&message, format, v);
+#endif
if (!message) fatal ("vasprintf failed");
if (error_number == error_space)