Hi,

With respect to the comments to the previous patch I revised it. I have added version macros to CPPFLAGS without removing existing settings and exported CPPFLAGS for libgc.

I also added compile time ARCHITECTURE detection to winconfig.h in addition to the enhancements in the previously proposed patch.

Please lease let me know if this patch is OK to commit.

Kornél
Index: mono/configure.in
===================================================================
--- mono/configure.in   (revision 97936)
+++ mono/configure.in   (working copy)
@@ -70,7 +70,10 @@
                        export CC
                fi
                HOST_CC="gcc"
-               CPPFLAGS="$CPPFLAGS -DWIN32_THREADS -DFD_SETSIZE=1024 -DUNICODE 
-D_UNICODE"
+               # Windows 2000 is required that includes Internet Explorer 5.01
+               CPPFLAGS="$CPPFLAGS -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 
-D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
+               # export for libgc configure
+               export CPPFLAGS
                libmono_cflags="-mno-cygwin"
                libmono_ldflags="-mno-cygwin"
                libdl=
Index: mono/mono/metadata/file-io.c
===================================================================
--- mono/mono/metadata/file-io.c        (revision 97936)
+++ mono/mono/metadata/file-io.c        (working copy)
@@ -11,10 +11,6 @@

#include <config.h>

-#ifdef PLATFORM_WIN32
-#define _WIN32_WINNT 0x0500
-#endif
-
#include <glib.h>
#include <string.h>
#include <errno.h>
Index: mono/mono/metadata/threads.c
===================================================================
--- mono/mono/metadata/threads.c        (revision 97936)
+++ mono/mono/metadata/threads.c        (working copy)
@@ -10,9 +10,6 @@
 */

#include <config.h>
-#ifdef PLATFORM_WIN32
-#define _WIN32_WINNT 0x0500
-#endif

#include <glib.h>
#include <signal.h>
Index: mono/mono/metadata/threadpool.c
===================================================================
--- mono/mono/metadata/threadpool.c     (revision 97936)
+++ mono/mono/metadata/threadpool.c     (working copy)
@@ -12,11 +12,6 @@
#include <config.h>
#include <glib.h>

-#ifdef PLATFORM_WIN32
-#define WINVER 0x0500
-#define _WIN32_WINNT 0x0500
-#endif
-
#define THREADS_PER_CPU 5 /* 20 + THREADS_PER_CPU * number of CPUs */

#include <mono/metadata/domain-internals.h>
Index: mono/mono/io-layer/io-layer.h
===================================================================
--- mono/mono/io-layer/io-layer.h       (revision 97936)
+++ mono/mono/io-layer/io-layer.h       (working copy)
@@ -14,7 +14,6 @@
#if defined(__WIN32__)
/* Native win32 */
#define __USE_W32_SOCKETS
-#define WINVER 0x0500 /* needed for CreateProcessWithLogonW */
#include <winsock2.h>
#include <windows.h>
#include <winbase.h>
Index: mono/mono/mini/mini.c
===================================================================
--- mono/mono/mini/mini.c       (revision 97936)
+++ mono/mono/mini/mini.c       (working copy)
@@ -26,10 +26,6 @@
#include <pthread.h>
#endif

-#ifdef PLATFORM_WIN32
-#define _WIN32_WINNT 0x0500
-#endif
-
#ifdef HAVE_VALGRIND_MEMCHECK_H
#include <valgrind/memcheck.h>
#endif
Index: mono/winconfig.h
===================================================================
--- mono/winconfig.h    (revision 97936)
+++ mono/winconfig.h    (working copy)
@@ -1,5 +1,39 @@
/* config.h.  Generated by configure.  */
/* config.h.in.  Generated from configure.in by autoheader.  */
+
+/* Version macros for Windows SDK headers */
+#ifdef _WIN64
+#ifdef _M_IA64
+/* Windows XP 64-bit Edition (Itanium) is the first release that is based on 
Windows XP */
+#define WINVER 0x0501
+#define _WIN32_WINNT 0x0501
+/* Includes Internet Explorer 6.0 */
+#define _WIN32_IE 0x0600
+#else /* !_M_IA64 */
+/* Windows XP Professional x64 Edition is the first release that is based on 
Windows Server 2003 SP1 */
+#define WINVER 0x0502
+#define _WIN32_WINNT 0x0502
+/* Includes Internet Explorer 6.0 SP2 */
+#define _WIN32_IE 0x0603
+#endif /* _M_IA64 */
+#else /* !_WIN64 */
+/* Windows 2000 is required */
+#define WINVER 0x0500
+#define _WIN32_WINNT 0x0500
+/* Includes Internet Explorer 5.01 */
+#define _WIN32_IE 0x0501
+#endif /* _WIN64 */
+
+#ifndef _UNICODE
+#define _UNICODE
+#endif
+#ifndef UNICODE
+#define UNICODE
+#endif
+
+#define WIN32_THREADS
+#define FD_SETSIZE 1024
+
/* #undef HAVE_INET_PTON */
/* #undef HAVE_INET_ATON */
/* #undef HAVE_MSG_NOSIGNAL */
@@ -40,14 +74,19 @@
/* #undef HAVE_WORKING_SIGALTSTACK */

/* The architecture this is running on */
+#if defined(_M_IA64)
+#define ARCHITECTURE "ia64"
+#elif defined(_M_AMD64)
+#define ARCHITECTURE "amd64"
+#elif defined(_M_IX86)
#define ARCHITECTURE "x86"
+#else
+#error Unknown architecture
+#endif

/* String of disabled features */
#define DISABLED_FEATURES "none"

-/* Have GetProcessId */
-#define HAVE_GETPROCESSID 1
-
/* Disable AOT support */
/* #undef DISABLE_AOT */

@@ -151,7 +190,9 @@
/* #undef HAVE_GETGRNAM_R */

/* Define to 1 if you have the `GetProcessId' function. */
-/* #undef HAVE_GETPROCESSID */
+#if (_WIN32_WINNT >= 0x0502)
+#define HAVE_GETPROCESSID 1
+#endif

/* Define to 1 if you have the `getpwnam_r' function. */
/* #undef HAVE_GETPWNAM_R */
@@ -430,7 +471,11 @@
/* #undef SIZEOF_SIZE_T */

/* The size of a `void *', as computed by sizeof. */
+#ifdef _WIN64
+#define SIZEOF_VOID_P 8
+#else
#define SIZEOF_VOID_P 4
+#endif

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
@@ -439,8 +484,4 @@
#define USED_GC_NAME "Included Boehm (with typed GC)"

/* Version number of package */
-#define VERSION "1.2"
-
-#define WINVER 0x0500
-
-#define _WIN32_WINNT 0x0500
\ No newline at end of file
+#define VERSION "1.9"
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to