Initial work to build libgcmonosgen under none desktop Windows API families.
Changes are mainly related to header files included by libgcmonosgen sources and shared
by other libraries.
#ifndef _MONO_IOLAYER_IOLAYER_H_
#define _MONO_IOLAYER_IOLAYER_H_
+#include <config.h>
+#include <glib.h>
+
#if defined(__WIN32__) || defined(_WIN32)
/* Native win32 */
#define __USE_W32_SOCKETS
#include <ws2tcpip.h>
#endif
#include <psapi.h>
-#include <shlobj.h>
-/*
+
+ /*
* Workaround for missing WSAPOLLFD typedef in mingw's winsock2.h that is required for mswsock.h below.
* Remove once http://sourceforge.net/p/mingw/bugs/1980/ is fixed.
*/
short revents;
} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
#endif
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
#include <mswsock.h>
+#endif
+
#else /* EVERYONE ELSE */
#include "mono/io-layer/wapi.h"
#include "mono/io-layer/uglify.h"
#include <string.h>
#include <errno.h>
+#if defined(HOST_WIN32)
+#include <oleauto.h>
+#endif
+
/*
Code shared between the DISABLE_COM and !DISABLE_COM
*/
#include <string.h>
#include <errno.h>
+#if defined(HOST_WIN32)
+#include <objbase.h>
+#endif
+
/* #define DEBUG_RUNTIME_CODE */
#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
#include <signal.h>
#endif
+#if defined(HOST_WIN32)
+#include <objbase.h>
+#endif
+
#if defined(PLATFORM_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64)
#define USE_TKILL_ON_ANDROID 1
#endif
fprintf (out, "ref-array %lu\n", count_ref_array);
fprintf (out, "vtype-array %lu\n", count_vtype_array);
}
+#else
+#ifdef _MSC_VER
+// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
+void __mono_win32_sgen_layout_stats_quiet_lnk4221(void) {}
#endif
+#endif /* SGEN_OBJECT_LAYOUT_STATISTICS */
#endif
static inline void
mono_os_sem_init (MonoSemType *sem, int value)
{
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
*sem = CreateSemaphore (NULL, value, 0x7FFFFFFF, NULL);
+#else
+ *sem = CreateSemaphoreEx (NULL, value, 0x7FFFFFFF, NULL, 0, SEMAPHORE_ALL_ACCESS);
+#endif
+
if (G_UNLIKELY (*sem == NULL))
g_error ("%s: CreateSemaphore failed with error %d", __func__, GetLastError ());
}