+2009-02-02 Miguel de Icaza <miguel@novell.com>
+
+ From Paolo's work, refactored, cleared up:
+
+ * threadpool.c, icall.c: ifdef code that requires a working socket
+ stack.
+
+ * metadata.c (mono_metadata_field_info): Do not attempt to return
+ a value from a function declared as void.
+
+ * console-io.c: Use MONO_NULL_TTYDRIVER to remove the tty driver
+ from the console stack.
+
+ * assembly.c: use strrchr instead of rindex.
+
+ * class.c, object.c, marshal.c, icall.c, reflection.c: include
+ alloca.h on systems that have it.
+
+ * environment.c: Avoid code that uses stuff from
+ HAVE_SYS_UTSNAME_H
+
+ * appdomain.c: Include sys/time.h.
+
+ * console-io.c: include sys/ioctl.h if it is available.
+
2009-02-03 Zoltan Varga <vargaz@gmail.com>
* method-builder.h (_MonoMethodBuilder): Add a 'skip_visibility' flag.
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
#ifdef HAVE_UTIME_H
#include <utime.h>
#else
static char *
compute_base (char *path)
{
- char *p = rindex (path, '/');
+ char *p = strrchr (path, '/');
if (p == NULL)
return NULL;
return NULL;
*p = 0;
- p = rindex (path, '/');
+ p = strrchr (path, '/');
if (p == NULL)
return NULL;
*
*/
#include <config.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
#include <glib.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_SYS_FILIO_H
#include <sys/filio.h>
#endif
-#ifndef PLATFORM_WIN32
#ifndef TIOCGWINSZ
+#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#endif
static struct termios mono_attr;
#endif
-#ifdef PLATFORM_WIN32
+#if defined (PLATFORM_WIN32) || defined (MONO_NULL_TTYDRIVER)
MonoBoolean
ves_icall_System_ConsoleDriver_Isatty (HANDLE handle)
{
verinfo.dwBuildNumber);
return mono_string_new (mono_domain_get (), version);
}
-#else
+#elif defined(HAVE_SYS_UTSNAME_H)
struct utsname name;
MONO_ARCH_SAVE_REGS;
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
g_free (buf);
return result;
-#else
+#elif !defined(DISABLE_SOCKETS)
gchar buf [256];
MonoString *result;
result = NULL;
return result;
+#else
+ return mono_string_new (mono_domain_get (), "mono");
#endif
}
*/
#include "config.h"
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+
#include "object.h"
#include "loader.h"
#include "cil-coff.h"
*/
#include <config.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
mono_metadata_field_info (MonoImage *meta, guint32 index, guint32 *offset, guint32 *rva,
MonoMarshalSpec **marshal_spec)
{
- return mono_metadata_field_info_with_mempool (NULL, meta, index, offset, rva, marshal_spec);
+ mono_metadata_field_info_with_mempool (NULL, meta, index, offset, rva, marshal_spec);
}
void
mono_metadata_field_info_with_mempool (MonoMemPool *mempool, MonoImage *meta, guint32 index, guint32 *offset, guint32 *rva,
- MonoMarshalSpec **marshal_spec)
+ MonoMarshalSpec **marshal_spec)
{
MonoTableInfo *tdef;
locator_t loc;
* (C) 2001-2004 Ximian, Inc.
*/
#include <config.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
*
*/
#include <config.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
#include "mono/utils/mono-digest.h"
#include "mono/utils/mono-membar.h"
#include "mono/metadata/reflection.h"
#include <sys/epoll.h>
#endif
+#ifndef DISABLE_SOCKETS
#include "mono/io-layer/socket-wrappers.h"
+#endif
#include "threadpool.h"
AIO_OP_LAST
};
+#ifdef DISABLE_SOCKETS
+#define socket_io_cleanup(x)
+#else
static void
socket_io_cleanup (SocketIOData *data)
{
(SOCKET)(gssize)x->handle, x->buffer, x->offset, x->size,\
x->socket_flags, &x->error);
+#endif /* !DISABLE_SOCKETS */
static void
unregister_job (MonoAsyncResult *obj)
return FALSE;
}
+#ifndef DISABLE_SOCKETS
static void
async_invoke_io_thread (gpointer data)
{
return TRUE;
}
+#endif /* !DISABLE_SOCKETS */
static void
mono_async_invoke (MonoAsyncResult *ares)
mono_g_hash_table_insert (ares_htable, ares, ares);
LeaveCriticalSection (&ares_lock);
+#ifndef DISABLE_SOCKETS
if (socket_io_filter (target, state)) {
socket_io_add (ares, (MonoSocketAsyncResult *) state);
return ares;
}
-
+#endif
+
start_thread_or_queue (ares);
return ares;
}