#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if defined (PLATFORM_WIN32)
+#if defined (HOST_WIN32)
#include <stdlib.h>
#endif
#include <mono/utils/mono-string.h>
#include <mono/utils/mono-error-internals.h>
-
-#if defined (PLATFORM_WIN32)
+#if defined (HOST_WIN32)
#include <windows.h>
#include <shlobj.h>
#endif
replace_shadow_path (domain, dirname, &absolute);
g_free (dirname);
-#if PLATFORM_WIN32
+#if HOST_WIN32
{
gint i;
for (i = strlen (absolute) - 1; i >= 0; i--)
uri = g_filename_to_uri (absolute, NULL, NULL);
} else {
const char *prepend = "file://";
-#if PLATFORM_WIN32
+#if HOST_WIN32
if (*absolute == '/' && *(absolute + 1) == '/') {
prepend = "file:";
} else {
{
MonoMethod *m = mono_method_get_last_managed ();
- MONO_ARCH_SAVE_REGS;
+ while (m->is_inflated)
+ m = ((MonoMethodInflated*)m)->declaring;
return mono_method_get_object (mono_domain_get (), m, NULL);
}
codebase = g_strdup (absolute);
-#if PLATFORM_WIN32
+#if HOST_WIN32
{
gint i;
for (i = strlen (codebase) - 1; i >= 0; i--)
static gpointer
ves_icall_System_Reflection_Module_GetHINSTANCE (MonoReflectionModule *module)
{
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
if (module->image && module->image->is_module_handle)
return module->image->raw_data;
#endif
*/
#define FILETIME_ADJUST ((guint64)504911232000000000LL)
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
/* convert a SYSTEMTIME which is of the form "last thursday in october" to a real date */
static void
convert_to_absolute_date(SYSTEMTIME *date)
}
#endif
-#ifndef PLATFORM_WIN32
+#ifndef HOST_WIN32
/*
* Return's the offset from GMT of a local time.
*
static guint32
ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData (guint32 year, MonoArray **data, MonoArray **names)
{
-#ifndef PLATFORM_WIN32
+#ifndef HOST_WIN32
MonoDomain *domain = mono_domain_get ();
struct tm start, tt;
time_t t;
static MonoString *
ves_icall_System_Environment_get_MachineName (void)
{
-#if defined (PLATFORM_WIN32)
+#if defined (HOST_WIN32)
gunichar2 *buf;
guint32 len;
MonoString *result;
static int
ves_icall_System_Environment_get_Platform (void)
{
-#if defined (PLATFORM_WIN32)
+#if defined (TARGET_WIN32)
/* Win32NT */
return 2;
#elif defined(__MACH__)
{
MONO_ARCH_SAVE_REGS;
-#if defined (PLATFORM_WIN32)
+#if defined (HOST_WIN32)
return mono_string_new (mono_domain_get (), "\r\n");
#else
return mono_string_new (mono_domain_get (), "\n");
static MonoArray *
ves_icall_System_Environment_GetEnvironmentVariableNames (void)
{
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
MonoArray *names;
MonoDomain *domain;
MonoString *str;
ves_icall_System_Environment_InternalSetEnvironmentVariable (MonoString *name, MonoString *value)
{
MonoError error;
+#ifdef HOST_WIN32
-#ifdef PLATFORM_WIN32
gunichar2 *utf16_name, *utf16_value;
#else
gchar *utf8_name, *utf8_value;
MONO_ARCH_SAVE_REGS;
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
utf16_name = mono_string_to_utf16 (name);
if ((value == NULL) || (mono_string_length (value) == 0) || (mono_string_chars (value)[0] == 0)) {
SetEnvironmentVariable (utf16_name, NULL);
static MonoString*
ves_icall_System_Environment_GetWindowsFolderPath (int folder)
{
-#if defined (PLATFORM_WIN32)
+#if defined (HOST_WIN32)
#ifndef CSIDL_FLAG_CREATE
#define CSIDL_FLAG_CREATE 0x8000
#endif
static void
ves_icall_System_Environment_BroadcastSettingChange (void)
{
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
SendMessageTimeout (HWND_BROADCAST, WM_SETTINGCHANGE, NULL, L"Environment", SMTO_ABORTIFHUNG, 2000, 0);
#endif
}
path = g_build_path (G_DIR_SEPARATOR_S, mono_get_config_dir (), "mono", mono_get_runtime_info ()->framework_version, "machine.config", NULL);
-#if defined (PLATFORM_WIN32)
+#if defined (HOST_WIN32)
/* Avoid mixing '/' and '\\' */
{
gint i;
path = g_path_get_dirname (mono_get_config_dir ());
-#if defined (PLATFORM_WIN32)
+#if defined (HOST_WIN32)
/* Avoid mixing '/' and '\\' */
{
gint i;
static void
ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString (MonoString *message)
{
-#if defined (PLATFORM_WIN32)
+#if defined (HOST_WIN32)
OutputDebugString (mono_string_chars (message));
#else
- g_warning ("WriteWindowsDebugString called and PLATFORM_WIN32 not defined!\n");
+ g_warning ("WriteWindowsDebugString called and HOST_WIN32 not defined!\n");
#endif
}
}
static MonoReflectionMethod *
-ves_icall_MonoMethod_get_base_definition (MonoReflectionMethod *m)
+ves_icall_MonoMethod_get_base_method (MonoReflectionMethod *m, gboolean definition)
{
MonoClass *klass, *parent;
MonoMethod *method = m->method;
if (klass->generic_class)
klass = klass->generic_class->container_class;
- /* At the end of the loop, klass points to the eldest class that has this virtual function slot. */
- for (parent = klass->parent; parent != NULL; parent = parent->parent) {
- mono_class_setup_vtable (parent);
- if (parent->vtable_size <= method->slot)
- break;
- klass = parent;
- }
+ if (definition) {
+ /* At the end of the loop, klass points to the eldest class that has this virtual function slot. */
+ for (parent = klass->parent; parent != NULL; parent = parent->parent) {
+ mono_class_setup_vtable (parent);
+ if (parent->vtable_size <= method->slot)
+ break;
+ klass = parent;
+ }
+ } else {
+ klass = klass->parent;
+ if (!klass)
+ return m;
+ }
if (klass == method->klass)
return m;
iter->args = start;
} else {
iter->args = argsp + sizeof (gpointer);
-#ifndef MONO_ARCH_REGPARMS
- {
- guint32 i, arg_size;
- gint32 align;
- for (i = 0; i < iter->sig->sentinelpos; ++i) {
- arg_size = mono_type_stack_size (iter->sig->params [i], &align);
- iter->args = (char*)iter->args + arg_size;
- }
- }
-#endif
}
iter->num_args = iter->sig->param_count - iter->sig->sentinelpos;
res = mono_metadata_signature_alloc (mono_defaults.corlib, len - 1);
res->pinvoke = 1;
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
/*
* Under windows, the default pinvoke calling convention is STDCALL but
* we need CDECL.