]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix a build failure on mingw with -O0.
authorBruno Haible <bruno@clisp.org>
Sat, 6 Oct 2018 08:18:06 +0000 (10:18 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 6 Oct 2018 08:32:05 +0000 (10:32 +0200)
Reported at <https://savannah.gnu.org/bugs/?36443>.
Fix suggested by Evgeny Grin <k2k@narod.ru>
in <https://savannah.gnu.org/bugs/?36443#comment4>.

* gnulib-local/build-aux/moopp (func_emit_source_h): Wrap the function
declarations in extern "C" {}.

gnulib-local/build-aux/moopp

index 8e001a214c2274a5ea1c704aaebd0a9c34d15df4..70efc11ad4452efcfb94db0b28fc0aa3f82e0da5 100755 (executable)
@@ -516,7 +516,13 @@ func_emit_source_h ()
     echo "#endif"
     echo
     echo "/* Functions that invoke the methods.  */"
+    echo "#ifdef __cplusplus"
+    echo "extern \"C\" {"
+    echo "#endif"
     echo "$all_methods" | sed -e "$sed_remove_empty_lines" -e 's/\([^A-Za-z_0-9]\)\([A-Za-z_0-9][A-Za-z_0-9]*\)[       ]*([^,)]*/\1'"${main_classname}_"'\2 ('"${main_classname}_t first_arg"'/' -e 's,^,extern ,' -e 's,$,;,'
+    echo "#ifdef __cplusplus"
+    echo "}"
+    echo "#endif"
     echo
     # Now come the implementation details.
     echo "/* Type representing an implementation of ${main_classname}_t.  */"