changeset 15879:f69530e3600d

make docstrings for __java_init__ and __java_exit__ available unconditionally * ov-java.cc (F__java_init__, F__java_exit__): Move function definitions outside of HAVE_JAVA conditional.
author John W. Eaton <jwe@octave.org>
date Wed, 02 Jan 2013 19:18:15 -0500
parents 7d300b85ee25
children df1aceb8f0bc
files libinterp/octave-value/ov-java.cc
diffstat 1 files changed, 42 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/ov-java.cc	Wed Jan 02 14:29:50 2013 -0500
+++ b/libinterp/octave-value/ov-java.cc	Wed Jan 02 19:18:15 2013 -0500
@@ -1409,38 +1409,6 @@
     }
 }
 
-DEFUN (__java_init__, , ,
-  "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {} java_init ()\n\
-Internal function used @strong{only} when debugging Java interface.\n\
-Function will directly call initialize_java() to create an instance of a JVM.\n\
-@end deftypefn")
-{
-  octave_value retval;
-
-  retval = 0;
-  initialize_java ();
-  if (! error_state)
-    retval = 1;
-
-  return retval;
-}
-
-DEFUN (__java_exit__, , ,
-  "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {} java_exit ()\n\
-Internal function used @strong{only} when debugging Java interface.\n\
-Function will directly call terminate_jvm() to destroy the current JVM\n\
-instance.\n\
-@end deftypefn")
-{
-  octave_value retval;
-
-  terminate_jvm ();
-
-  return retval;
-}
-
 JNIEXPORT jboolean JNICALL
 Java_org_octave_Octave_call (JNIEnv *env, jclass, jstring funcName,
                              jobjectArray argin, jobjectArray argout)
@@ -1937,6 +1905,48 @@
 // DEFUN blocks below must be outside of HAVE_JAVA block so that
 // documentation strings are always available, even when functions are not.
 
+DEFUN (__java_init__, , ,
+  "-*- texinfo -*-\n\
+@deftypefn {Built-in Function} {} java_init ()\n\
+Internal function used @strong{only} when debugging Java interface.\n\
+Function will directly call initialize_java() to create an instance of a JVM.\n\
+@end deftypefn")
+{
+
+#ifdef HAVE_JAVA
+  octave_value retval;
+
+  retval = 0;
+
+  initialize_java ();
+
+  if (! error_state)
+    retval = 1;
+
+  return retval;
+#else
+  error ("__java_init__: Octave was not compiled with Java interface");
+  return octave_value ();
+#endif
+}
+
+DEFUN (__java_exit__, , ,
+  "-*- texinfo -*-\n\
+@deftypefn {Built-in Function} {} java_exit ()\n\
+Internal function used @strong{only} when debugging Java interface.\n\
+Function will directly call terminate_jvm() to destroy the current JVM\n\
+instance.\n\
+@end deftypefn")
+{
+#ifdef HAVE_JAVA
+  terminate_jvm ();
+#else
+  error ("__java_init__: Octave was not compiled with Java interface");
+#endif
+
+  return octave_value ();
+}
+
 DEFUN (javaObject, args, ,
   "-*- texinfo -*-\n\
 @deftypefn  {Built-in Function} {@var{jobj} =} javaObject (@var{classname})\n\