We were using an enum that made the compiler unhappy on MacOS X. This
switches us to using <stdbool.h> when it's available.
The size of a "bool" is either sizeof(_Bool) or sizeof(enum bool), and
the assembly sources dislike ambiguity, so this also changes
gDvm.debuggerActive to always be a single byte. The ARM and x86 code
was already assuming that -- held over from when enums were
variable-width, and never fixed because we get the right answer on
little-endian platforms -- so it doesn't look like we need to change
anything in mterp.
} JValue;
/*
- * Some systems might have this in <stdbool.h>.
+ * The <stdbool.h> definition uses _Bool, a type known to the compiler.
*/
-#ifndef __bool_true_false_are_defined
+#ifdef HAVE_STDBOOL_H
+# include <stdbool.h> /* C99 */
+#else
+# ifndef __bool_true_false_are_defined
typedef enum { false=0, true=!false } bool;
-#define __bool_true_false_are_defined 1
+# define __bool_true_false_are_defined 1
+# endif
#endif
#define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0])))
/*
* JDWP debugger support.
+ *
+ * Note "debuggerActive" is accessed from mterp, so its storage size and
+ * meaning must not be changed without updating the assembly sources.
*/
bool debuggerConnected; /* debugger or DDMS is connected */
- bool debuggerActive; /* debugger is making requests */
+ u1 debuggerActive; /* debugger is making requests */
JdwpState* jdwpState;
/*
*/
/* globals (sanity check for LDR vs LDRB) */
-MTERP_SIZEOF(sizeofGlobal_debuggerActive, gDvm.debuggerActive, MTERP_SMALL_ENUM)
+MTERP_SIZEOF(sizeofGlobal_debuggerActive, gDvm.debuggerActive, 1)
#if defined(WITH_PROFILER)
MTERP_SIZEOF(sizeofGlobal_activeProfilers, gDvm.activeProfilers, 4)
#endif