changeset 4448:042cdbb7f317

[project @ 2003-07-08 19:14:55 by jwe]
author jwe
date Tue, 08 Jul 2003 19:14:55 +0000
parents 252b9162c084
children e2c91da0aa16
files src/ChangeLog src/defun-int.h src/defun.cc src/version.h
diffstat 4 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
 2003-07-08  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
+	* defun.cc (check_version): Compare version to OCTAVE_API_VERSION,
+	not OCTAVE_VERSION.  Mismatch is now fatal.
+	* defun-int.h (DEFINE_FUN_INSTALLER_FUN3): Pass
+	OCTAVE_API_VERSION instead of OCTAVE_VERSION to check_version.
+	* version.h (OCTAVE_API_VERSION): New macro.
+
 	* defaults.cc (Vdefault_exec_path): New static variable.
 	(set_default_default_exec_path): New function.
 	(install_defaults): Call it.
--- a/src/defun-int.h
+++ b/src/defun-int.h
@@ -87,7 +87,7 @@
   bool \
   FS ## name ## _ ## cxx_abi (const octave_shlib& shl) \
   { \
-    check_version (OCTAVE_VERSION, #name); \
+    check_version (OCTAVE_API_VERSION, #name); \
     install_dld_function (F ## name, #name, shl, doc); \
     return error_state ? false : true; \
   }
--- a/src/defun.cc
+++ b/src/defun.cc
@@ -68,13 +68,13 @@
 void
 check_version (const std::string& version, const std::string& fcn)
 {
-  if (version != OCTAVE_VERSION)
+  if (version != OCTAVE_API_VERSION)
     {
-      warning ("incompatible version %s found in function `%s'",
-	       version.c_str (), fcn.c_str ());
-      warning ("this can lead to incorrect results or other failures");
-      warning ("you can fix this problem by recompiling this .oct file");
-
+      error ("API version %s found in .oct file function `%s'\n"
+	     "       does not match the running Octave (API version %s)\n"
+	     "       this can lead to incorrect results or other failures\n"
+	     "       you can fix this problem by recompiling this .oct file",
+	     version.c_str (), fcn.c_str (), OCTAVE_API_VERSION);
     }
 }
 
--- a/src/version.h
+++ b/src/version.h
@@ -25,6 +25,8 @@
 
 #define OCTAVE_VERSION "2.1.50"
 
+#define OCTAVE_API_VERSION "1"
+
 #define OCTAVE_COPYRIGHT \
   "Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 John W. Eaton."