From: Paolo Molaro Date: Tue, 10 Aug 2004 08:56:49 +0000 (-0000) Subject: Handle old compilers in array init. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=c74a25cdc449911007c37a7c9e4f7f6f1b384bf9;p=mono.git Handle old compilers in array init. svn path=/trunk/mono/; revision=32134 --- diff --git a/mono/metadata/opcodes.c b/mono/metadata/opcodes.c index c7328c15c50..f8b43023472 100644 --- a/mono/metadata/opcodes.c +++ b/mono/metadata/opcodes.c @@ -8,6 +8,7 @@ */ #include #include /* for NULL */ +#include #define MONO_PREFIX1_OFFSET MONO_CEE_ARGLIST #define MONO_CUSTOM_PREFIX_OFFSET MONO_CEE_MONO_ICALL @@ -23,6 +24,7 @@ mono_opcodes [MONO_CEE_LAST + 1] = { #undef OPDEF +#ifdef HAVE_ARRAY_ELEM_INIT #define MSGSTRFIELD(line) MSGSTRFIELD1(line) #define MSGSTRFIELD1(line) str##line static const struct msgstr_t { @@ -34,7 +36,7 @@ static const struct msgstr_t { #include "mono/cil/opcode.def" #undef OPDEF }; -static const int opidx [] = { +static const gint16 opidx [] = { #define OPDEF(a,b,c,d,e,f,g,h,i,j) [MONO_ ## a] = offsetof (struct msgstr_t, MSGSTRFIELD(__LINE__)), #include "mono/cil/opcode.def" #undef OPDEF @@ -46,6 +48,22 @@ mono_opcode_name (int opcode) return (const char*)&opstr + opidx [opcode]; } +#else +#define OPDEF(a,b,c,d,e,f,g,h,i,j) b, +static const char* const +mono_opcode_names [MONO_CEE_LAST + 1] = { +#include "mono/cil/opcode.def" + NULL +}; + +const char* +mono_opcode_name (int opcode) +{ + return mono_opcode_names [opcode]; +} + +#endif + MonoOpcodeEnum mono_opcode_value (const guint8 **ip, const guint8 *end) {