c-strtod: make it usable in C++
(too old to reply)
Bruno Haible
2017-05-28 11:52:54 UTC
Support for using this module in C++ mode. GNU clisp needs it.

2017-05-28 Bruno Haible <***@clisp.org>

c-strtod: Make it usable in C++ mode.
* lib/c-strtod.h: Add 'extern "C"' marker for C++.

diff --git a/lib/c-strtod.h b/lib/c-strtod.h
index 7aa511d..121fff4 100644
--- a/lib/c-strtod.h
+++ b/lib/c-strtod.h
@@ -15,6 +15,10 @@
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" {
/* Parse the initial portion of the string pointed to by NPTR as a floating-
point number (in decimal or hexadecimal notation), like in the C locale:
accepting only the ASCII digits '0'..'9', and only '.' as decimal point
@@ -35,3 +39,7 @@
- In case of other error, return 0 and set errno, for example to ENOMEM. */
extern double c_strtod (char const *nptr, char **endptr);
extern long double c_strtold (char const *nptr, char **endptr);
+#ifdef __cplusplus