/* src/vm/global.h - global definitions
- Copyright (C) 1996-2005, 2006, 2007, 2008
+ Copyright (C) 1996-2005, 2006, 2007, 2008, 2010
CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
This file is part of CACAO.
/* Define printf formats which change size between 32- and 64-bit. */
#if SIZEOF_VOID_P == 8
+# define PRINTF_FORMAT_INTPTR_T "0x%016lx"
# define PRINTF_FORMAT_INT64_T "%ld"
#else
+# define PRINTF_FORMAT_INTPTR_T "0x%08lx"
# define PRINTF_FORMAT_INT64_T "%lld"
#endif
#define STR(a) #a
+/* There are multiple definitions of MIN out there, but we cannot be sure. */
+
+#ifndef MIN
+# define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+
+#ifndef MAX
+# define MAX(a,b) (((a) > (b)) ? (a) : (b))
+#endif
+
/* forward typedefs ***********************************************************/
struct java_object_t { /* header for all objects */
struct _vftbl *vftbl; /* pointer to virtual function table */
#if defined(ENABLE_THREADS)
- Lockword lockword;
+ uintptr_t lockword;
#endif
#if defined(ENABLE_GC_CACAO)
uintptr_t hdrflags; /* word containing the GC bits */