[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Remove C++ source files
From: |
Gavin D. Smith |
Subject: |
branch master updated: Remove C++ source files |
Date: |
Fri, 18 Oct 2024 11:47:50 -0400 |
This is an automated email from the git hooks/post-receive script.
gavin pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new a2f53d4fdf Remove C++ source files
a2f53d4fdf is described below
commit a2f53d4fdf1074fd2b19ce01071372f001d81070
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri Oct 18 16:47:42 2024 +0100
Remove C++ source files
* tp/Texinfo/XS/convert/call_html_cxx_function.cpp,
* tp/Texinfo/XS/convert/call_html_cxx_function.h: remove
* tp/Texinfo/XS/configure.ac: Remove AC_PROG_CXX check and
check if C++ hashmap can be used.
* tp/Texinfo/XS/Makefile.am (teximakehtml):
Build without options for C++.
* tp/Texinfo/XS/main/converter_types.h
(enum ids_data_type): remove IDT_cxx_hashmap
(CONVF_cxx_hashmap): remove
* tp/Texinfo/XS/convert/converter.c (new_converter) [HAVE_CXX_HASHMAP],
* tp/Texinfo/XS/convert/html_prepare_converter.c
(html_prepare_conversion_units, html_register_id)
(html_id_is_registered) [HAVE_CXX_HASHMAP],
* tp/Texinfo/XS/convert/html_converter_finish.c
(html_reset_converter, html_free_converter) [HAVE_CXX_HASHMAP]:
Remove all code.
---
ChangeLog | 24 ++++++++
tp/Texinfo/XS/Makefile.am | 12 +---
tp/Texinfo/XS/configure.ac | 27 ---------
tp/Texinfo/XS/convert/call_html_cxx_function.cpp | 76 ------------------------
tp/Texinfo/XS/convert/call_html_cxx_function.h | 34 -----------
tp/Texinfo/XS/convert/converter.c | 4 --
tp/Texinfo/XS/convert/html_converter_finish.c | 9 ---
tp/Texinfo/XS/convert/html_prepare_converter.c | 13 ----
tp/Texinfo/XS/main/converter_types.h | 4 +-
9 files changed, 26 insertions(+), 177 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 760356ddc0..0e066d57a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2024-10-18 Gavin Smith <gavinsmith0123@gmail.com>
+
+ Remove C++ source files
+
+ * tp/Texinfo/XS/convert/call_html_cxx_function.cpp,
+ * tp/Texinfo/XS/convert/call_html_cxx_function.h: remove
+
+ * tp/Texinfo/XS/configure.ac: Remove AC_PROG_CXX check and
+ check if C++ hashmap can be used.
+ * tp/Texinfo/XS/Makefile.am (teximakehtml):
+ Build without options for C++.
+
+ * tp/Texinfo/XS/main/converter_types.h
+ (enum ids_data_type): remove IDT_cxx_hashmap
+ (CONVF_cxx_hashmap): remove
+
+ * tp/Texinfo/XS/convert/converter.c (new_converter) [HAVE_CXX_HASHMAP],
+ * tp/Texinfo/XS/convert/html_prepare_converter.c
+ (html_prepare_conversion_units, html_register_id)
+ (html_id_is_registered) [HAVE_CXX_HASHMAP],
+ * tp/Texinfo/XS/convert/html_converter_finish.c
+ (html_reset_converter, html_free_converter) [HAVE_CXX_HASHMAP]:
+ Remove all code.
+
2024-10-18 Gavin Smith <gavinsmith0123@gmail.com>
Fix teximakehtml memory leak
diff --git a/tp/Texinfo/XS/Makefile.am b/tp/Texinfo/XS/Makefile.am
index 9a9fcc622e..ec62a40bc9 100644
--- a/tp/Texinfo/XS/Makefile.am
+++ b/tp/Texinfo/XS/Makefile.am
@@ -559,17 +559,7 @@ teximakehtml_SOURCES = \
teximakehtml_LDADD = $(top_builddir)/gnulib/lib/libgnu.la
teximakehtml_LDFLAGS = $(EUIDACCESS_LIBGEN) $(LTLIBINTL) $(LTLIBICONV)
$(LTLIBUNISTRING)
-if TXI_HAVE_CXX_HASHMAP
-teximakehtml_SOURCES += convert/call_html_cxx_function.cpp \
- convert/call_html_cxx_function.h
-TXI_CXX_CPPFLAGS = -DHAVE_CXX_HASHMAP=1
-teximakehtml_LINK = $(CXXLINK) $(teximakehtml_CXXFLAGS) $(teximakehtml_LDFLAGS)
-else
-EXTRA_DIST += convert/call_html_cxx_function.cpp \
- convert/call_html_cxx_function.h
-TXI_CXX_CPPFLAGS =
teximakehtml_LINK = $(LINK) $(teximakehtml_CFLAGS) $(teximakehtml_LDFLAGS)
-endif
-teximakehtml_CPPFLAGS = -I$(srcdir)/parsetexi -I$(srcdir)/convert
-I$(srcdir)/main -I$(srcdir)/structuring_transfo $(TXI_CXX_CPPFLAGS)
$(AM_CPPFLAGS) $(GNULIB_CPPFLAGS)
+teximakehtml_CPPFLAGS = -I$(srcdir)/parsetexi -I$(srcdir)/convert
-I$(srcdir)/main -I$(srcdir)/structuring_transfo $(AM_CPPFLAGS)
$(GNULIB_CPPFLAGS)
diff --git a/tp/Texinfo/XS/configure.ac b/tp/Texinfo/XS/configure.ac
index b94528ddc2..29812191f5 100644
--- a/tp/Texinfo/XS/configure.ac
+++ b/tp/Texinfo/XS/configure.ac
@@ -171,8 +171,6 @@ AC_SUBST([XS_VERSION], [$PACKAGE_XS_VERSION])
AC_PROG_CC
-AC_PROG_CXX
-
gl_EARLY
# i18n support. We need to use the same GNU gettext version as the main
@@ -199,31 +197,6 @@ LT_INIT([disable-static])
# Note that the above have to be outside the disable_xs block
# otherwise it causes an error with configure.
-AC_LANG_PUSH([C++])
-
-AC_CACHE_CHECK([if C++ hashmap can be used], [texinfo_cv_cxx_hashmap],
-[
-texinfo_cv_cxx_hashmap=no
-
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-#include <unordered_map>
-#include <string>
-
-void
-init_registered_ids_hashmap (void)
-{
- std::unordered_map<std::string, int> registered_ids_hashmap;
- registered_ids_hashmap["toto"] = 1;
-}
-]])], [texinfo_cv_cxx_hashmap=yes])
-])
-
-AM_CONDITIONAL([TXI_HAVE_CXX_HASHMAP],
- [test "x$texinfo_cv_cxx_hashmap" = "xyes"])
-
-AC_LANG_POP([C++])
-
-
# Disable gnulib provision of "Microsoft deprecated alias" functions on
# MS-Windows to prevent a clash with definitions in Perl header files
GL_GNULIB_MDA_FDOPEN=0
diff --git a/tp/Texinfo/XS/convert/call_html_cxx_function.cpp
b/tp/Texinfo/XS/convert/call_html_cxx_function.cpp
deleted file mode 100644
index 429d0ab600..0000000000
--- a/tp/Texinfo/XS/convert/call_html_cxx_function.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Copyright 2023-2024 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
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include <unordered_map>
-#include <string>
-#include <iostream>
-
-extern "C"
-{
-#include "converter_types.h"
-}
-
-#include "call_html_cxx_function.h"
-
-// Using const char * did not work, there were spurious matches, so we use
-// a std::string.
-//typedef std::unordered_map<const char *, int> CXX_HASHMAP;
-typedef std::unordered_map<std::string, int> CXX_HASHMAP;
-
-void
-init_registered_ids_hashmap (CONVERTER *self)
-{
- self->registered_ids_hashmap = new (CXX_HASHMAP);
-}
-
-int
-is_hashmap_registered_id (CONVERTER *self, const char *in_string)
-{
- CXX_HASHMAP *registered_id = (CXX_HASHMAP *)self->registered_ids_hashmap;
- std::string string (in_string);
- int result = registered_id->count(string);
- return result;
-}
-
-void
-hashmap_register_id (CONVERTER *self, const char *in_string)
-{
- CXX_HASHMAP *registered_id = (CXX_HASHMAP *)self->registered_ids_hashmap;
- std::string string (in_string);
- (*registered_id)[string] = 1;
-}
-
-void
-clear_registered_ids_hashmap (CONVERTER *self)
-{
- if (self->registered_ids_hashmap)
- {
- CXX_HASHMAP *registered_id = (CXX_HASHMAP *)self->registered_ids_hashmap;
- registered_id->clear ();
- }
-}
-
-void
-free_registered_ids_hashmap (CONVERTER *self)
-{
- if (self->registered_ids_hashmap)
- {
- CXX_HASHMAP *registered_id = (CXX_HASHMAP *)self->registered_ids_hashmap;
- delete (registered_id);
- }
-}
-
diff --git a/tp/Texinfo/XS/convert/call_html_cxx_function.h
b/tp/Texinfo/XS/convert/call_html_cxx_function.h
deleted file mode 100644
index eeb00b641c..0000000000
--- a/tp/Texinfo/XS/convert/call_html_cxx_function.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* call_html_cxx_function.h - declarations for call_html_cxx_function.cpp */
-#ifndef CALL_HTML_CXX_FUNCTION_H
-#define CALL_HTML_CXX_FUNCTION_H
-
-/* Copyright 2023-2024 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
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void init_registered_ids_hashmap (CONVERTER *self);
-int is_hashmap_registered_id (CONVERTER *self, const char *in_string);
-void hashmap_register_id (CONVERTER *self, const char *in_string);
-void clear_registered_ids_hashmap (CONVERTER *self);
-void free_registered_ids_hashmap (CONVERTER *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tp/Texinfo/XS/convert/converter.c
b/tp/Texinfo/XS/convert/converter.c
index 1633282ab2..35e96f3897 100644
--- a/tp/Texinfo/XS/convert/converter.c
+++ b/tp/Texinfo/XS/convert/converter.c
@@ -283,10 +283,6 @@ new_converter (enum converter_format format, unsigned long
flags)
/* set low level data representations options */
if (flags & CONVF_string_list)
converter->ids_data_type = IDT_string_list;
-#ifdef HAVE_CXX_HASHMAP
- else if (flags & CONVF_cxx_hashmap)
- converter->ids_data_type = IDT_cxx_hashmap;
-#endif
else if (flags & CONVF_perl_hashmap)
converter->ids_data_type = IDT_perl_hashmap;
else /* default */
diff --git a/tp/Texinfo/XS/convert/html_converter_finish.c
b/tp/Texinfo/XS/convert/html_converter_finish.c
index d5bdf7eb33..9352abbe42 100644
--- a/tp/Texinfo/XS/convert/html_converter_finish.c
+++ b/tp/Texinfo/XS/convert/html_converter_finish.c
@@ -30,7 +30,6 @@
#include "converter.h"
#include "api_to_perl.h"
#include "call_html_perl_function.h"
-#include "call_html_cxx_function.h"
#include "hashmap.h"
/* html_reset_translated_special_unit_info_tree
html_clear_direction_string_type */
@@ -164,10 +163,6 @@ html_reset_converter (CONVERTER *self)
clear_registered_ids_hv (self);
else if (self->ids_data_type == IDT_hashmap)
clear_registered_ids_c_hashmap (self);
-#ifdef HAVE_CXX_HASHMAP
- else if (self->ids_data_type == IDT_cxx_hashmap)
- clear_registered_ids_hashmap (self);
-#endif
else if (self->registered_ids)
clear_strings_list (self->registered_ids);
@@ -347,10 +342,6 @@ html_free_converter (CONVERTER *self)
free_registered_ids_hv (self);
else if (self->ids_data_type == IDT_hashmap)
free_registered_ids_c_hashmap (self);
-#ifdef HAVE_CXX_HASHMAP
- else if (self->ids_data_type == IDT_cxx_hashmap)
- free_registered_ids_hashmap (self);
-#endif
else
{
if (self->registered_ids)
diff --git a/tp/Texinfo/XS/convert/html_prepare_converter.c
b/tp/Texinfo/XS/convert/html_prepare_converter.c
index 577025f9f1..28eb7e2a6e 100644
--- a/tp/Texinfo/XS/convert/html_prepare_converter.c
+++ b/tp/Texinfo/XS/convert/html_prepare_converter.c
@@ -54,7 +54,6 @@
xml_text_entity_no_arg_commands_formatting */
#include "converter.h"
#include "call_html_perl_function.h"
-#include "call_html_cxx_function.h"
#include "hashmap.h"
#include "format_html.h"
/* html_complete_no_arg_commands_formatting html_run_stage_handlers
@@ -3762,10 +3761,6 @@ html_id_is_registered (CONVERTER *self, const char
*string)
return is_hv_registered_id (self, string);
else if (self->ids_data_type == IDT_hashmap)
return is_c_hashmap_registered_id (self, string);
-#ifdef HAVE_CXX_HASHMAP
- else if (self->ids_data_type == IDT_cxx_hashmap)
- return is_hashmap_registered_id (self, string);
-#endif
else
return find_string (self->registered_ids, string);
}
@@ -3777,10 +3772,6 @@ html_register_id (CONVERTER *self, const char *string)
hv_register_id (self, string);
else if (self->ids_data_type == IDT_hashmap)
c_hashmap_register_id (self, string);
-#ifdef HAVE_CXX_HASHMAP
- else if (self->ids_data_type == IDT_cxx_hashmap)
- hashmap_register_id (self, string);
-#endif
else
add_string (string, self->registered_ids);
}
@@ -4582,10 +4573,6 @@ html_prepare_conversion_units_targets (CONVERTER *self,
size_t predicted_values = ids_hashmap_predicted_values (self);
init_registered_ids_c_hashmap (self, predicted_values);
}
-#ifdef HAVE_CXX_HASHMAP
- else if (self->ids_data_type == IDT_cxx_hashmap)
- init_registered_ids_hashmap (self);
-#endif
else
self->registered_ids = new_string_list ();
diff --git a/tp/Texinfo/XS/main/converter_types.h
b/tp/Texinfo/XS/main/converter_types.h
index cca8cf20b9..dcd8b28a1a 100644
--- a/tp/Texinfo/XS/main/converter_types.h
+++ b/tp/Texinfo/XS/main/converter_types.h
@@ -40,7 +40,6 @@ enum converter_format {
enum ids_data_type {
IDT_perl_hashmap,
- IDT_cxx_hashmap,
IDT_string_list,
IDT_hashmap,
};
@@ -48,8 +47,7 @@ enum ids_data_type {
/* converter low level customization */
#define CONVF_perl_hashmap 0x0001
#define CONVF_string_list 0x0002
-#define CONVF_cxx_hashmap 0x0004
-#define CONVF_hashmap 0x0008
+#define CONVF_hashmap 0x0004
/* for string information passing to/from perl */
enum sv_string_type {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Remove C++ source files,
Gavin D. Smith <=