changeset 30584:5ec0d3291fa0

rename f2c-main.c to f77-dummy-main.cc * f77-dummy-main.cc: Rename from f2c-main.c to avoid confusion about whether this file is somehow related to f2c. Update to assume this file is always compiled with a C++ compiler. * liboctave/util/module.mk: Update.
author John W. Eaton <jwe@octave.org>
date Fri, 31 Dec 2021 11:27:45 -0500
parents d4e559fcf88f
children cdb9b90b907f
files liboctave/util/f2c-main.c liboctave/util/f77-dummy-main.cc liboctave/util/module.mk
diffstat 3 files changed, 49 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/util/f2c-main.c	Fri Sep 24 16:34:42 2021 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) 1996-2022 The Octave Project Developers
-//
-// See the file COPYRIGHT.md in the top-level directory of this
-// distribution or <https://octave.org/copyright/>.
-//
-// This file is part of Octave.
-//
-// Octave 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.
-//
-// Octave 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 Octave; see the file COPYING.  If not, see
-// <https://www.gnu.org/licenses/>.
-//
-////////////////////////////////////////////////////////////////////////
-
-#if defined (HAVE_CONFIG_H)
-#  include "config.h"
-#endif
-
-#include <assert.h>
-
-/* Dummy Fortran main declaration, needed in order to link to some
-   Fortran libraries.  See the AC_F77_DUMMY_MAIN macro documentation.
-   This function should never be called. */
-
-#if defined (F77_DUMMY_MAIN)
-#  if defined (__cplusplus)
-extern "C"
-#  endif
-int F77_DUMMY_MAIN () { assert (0); return 1; }
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/liboctave/util/f77-dummy-main.cc	Fri Dec 31 11:27:45 2021 -0500
@@ -0,0 +1,47 @@
+////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 1996-2022 The Octave Project Developers
+//
+// See the file COPYRIGHT.md in the top-level directory of this
+// distribution or <https://octave.org/copyright/>.
+//
+// This file is part of Octave.
+//
+// Octave 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.
+//
+// Octave 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 Octave; see the file COPYING.  If not, see
+// <https://www.gnu.org/licenses/>.
+//
+////////////////////////////////////////////////////////////////////////
+
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <cassert>
+
+// Dummy Fortran main declaration, needed in order to link to some
+// Fortran libraries.  See the AC_F77_DUMMY_MAIN macro documentation.
+// This function should never be called.
+
+#if defined (F77_DUMMY_MAIN)
+
+extern "C"
+int
+F77_DUMMY_MAIN (void)
+{
+  assert (0);
+
+  return 1;
+}
+
+#endif
--- a/liboctave/util/module.mk	Fri Sep 24 16:34:42 2021 -0500
+++ b/liboctave/util/module.mk	Fri Dec 31 11:27:45 2021 -0500
@@ -51,10 +51,9 @@
   %reldir%/r1mach.f
 
 UTIL_C_SRC = \
-  %reldir%/f2c-main.c \
-  %reldir%/lo-cutils.c \
   %reldir%/blaswrap.c \
   %reldir%/f77-fcn.c \
+  %reldir%/lo-cutils.c \
   %reldir%/lo-error.c \
   %reldir%/oct-rl-edit.c \
   %reldir%/oct-rl-hist.c
@@ -64,6 +63,7 @@
   %reldir%/cmd-edit.cc \
   %reldir%/cmd-hist.cc \
   %reldir%/data-conv.cc \
+  %reldir%/f77-dummy-main.cc \
   %reldir%/file-info.cc \
   %reldir%/glob-match.cc \
   %reldir%/kpse.cc \