#include <java/lang/reflect/Modifier.h>
#include <java/io/PrintStream.h>
+#ifdef USE_LTDL
+#include <ltdl.h>
+#endif
#define ObjectClass _CL_Q34java4lang6Object
extern java::lang::Class ObjectClass;
\f
+#ifdef HANDLE_SEGV
+static java::lang::NullPointerException *nullp;
+SIGNAL_HANDLER (catch_segv)
+{
+ MAKE_THROW_FRAME;
+ _Jv_Throw (nullp);
+}
+#endif
+
+#ifdef HANDLE_FPE
+static java::lang::ArithmeticException *arithexception;
+SIGNAL_HANDLER (catch_fpe)
+{
+#ifdef HANDLE_DIVIDE_OVERFLOW
+ HANDLE_DIVIDE_OVERFLOW;
+#else
+ MAKE_THROW_FRAME;
+#endif
+ _Jv_Throw (arithexception);
+}
+#endif
+
+\f
+
jboolean
_Jv_equalUtf8Consts (Utf8Const* a, Utf8Const *b)
{
}
/* True iff A is equal to STR.
- HASH is STR->hashCode().
+ HASH is STR->hashCode().
*/
jboolean
\f
-#ifdef HANDLE_SEGV
-static java::lang::NullPointerException *nullp;
-
-static void
-catch_segv (int dummy)
-{
- MAKE_THROW_FRAME(dummy);
- // Don't run `new' in a signal handler, so we always throw the same
- // exception.
- _Jv_Throw (nullp);
-}
-#endif
-
-#ifdef HANDLE_FPE
-static java::lang::ArithmeticException *arithexception;
-
-static void
-catch_fpe (int dummy)
-{
- MAKE_THROW_FRAME(dummy);
- // Don't run `new' in a signal handler, so we always throw the same
- // exception.
- _Jv_Throw (arithexception);
-}
-#endif
-
class _Jv_PrimClass : public java::lang::Class
{
public:
void
JvRunMain (jclass klass, int argc, const char **argv)
{
-#ifdef HANDLE_SEGV
- {
- nullp = new java::lang::NullPointerException ();
- struct sigaction act;
- act.sa_handler = catch_segv;
- sigemptyset (&act.sa_mask);
- act.sa_flags = 0;
- sigaction (SIGSEGV, &act, NULL);
- }
-#endif
-
-#ifdef HANDLE_FPE
- {
- arithexception = new java::lang::ArithmeticException ();
- struct sigaction act;
- act.sa_handler = catch_fpe;
- sigemptyset (&act.sa_mask);
- act.sa_flags = 0;
- sigaction (SIGFPE, &act, NULL);
- }
-#endif
+ INIT_SEGV;
+ INIT_FPE;
no_memory = new java::lang::OutOfMemoryError;
+#ifdef USE_LTDL
+ LTDL_SET_PRELOADED_SYMBOLS ();
+#endif
+
arg_vec = JvConvertArgv (argc - 1, argv + 1);
main_group = new java::lang::ThreadGroup (23);
main_thread = new java::lang::FirstThread (main_group, klass, arg_vec);