mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
Compare commits
278
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71f882382b | ||
|
|
5ac37ccd38 | ||
|
|
7445137604 | ||
|
|
5ad371dab1 | ||
|
|
b1921c2635 | ||
|
|
29eb176dd9 | ||
|
|
45e519e9df | ||
|
|
de14ec6c78 | ||
|
|
b041669258 | ||
|
|
d2e33f5f5c | ||
|
|
32f1873983 | ||
|
|
7f8afd4007 | ||
|
|
f59b876a81 | ||
|
|
bbf2394619 | ||
|
|
98810acba1 | ||
|
|
d946a25079 | ||
|
|
4d2b7f8b01 | ||
|
|
89fe6abeef | ||
|
|
9d21a2bb15 | ||
|
|
163f45d81c | ||
|
|
208d5a5f1b | ||
|
|
bcc1b83e82 | ||
|
|
7a3ce9849f | ||
|
|
13204572a4 | ||
|
|
2359cba40e | ||
|
|
a4956c837e | ||
|
|
d4d4fb7987 | ||
|
|
b6c818b204 | ||
|
|
204f917c97 | ||
|
|
70a207adaa | ||
|
|
287b5598f9 | ||
|
|
9939c1a656 | ||
|
|
b0c4390d60 | ||
|
|
725ba2a252 | ||
|
|
1dee62626d | ||
|
|
146c8191fb | ||
|
|
5d3077c7bc | ||
|
|
5266e6a8f1 | ||
|
|
0d988bc696 | ||
|
|
e6285d015b | ||
|
|
51c4f45402 | ||
|
|
3bf37058fd | ||
|
|
25a8be9111 | ||
|
|
29e0e642da | ||
|
|
7b44d5719e | ||
|
|
3fad9a7a1c | ||
|
|
6b6fd890ee | ||
|
|
8f50f96e8f | ||
|
|
1edf795ae0 | ||
|
|
9671417e21 | ||
|
|
047d0abd5c | ||
|
|
237c5fedc7 | ||
|
|
bac9fc1f88 | ||
|
|
88eafb72e4 | ||
|
|
3f799cc3c7 | ||
|
|
0d9e781cb6 | ||
|
|
35a1ed626d | ||
|
|
03b9354ed9 | ||
|
|
f919fb58c4 | ||
|
|
95fbc22436 | ||
|
|
bcda004855 | ||
|
|
f0e466618d | ||
|
|
23f2024af8 | ||
|
|
414cafac93 | ||
|
|
68746a81f2 | ||
|
|
1f62222fa6 | ||
|
|
d0184b6970 | ||
|
|
a4c0912ecf | ||
|
|
7b9d9b3f1b | ||
|
|
e3a4484af7 | ||
|
|
99b6da7944 | ||
|
|
2f57669e30 | ||
|
|
0206338c1e | ||
|
|
b20dad6656 | ||
|
|
0f81533ae3 | ||
|
|
81f3c4763e | ||
|
|
6a9ee132c1 | ||
|
|
b8ebc791fc | ||
|
|
32d4b6f22a | ||
|
|
925e0c0d0c | ||
|
|
65cd16c227 | ||
|
|
b5891e25ac | ||
|
|
d4d1d1ec24 | ||
|
|
3837f0c276 | ||
|
|
2e5c0d8f1e | ||
|
|
60c21beaeb | ||
|
|
3c2b25ce23 | ||
|
|
5fedefe43e | ||
|
|
53a21a0e84 | ||
|
|
04bdf8852b | ||
|
|
8df60a29bf | ||
|
|
d90fbe3a0a | ||
|
|
ea740d2bc8 | ||
|
|
0522076f0b | ||
|
|
6034c589df | ||
|
|
aebff6ce01 | ||
|
|
818a27a386 | ||
|
|
b5e8de9182 | ||
|
|
205b8129d5 | ||
|
|
c2c764dfc6 | ||
|
|
b778499454 | ||
|
|
b7ad1c6923 | ||
|
|
7a7768ff51 | ||
|
|
fb7328e644 | ||
|
|
d88635a373 | ||
|
|
465b71e99d | ||
|
|
5756ba4b46 | ||
|
|
d7dcd456b3 | ||
|
|
145155d8cf | ||
|
|
423928c21d | ||
|
|
b83fc43c32 | ||
|
|
9bc88897b7 | ||
|
|
74788c7505 | ||
|
|
a4b6322c4f | ||
|
|
934cf3c65a | ||
|
|
bc9d709e70 | ||
|
|
31a6b877f6 | ||
|
|
4b343e98f3 | ||
|
|
2bc1ed09a3 | ||
|
|
010e741bac | ||
|
|
ec1a736266 | ||
|
|
a9b1acbee1 | ||
|
|
81326b8896 | ||
|
|
04bde6eb75 | ||
|
|
2653d3eeda | ||
|
|
47e556d4cf | ||
|
|
9f72a46b41 | ||
|
|
2712292c56 | ||
|
|
839f49d3b2 | ||
|
|
657f915eb6 | ||
|
|
bd1f64acc3 | ||
|
|
7805ccc43d | ||
|
|
04a6e8294e | ||
|
|
f001e691ca | ||
|
|
7001d39bb2 | ||
|
|
e257971d3c | ||
|
|
4d41b0560f | ||
|
|
8ecede131d | ||
|
|
577ac4fd91 | ||
|
|
dfd13979ad | ||
|
|
cae86185c2 | ||
|
|
05c480e635 | ||
|
|
5c70d5b946 | ||
|
|
2b620cc54b | ||
|
|
8d220f3913 | ||
|
|
54700cf89f | ||
|
|
d7ff201b56 | ||
|
|
0a27b0f72d | ||
|
|
1644a1a01d | ||
|
|
3e89a56e50 | ||
|
|
9f01ca1a9f | ||
|
|
8b099949ad | ||
|
|
f21a48dad5 | ||
|
|
2cc940be99 | ||
|
|
25cfd22997 | ||
|
|
03a769f787 | ||
|
|
ced11fba7b | ||
|
|
aed3298ae2 | ||
|
|
425b46eca7 | ||
|
|
d507bd8929 | ||
|
|
bc97d1e742 | ||
|
|
d2ae599e2c | ||
|
|
005c804cb2 | ||
|
|
96d8a05b06 | ||
|
|
5df25e7d88 | ||
|
|
65c1b941f9 | ||
|
|
e6be71c516 | ||
|
|
a65b4f5548 | ||
|
|
0a85488fde | ||
|
|
b4b0d0fa35 | ||
|
|
2a9ad9b4d4 | ||
|
|
1a309a7b45 | ||
|
|
49b5001dfd | ||
|
|
2bceefe4e6 | ||
|
|
56bed71f11 | ||
|
|
62412a804c | ||
|
|
ef105562be | ||
|
|
2510fd9253 | ||
|
|
b76a034c12 | ||
|
|
d4f52d1116 | ||
|
|
c3f4e28057 | ||
|
|
b402c5bcf3 | ||
|
|
4504185ee9 | ||
|
|
63de341bb8 | ||
|
|
9946fef5a3 | ||
|
|
2e3c7693c9 | ||
|
|
228cab7601 | ||
|
|
c12aa07fd7 | ||
|
|
ee57ffc058 | ||
|
|
7298849995 | ||
|
|
eac547723c | ||
|
|
947193b9e2 | ||
|
|
522cd7ce2a | ||
|
|
1bdb478a71 | ||
|
|
1518670974 | ||
|
|
b5f8508f6f | ||
|
|
ea17477aac | ||
|
|
ed5b463839 | ||
|
|
60f295e675 | ||
|
|
0ab763464d | ||
|
|
2ef3349e76 | ||
|
|
bf580871f2 | ||
|
|
c19ca0ded5 | ||
|
|
51ea240a35 | ||
|
|
3e238c836c | ||
|
|
802091af08 | ||
|
|
4dbe2ced4e | ||
|
|
2d50ef119b | ||
|
|
eae59de800 | ||
|
|
ad0854917e | ||
|
|
0e91bc8dd9 | ||
|
|
6d2a0eb4aa | ||
|
|
80ade74200 | ||
|
|
9d6252eb65 | ||
|
|
b5f8d09d91 | ||
|
|
a2649d5d40 | ||
|
|
44a01472b1 | ||
|
|
75f66645c4 | ||
|
|
756f617d2b | ||
|
|
9256a02e8d | ||
|
|
207b7b6525 | ||
|
|
10b2571905 | ||
|
|
e8415ffe23 | ||
|
|
805dfec75d | ||
|
|
b7635aed96 | ||
|
|
f99f8aeacd | ||
|
|
2a71a71c7b | ||
|
|
eedc49b402 | ||
|
|
4151ad78f1 | ||
|
|
056528177e | ||
|
|
c1910c80f4 | ||
|
|
1054aba62a | ||
|
|
d0fed2af14 | ||
|
|
85a7f7aca1 | ||
|
|
6a783bb78c | ||
|
|
dd97b32959 | ||
|
|
67ed6f3152 | ||
|
|
22738e7d30 | ||
|
|
ffae0deeba | ||
|
|
b072bc6749 | ||
|
|
82ac95b94e | ||
|
|
faac90015c | ||
|
|
4368bb5d0a | ||
|
|
101736c438 | ||
|
|
bd20434769 | ||
|
|
84a848a68f | ||
|
|
91eaa0832c | ||
|
|
94bb56808f | ||
|
|
f236586422 | ||
|
|
2a490e383b | ||
|
|
59277c72b7 | ||
|
|
d0e57fbac4 | ||
|
|
226c6a8b54 | ||
|
|
b11c4232fd | ||
|
|
29d91bd6cf | ||
|
|
3e8a282bc3 | ||
|
|
ba38f97879 | ||
|
|
64e9b1a983 | ||
|
|
2e16537134 | ||
|
|
6a844e7677 | ||
|
|
cc3d5f0374 | ||
|
|
2245249f6d | ||
|
|
f123d67e04 | ||
|
|
d551bcc1f2 | ||
|
|
b606864198 | ||
|
|
0242e31892 | ||
|
|
5de08e1822 | ||
|
|
55ff5b426f | ||
|
|
9c01d63b45 | ||
|
|
031968ad2e | ||
|
|
079aff5529 | ||
|
|
721092cc06 | ||
|
|
9f65ed3311 | ||
|
|
cf4eb293da | ||
|
|
1f44a5e5a0 | ||
|
|
6f31677959 | ||
|
|
42e523a21e | ||
|
|
1c5f8bc400 |
No files matched your search
@@ -49,6 +49,7 @@
|
||||
[submodule "external/corert"]
|
||||
path = external/corert
|
||||
url = git://github.com/mono/corert.git
|
||||
branch = mono-2018-08
|
||||
[submodule "external/xunit-binaries"]
|
||||
path = external/xunit-binaries
|
||||
url = git://github.com/mono/xunit-binaries.git
|
||||
|
||||
+112
-47
@@ -1,7 +1,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#AC_PREREQ([2.62])
|
||||
|
||||
AC_INIT(mono, [5.17.0],
|
||||
AC_INIT(mono, [5.18.0],
|
||||
[https://github.com/mono/mono/issues/new])
|
||||
|
||||
AC_CONFIG_SRCDIR([README.md])
|
||||
@@ -46,7 +46,7 @@ MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
|
||||
# There is no ordering of corlib versions, no old or new,
|
||||
# the runtime expects an exact match.
|
||||
#
|
||||
MONO_CORLIB_VERSION=40525B4A-F860-49BF-936E-6B29CBBF357C
|
||||
MONO_CORLIB_VERSION=179F7FD7-9CE8-424E-84AF-0DF5B0B8B469
|
||||
|
||||
#
|
||||
# Put a quoted #define in config.h.
|
||||
@@ -532,6 +532,8 @@ AC_PROG_LD_GNU
|
||||
|
||||
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h sys/param.h sys/sysctl.h libproc.h sys/prctl.h copyfile.h)
|
||||
AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h arpa/inet.h complex.h unwind.h)
|
||||
AC_CHECK_HEADER(unistd.h, [HAVE_UNISTD_H=1], [HAVE_UNISTD_H=0])
|
||||
AC_SUBST(HAVE_UNISTD_H)
|
||||
AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h],
|
||||
[], [], [#include <stddef.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -605,6 +607,7 @@ AC_CHECK_HEADERS(linux/magic.h)
|
||||
if test x$platform_android = xyes; then
|
||||
AC_CHECK_HEADERS(machine/endian.h sys/endian.h)
|
||||
AC_CHECK_HEADERS(android/legacy_signal_inlines.h, [have_android_signal_inlines=yes], [have_android_signal_inlines=no])
|
||||
AC_CHECK_HEADERS(android/ndk-version.h)
|
||||
|
||||
# Make sure SIGRT{MIN,MAX} work - they will fail to work with unified headers if building for
|
||||
# API level < 21 *and* android/legacy_signal_inlines.h doesn't declare (and define) the required
|
||||
@@ -614,7 +617,8 @@ if test x$platform_android = xyes; then
|
||||
if test x$have_android_signal_inlines = xyes; then
|
||||
AC_MSG_CHECKING([Whether Android SIGRTMIN/SGRTMAX macros are valid])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([#include <android/legacy_signal_inlines.h>],[
|
||||
AC_LANG_PROGRAM([#include <signal.h>
|
||||
#include <android/legacy_signal_inlines.h>],[
|
||||
int i;
|
||||
for (i = SIGRTMIN + 1; i < SIGRTMAX; ++i) {
|
||||
}
|
||||
@@ -1002,6 +1006,7 @@ fi
|
||||
|
||||
AC_ARG_WITH(crash-privacy, [ --with-crash_privacy=yes,no If you want your crashes to not include names of symbols present in the binary. ], [], [with_crash_privacy=no])
|
||||
AC_ARG_WITH(structured-crashes, [ --with-structured_crashes=yes,no If you want your unmanaged crashes to result in a small crash dump file. ], [], [with_structured_crashes=yes])
|
||||
AC_ARG_ENABLE(crash-reporting, [ --disable-crash-reporting Enable or Disable crash reporting subsystem], [crash_reporting=$enableval], [crash_reporting=yes])
|
||||
|
||||
if test "x$with_crash_privacy" = "xno"; then
|
||||
AC_DEFINE(MONO_PRIVATE_CRASHES,1,[Do not include names of unmanaged functions in the crash dump])
|
||||
@@ -1011,6 +1016,15 @@ if test "x$with_structured_crashes" = "xno"; then
|
||||
AC_DEFINE(DISABLE_STRUCTURED_CRASH,1,[Do not create structured crash files during unmanaged crashes])
|
||||
fi
|
||||
|
||||
if test "x$host_win32" = "xyes"; then
|
||||
crash_reporting=no
|
||||
fi
|
||||
|
||||
if test "x$crash_reporting" != "xyes"; then
|
||||
CFLAGS="$CFLAGS -DDISABLE_CRASH_REPORTING=1"
|
||||
CXXFLAGS="$CXXFLAGS -DDISABLE_CRASH_REPORTING=1"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(monodroid, [ --enable-monodroid Enable runtime support for Monodroid (Xamarin.Android)], enable_monodroid=$enableval, enable_monodroid=no)
|
||||
AM_CONDITIONAL(ENABLE_MONODROID, test x$enable_monodroid = xyes)
|
||||
|
||||
@@ -2378,7 +2392,7 @@ if test x$host_win32 = xno; then
|
||||
AC_CHECK_HEADERS(pthread.h)
|
||||
AC_CHECK_HEADERS(pthread_np.h)
|
||||
AC_CHECK_FUNCS(pthread_mutex_timedlock)
|
||||
AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np pthread_setname_np pthread_cond_timedwait_relative_np)
|
||||
AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np pthread_getname_np pthread_setname_np pthread_cond_timedwait_relative_np)
|
||||
AC_CHECK_FUNCS(pthread_kill)
|
||||
AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
|
||||
AC_TRY_COMPILE([ #include <pthread.h>], [
|
||||
@@ -2844,6 +2858,7 @@ if test x$host_win32 = xno; then
|
||||
AC_CHECK_FUNCS(setpgid)
|
||||
AC_CHECK_FUNCS(system)
|
||||
AC_CHECK_FUNCS(fork execv execve)
|
||||
AC_CHECK_FUNCS(waitpid)
|
||||
AC_CHECK_FUNCS(accept4)
|
||||
AC_CHECK_FUNCS(localtime_r)
|
||||
AC_CHECK_FUNCS(mkdtemp)
|
||||
@@ -3787,41 +3802,42 @@ internal_llvm="no"
|
||||
if test "x$enable_llvm" = "xyes"; then
|
||||
if test "x$with_llvm" != "x"; then
|
||||
EXTERNAL_LLVM_CONFIG=$with_llvm/bin/llvm-config
|
||||
if test x$host_win32 = xyes; then
|
||||
EXTERNAL_LLVM_CONFIG=$EXTERNAL_LLVM_CONFIG.exe
|
||||
fi
|
||||
if test ! -x $EXTERNAL_LLVM_CONFIG; then
|
||||
AC_MSG_ERROR([LLVM executable $EXTERNAL_LLVM_CONFIG not found.])
|
||||
fi
|
||||
else
|
||||
AC_PATH_PROG(EXTERNAL_LLVM_CONFIG, llvm-config, no)
|
||||
if test x$host_win32 = xyes; then
|
||||
AC_PATH_PROG(EXTERNAL_LLVM_CONFIG, llvm-config.exe, no)
|
||||
else
|
||||
AC_PATH_PROG(EXTERNAL_LLVM_CONFIG, llvm-config, no)
|
||||
fi
|
||||
if test "x$EXTERNAL_LLVM_CONFIG" = "xno"; then
|
||||
internal_llvm=yes
|
||||
else
|
||||
with_llvm=`$EXTERNAL_LLVM_CONFIG --prefix`
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$host_win32" != "xyes"; then
|
||||
LLVM_CODEGEN_LIBS="x86codegen"
|
||||
case "$target" in
|
||||
arm*)
|
||||
LLVM_CODEGEN_LIBS="armcodegen"
|
||||
;;
|
||||
aarch64*)
|
||||
LLVM_CODEGEN_LIBS="aarch64codegen"
|
||||
;;
|
||||
powerpc*)
|
||||
LLVM_CODEGEN_LIBS="powerpccodegen"
|
||||
;;
|
||||
esac
|
||||
if test "x$host" != "x$target"; then
|
||||
# No need for jit libs
|
||||
LLVM_CODEGEN_LIBS=
|
||||
fi
|
||||
|
||||
AC_SUBST(LLVM_CODEGEN_LIBS)
|
||||
AC_SUBST(EXTERNAL_LLVM_CONFIG)
|
||||
else # is win32
|
||||
AC_MSG_ERROR([LLVM for Windows only supported using Visual Studio build mono runtime, see http://www.mono-project.com/docs/advanced/mono-llvm/ for more details.])
|
||||
fi # win32
|
||||
LLVM_CODEGEN_LIBS="x86codegen"
|
||||
case "$target" in
|
||||
arm*)
|
||||
LLVM_CODEGEN_LIBS="armcodegen"
|
||||
;;
|
||||
aarch64*)
|
||||
LLVM_CODEGEN_LIBS="aarch64codegen"
|
||||
;;
|
||||
powerpc*)
|
||||
LLVM_CODEGEN_LIBS="powerpccodegen"
|
||||
;;
|
||||
esac
|
||||
if test "x$host" != "x$target"; then
|
||||
# No need for jit libs
|
||||
LLVM_CODEGEN_LIBS=
|
||||
fi
|
||||
|
||||
AC_SUBST(LLVM_CODEGEN_LIBS)
|
||||
AC_SUBST(EXTERNAL_LLVM_CONFIG)
|
||||
|
||||
AC_DEFINE(ENABLE_LLVM, 1, [Enable the LLVM back end])
|
||||
fi # ENABLE_LLVM
|
||||
@@ -3954,7 +3970,7 @@ case "$host" in
|
||||
TARGET=AMD64;
|
||||
arch_target=amd64;
|
||||
if test "x$ac_cv_sizeof_void_p" = "x4"; then
|
||||
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
|
||||
AC_DEFINE(MONO_ARCH_ILP32, 1, [64 bit mode with 4 byte longs and pointers])
|
||||
sizeof_register=8
|
||||
fi
|
||||
case $host_os in
|
||||
@@ -4072,6 +4088,14 @@ case "$host" in
|
||||
ACCESS_UNALIGNED="no"
|
||||
CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
|
||||
;;
|
||||
aarch64-*darwin*ilp32)
|
||||
TARGET=ARM64;
|
||||
arch_target=arm64
|
||||
AC_DEFINE(MONO_ARCH_ILP32, 1, [64 bit mode with 4 byte longs and pointers])
|
||||
sizeof_register=8
|
||||
# assuming no other target other than watchOS is using aarch64*darwin triple
|
||||
TARGET_SYS=WATCHOS
|
||||
;;
|
||||
aarch64-*)
|
||||
# https://lkml.org/lkml/2012/7/15/133
|
||||
TARGET=ARM64
|
||||
@@ -4121,7 +4145,7 @@ if test "x$host" != "x$target"; then
|
||||
# It would be better to just use TARGET_POWERPC64, but lots of code already
|
||||
# uses this define
|
||||
AC_DEFINE(__mono_ppc64__, 1, [...])
|
||||
AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
|
||||
AC_DEFINE(MONO_ARCH_ILP32, 1, [64 bit mode with 4 byte longs and pointers])
|
||||
sizeof_register=8
|
||||
target_byte_order=G_BIG_ENDIAN
|
||||
;;
|
||||
@@ -4539,6 +4563,7 @@ AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
|
||||
AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf)
|
||||
AC_CHECK_FUNCS(getrlimit)
|
||||
AC_CHECK_FUNCS(fork execv execve)
|
||||
AC_CHECK_FUNCS(waitpid)
|
||||
|
||||
AC_ARG_WITH([overridable-allocators], [ --with-overridable-allocators allow g_*alloc/g_free to call custom allocators set via g_mem_set_vtable])
|
||||
|
||||
@@ -4562,8 +4587,6 @@ elif test x$target_ios = xno; then
|
||||
AC_CHECK_FUNCS(strndup getpwuid_r)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators = xyes)
|
||||
|
||||
AC_SEARCH_LIBS(sqrtf, m)
|
||||
|
||||
# nanosleep may not be part of libc, also search it in other libraries
|
||||
@@ -5011,11 +5034,12 @@ if test x$enable_cooperative_suspend_default != xyes; then
|
||||
X86 | AMD64)
|
||||
dnl Some host/target confusion, there's no host_osx (and
|
||||
dnl host_darwin would be true on iOS not just macOS).
|
||||
if test x$target_osx = xyes; then
|
||||
enable_hybrid_suspend_default=yes
|
||||
elif test x$host_linux = xyes -o x$host_win32 = xyes; then
|
||||
enable_hybrid_suspend_default=yes
|
||||
fi
|
||||
dnl if test x$target_osx = xyes; then
|
||||
dnl enable_hybrid_suspend_default=yes
|
||||
dnl elif test x$host_linux = xyes -o x$host_win32 = xyes; then
|
||||
dnl enable_hybrid_suspend_default=yes
|
||||
dnl fi
|
||||
true
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
@@ -5061,7 +5085,7 @@ dnl **********************
|
||||
dnl *** checked builds ***
|
||||
dnl **********************
|
||||
|
||||
AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable checked build (expensive asserts), configure with a comma-separated LIST of checked build modules and then include that same list in the environment variable MONO_CHECK_MODE at runtime. Recognized checked build modules: all, gc, metadata, thread, private_types],[
|
||||
AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable checked build (expensive asserts), configure with a comma-separated LIST of checked build modules and then include that same list in the environment variable MONO_CHECK_MODE at runtime. Recognized checked build modules: all, gc, metadata, thread, private_types, crash_reporting],[
|
||||
|
||||
if test x$enable_checked_build != x ; then
|
||||
AC_DEFINE(ENABLE_CHECKED_BUILD,1,[Enable checked build])
|
||||
@@ -5075,6 +5099,7 @@ AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable check
|
||||
eval "mono_checked_build_test_enable_metadata='yes'"
|
||||
eval "mono_checked_build_test_enable_thread='yes'"
|
||||
eval "mono_checked_build_test_enable_private_types='yes'"
|
||||
eval "mono_checked_build_test_enable_crash_reporting='yes'"
|
||||
fi
|
||||
|
||||
if test "x$mono_checked_build_test_enable_gc" = "xyes"; then
|
||||
@@ -5092,10 +5117,20 @@ AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable check
|
||||
if test "x$mono_checked_build_test_enable_private_types" = "xyes"; then
|
||||
AC_DEFINE(ENABLE_CHECKED_BUILD_PRIVATE_TYPES, 1, [Enable private types checked build])
|
||||
fi
|
||||
|
||||
if test "x$mono_checked_build_test_enable_crash_reporting" = "xyes"; then
|
||||
# Required
|
||||
with_overridable_allocators=yes
|
||||
AC_DEFINE(ENABLE_OVERRIDABLE_ALLOCATORS,1,[Overridable allocator support enabled])
|
||||
|
||||
AC_DEFINE(ENABLE_CHECKED_BUILD_CRASH_REPORTING, 1, [Enable private types checked build])
|
||||
fi
|
||||
], [])
|
||||
|
||||
dnl End of checked builds
|
||||
|
||||
AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators = xyes)
|
||||
|
||||
AC_CHECK_HEADER([malloc.h],
|
||||
[AC_DEFINE([HAVE_USR_INCLUDE_MALLOC_H], [1],
|
||||
[Define to 1 if you have /usr/include/malloc.h.])],,)
|
||||
@@ -5128,6 +5163,26 @@ dnl **************
|
||||
AC_ARG_ENABLE(btls, [ --disable-btls Disable the BoringTls provider], enable_btls=$enableval, enable_btls=$BTLS_SUPPORTED)
|
||||
AC_ARG_ENABLE(btls-lib, [ --disable-btls-lib Disable building the BTLS native library], enable_btls_lib=$enableval, enable_btls_lib=$BTLS_SUPPORTED)
|
||||
AC_ARG_WITH(btls_android_ndk, [ --with-btls-android-ndk Android NDK for BoringTls])
|
||||
AC_ARG_WITH(btls_android_api, [ --with-btls-android-api Android NDK API level for BTLS build])
|
||||
AC_ARG_WITH(btls_android_cmake_toolchain, [ --with-btls-android-cmake-toolchain Path to the cmake toolchain file for Android])
|
||||
AC_ARG_WITH(btls_android_ndk_asm_workaround, [ --with-btls-android-ndk-asm-workaround Work around a problem with NDK r18+ clang compiler when compiling some AES assembly for ARM])
|
||||
|
||||
if test "x$with_btls_android_api" = "x" ; then
|
||||
case "$BTLS_PLATFORM" in
|
||||
android-armv5)
|
||||
with_btls_android_api=16" ;;
|
||||
android-armv6)
|
||||
with_btls_android_api=16" ;;
|
||||
android-armv7)
|
||||
with_btls_android_api=16 ;;
|
||||
android-v8a)
|
||||
with_btls_android_api=21 ;;
|
||||
android-x86)
|
||||
with_btls_android_api=16 ;;
|
||||
android-x64)
|
||||
with_btls_android_api=21 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$enable_btls" = "xno"; then
|
||||
enable_btls_lib=no
|
||||
@@ -5185,30 +5240,38 @@ if test "x$enable_btls" = "xyes"; then
|
||||
esac
|
||||
;;
|
||||
android-armv5)
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=14"
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
|
||||
;;
|
||||
android-armv6)
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=14"
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
|
||||
;;
|
||||
android-armv7)
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi-v7a\" -DANDROID_NATIVE_API_LEVEL=14"
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi-v7a\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
|
||||
;;
|
||||
android-v8a)
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"arm64-v8a\" -DANDROID_NATIVE_API_LEVEL=21"
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"arm64-v8a\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
|
||||
;;
|
||||
android-x86)
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86\" -DANDROID_NATIVE_API_LEVEL=14"
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
|
||||
;;
|
||||
android-x64)
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86_64\" -DANDROID_NATIVE_API_LEVEL=21"
|
||||
BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86_64\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR(Invalid BTLS platform)
|
||||
esac
|
||||
|
||||
if test "x$platform_android" = "xyes"; then
|
||||
if test "x$with_btls_android_cmake_toolchain" = "x"; then
|
||||
with_btls_android_cmake_toolchain="$BTLS_ROOT/util/android-cmake/android.toolchain.cmake"
|
||||
fi
|
||||
|
||||
if test "x$with_btls_android_ndk_asm_workaround" != "x"; then
|
||||
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DENABLE_NDK_ARM_WORKAROUND=ON"
|
||||
fi
|
||||
|
||||
btls_android=yes
|
||||
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=$BTLS_ROOT/util/android-cmake/android.toolchain.cmake"
|
||||
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=$with_btls_android_cmake_toolchain"
|
||||
if test "x$with_btls_android_ndk" != "x"; then
|
||||
BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DANDROID_NDK=\"$with_btls_android_ndk\""
|
||||
else
|
||||
@@ -5525,6 +5588,7 @@ mono/arch/arm64/Makefile
|
||||
mono/arch/mips/Makefile
|
||||
mono/sgen/Makefile
|
||||
mono/tests/Makefile
|
||||
mono/tests/assembly-load-reference/Makefile
|
||||
mono/tests/tests-config
|
||||
mono/tests/gc-descriptors/Makefile
|
||||
mono/tests/testing_gac/Makefile
|
||||
@@ -5763,6 +5827,7 @@ echo "
|
||||
zlib: $zlib_msg
|
||||
BTLS: $enable_btls$btls_platform_string
|
||||
jemalloc: $with_jemalloc (always use: $with_jemalloc_always)
|
||||
crash reporting: $crash_reporting (private crashes: $with_crash_privacy)
|
||||
$disabled
|
||||
"
|
||||
if test x$with_static_mono = xno -a "x$host_win32" != "xyes"; then
|
||||
|
||||
Vendored
+1
-1
Submodule external/api-snapshot updated: de90d4420a...9fb4259c92.
Vendored
+1
-1
Submodule external/binary-reference-assemblies updated: bdc6cdaabf...932582630c.
Vendored
+1
-1
Submodule external/bockbuild updated: 38f7f9f330...925ed0994a.
Vendored
+1
-1
Submodule external/boringssl updated: 41221b45aa...3d87996698.
Vendored
+1
-1
Submodule external/corefx updated: 13c8eafdba...8d1b6abd3e.
Vendored
+1
-1
Submodule external/corert updated: 6c9c4d9cff...e229c9448c.
Vendored
+1
-1
Submodule external/linker updated: d18d497504...7af03ce003.
Vendored
+1
-1
Submodule external/nunit-lite updated: 70bb70b0ff...00e259a4bd.
Vendored
+1
-1
Submodule external/roslyn-binaries updated: 09a97af42a...249709faa5.
Vendored
+1
-1
Submodule external/xunit-binaries updated: 3c3659bc0f...bb583470c7.
+15
-2
@@ -2,6 +2,19 @@
|
||||
EXTRA_DIST=SUBMODULES.json build.mk build_llvm_config.sh
|
||||
|
||||
if ENABLE_LLVM
|
||||
|
||||
if HOST_WIN32
|
||||
llvm_config=llvm-config.exe
|
||||
else
|
||||
llvm_config=llvm-config
|
||||
endif
|
||||
|
||||
if HAVE_ZLIB
|
||||
llvm_extra_libs=-lz
|
||||
else
|
||||
llvm_extra_libs=
|
||||
endif
|
||||
|
||||
if INTERNAL_LLVM
|
||||
|
||||
all-local: configure-llvm build-llvm install-llvm llvm_config.mk
|
||||
@@ -9,7 +22,7 @@ all-local: configure-llvm build-llvm install-llvm llvm_config.mk
|
||||
clean-local: clean-llvm clean-llvm-config
|
||||
|
||||
$(mono_build_root)/llvm/llvm_config.mk: install-llvm
|
||||
$(top_srcdir)/llvm/build_llvm_config.sh $(top_srcdir)/llvm/usr/bin/llvm-config $(LLVM_CODEGEN_LIBS) > $@
|
||||
$(top_srcdir)/llvm/build_llvm_config.sh "$(top_srcdir)/llvm/usr/bin/$(llvm_config)" "$(LLVM_CODEGEN_LIBS)" "$(llvm_extra_libs)" > $@
|
||||
|
||||
else
|
||||
all-local: llvm_config.mk
|
||||
@@ -17,7 +30,7 @@ all-local: llvm_config.mk
|
||||
clean-local: clean-llvm-config
|
||||
|
||||
$(mono_build_root)/llvm/llvm_config.mk: $(top_srcdir)/llvm/Makefile.am
|
||||
$(top_srcdir)/llvm/build_llvm_config.sh $(EXTERNAL_LLVM_CONFIG) $(LLVM_CODEGEN_LIBS) > $@
|
||||
$(top_srcdir)/llvm/build_llvm_config.sh "$(EXTERNAL_LLVM_CONFIG)" "$(LLVM_CODEGEN_LIBS)" "$(llvm_extra_libs)" > $@
|
||||
endif
|
||||
|
||||
llvm_config.mk: $(mono_build_root)/llvm/llvm_config.mk
|
||||
|
||||
@@ -2,17 +2,9 @@
|
||||
{
|
||||
"name": "llvm",
|
||||
"url": "git://github.com/mono/llvm.git",
|
||||
"rev": "fc854b8ec5873d294b80afa3e6cf6a88c5c48886",
|
||||
"rev": "c97510286a58f9aaa116fcfdb8b693d5f61910d2",
|
||||
"remote-branch": "origin/release_60",
|
||||
"branch": "release_60",
|
||||
"directory": "llvm"
|
||||
},
|
||||
{
|
||||
"name": "llvm36",
|
||||
"url": "git://github.com/mono/llvm.git",
|
||||
"rev": "0b3cb8ac12cd839f8110775d4085e822e8af4d7b",
|
||||
"remote-branch": "origin/master",
|
||||
"branch": "master",
|
||||
"directory": "llvm36"
|
||||
}
|
||||
]
|
||||
+11
-9
@@ -10,7 +10,9 @@ top_srcdir ?= $(abspath $(CURDIR)/..)
|
||||
LLVM_PATH ?= $(abspath $(top_srcdir)/external/llvm)
|
||||
LLVM_BUILD ?= $(abspath $(top_srcdir)/llvm/build)
|
||||
LLVM_PREFIX ?= $(abspath $(top_srcdir)/llvm/usr)
|
||||
LLVM_VERSION ?= llvm
|
||||
|
||||
# FIXME: URL should be http://xamjenkinsartifact.blob.core.windows.net/build-package-osx-llvm-$(NEEDED_LLVM_BRANCH)/llvm-osx64-$(NEEDED_LLVM_VERSION).tar.gz
|
||||
LLVM_DOWNLOAD_LOCATION = "http://xamjenkinsartifact.blob.core.windows.net/build-package-osx-llvm-release60/llvm-osx64-$(NEEDED_LLVM_VERSION).tar.gz"
|
||||
|
||||
CMAKE := $(or $(CMAKE),$(shell which cmake))
|
||||
NINJA := $(shell which ninja)
|
||||
@@ -19,7 +21,6 @@ SUBMODULES_CONFIG_FILE = $(top_srcdir)/llvm/SUBMODULES.json
|
||||
include $(top_srcdir)/scripts/submodules/versions.mk
|
||||
|
||||
$(eval $(call ValidateVersionTemplate,llvm,LLVM))
|
||||
$(eval $(call ValidateVersionTemplate,llvm36,LLVM36))
|
||||
|
||||
# Bump the given submodule to the revision given by the REV make variable
|
||||
# If COMMIT is 1, commit the change
|
||||
@@ -36,8 +37,12 @@ bump-current-llvm: __bump-current-version-llvm
|
||||
$(LLVM_BUILD) $(LLVM_PREFIX):
|
||||
mkdir -p $@
|
||||
|
||||
$(LLVM_PATH)/CMakeLists.txt: | reset-$(LLVM_VERSION)
|
||||
$(LLVM_PATH):
|
||||
$(MAKE) -f build.mk reset-llvm
|
||||
|
||||
$(LLVM_PATH)/CMakeLists.txt: | $(LLVM_PATH)
|
||||
|
||||
# -DLLVM_ENABLE_LIBXML2=Off is needed because xml2 is not used and it breaks 32-bit builds on 64-bit Linux hosts
|
||||
$(LLVM_BUILD)/$(if $(NINJA),build.ninja,Makefile): $(LLVM_PATH)/CMakeLists.txt | $(LLVM_BUILD)
|
||||
cd $(LLVM_BUILD) && $(CMAKE) \
|
||||
$(if $(NINJA),-G Ninja) \
|
||||
@@ -50,6 +55,8 @@ $(LLVM_BUILD)/$(if $(NINJA),build.ninja,Makefile): $(LLVM_PATH)/CMakeLists.txt |
|
||||
-DLLVM_TOOLS_TO_BUILD="opt;llc;llvm-config;llvm-dis" \
|
||||
-DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \
|
||||
-DLLVM_ENABLE_ASSERTIONS=$(if $(INTERNAL_LLVM_ASSERTS),On,Off) \
|
||||
-DLLVM_ENABLE_LIBXML2=Off \
|
||||
-DHAVE_FUTIMENS=0 \
|
||||
$(LLVM_CMAKE_ARGS) \
|
||||
$(dir $<)
|
||||
|
||||
@@ -67,14 +74,9 @@ build-llvm: configure-llvm
|
||||
install-llvm: build-llvm | $(LLVM_PREFIX)
|
||||
DESTDIR="" $(if $(NINJA),$(NINJA),$(MAKE)) -C $(LLVM_BUILD) install
|
||||
|
||||
# FIXME: URL should be http://xamjenkinsartifact.blob.core.windows.net/build-package-osx-llvm-$(NEEDED_LLVM_BRANCH)/llvm-osx64-$(NEEDED_LLVM_VERSION).tar.gz
|
||||
.PHONY: download-llvm
|
||||
download-llvm:
|
||||
wget --no-verbose -O - http://xamjenkinsartifact.blob.core.windows.net/build-package-osx-llvm-release60/llvm-osx64-$(NEEDED_LLVM_VERSION).tar.gz | tar xzf -
|
||||
|
||||
.PHONY: download-llvm36
|
||||
download-llvm36:
|
||||
wget --no-verbose -O - http://xamjenkinsartifact.blob.core.windows.net/build-package-osx-llvm/llvm-osx64-$(NEEDED_LLVM36_VERSION).tar.gz | tar xzf -
|
||||
(wget --no-verbose -O - $(LLVM_DOWNLOAD_LOCATION) || curl -L $(LLVM_DOWNLOAD_LOCATION)) | tar -xzf - -C $(dir $(LLVM_PREFIX))
|
||||
|
||||
.PHONY: clean-llvm
|
||||
clean-llvm:
|
||||
|
||||
+155
-30
@@ -1,47 +1,172 @@
|
||||
#!/bin/bash
|
||||
|
||||
llvm_config=$1
|
||||
extra_libs="${@:2}"
|
||||
llvm_codegen_libs="$2"
|
||||
llvm_extra_libs="${@:3}"
|
||||
|
||||
llvm_api_version=`$llvm_config --mono-api-version` || "0"
|
||||
with_llvm=`$llvm_config --prefix`
|
||||
use_llvm_config=1
|
||||
llvm_host_win32=0
|
||||
llvm_host_win32_wsl=0
|
||||
llvm_host_win32_cygwin=0
|
||||
|
||||
llvm_config_cflags=`$llvm_config --cflags`
|
||||
function win32_format_path {
|
||||
local formatted_path=$1
|
||||
if [[ $llvm_host_win32_wsl = 1 ]] && [[ $1 != "/mnt/"* ]]; then
|
||||
# if path is not starting with /mnt under WSL it could be a windows path, convert using wslpath.
|
||||
formatted_path="$(wslpath -a "$1")"
|
||||
elif [[ $llvm_host_win32_cygwin = 1 ]] && [[ $1 != "/cygdrive/"* ]]; then
|
||||
# if path is not starting with /cygdrive under CygWin it could be a windows path, convert using cygpath.
|
||||
formatted_path="$(cygpath -a "$1")"
|
||||
fi
|
||||
echo "$formatted_path"
|
||||
}
|
||||
|
||||
if [[ $llvm_config = *".exe" ]]; then
|
||||
llvm_host_win32=1
|
||||
# llvm-config is a windows binary. Check if we are running CygWin or WSL since then we might still be able to run llvm-config.exe
|
||||
host_uname="$(uname -a)"
|
||||
case "$host_uname" in
|
||||
*Microsoft*)
|
||||
use_llvm_config=1
|
||||
llvm_host_win32_wsl=1
|
||||
;;
|
||||
CYGWIN*)
|
||||
use_llvm_config=1
|
||||
llvm_host_win32_cygwin=1
|
||||
;;
|
||||
*)
|
||||
use_llvm_config=0
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ $llvm_host_win32 = 1 ]]; then
|
||||
llvm_config=$(win32_format_path "$llvm_config")
|
||||
fi
|
||||
|
||||
if [[ $use_llvm_config = 1 ]]; then
|
||||
llvm_api_version=`$llvm_config --mono-api-version` || "0"
|
||||
with_llvm=`$llvm_config --prefix`
|
||||
llvm_config_cflags=`$llvm_config --cflags`
|
||||
llvm_system=`$llvm_config --system-libs`
|
||||
llvm_core_components=`$llvm_config --libs analysis core bitwriter`
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_old_jit=`$llvm_config --libs mcjit jit 2>>/dev/null`
|
||||
else
|
||||
llvm_old_jit=`$llvm_config --libs mcjit 2>>/dev/null`
|
||||
fi
|
||||
llvm_new_jit=`$llvm_config --libs orcjit 2>>/dev/null`
|
||||
|
||||
if [[ ! -z $llvm_codegen_libs ]]; then
|
||||
llvm_extra=`$llvm_config --libs $llvm_codegen_libs`
|
||||
fi
|
||||
|
||||
# When building for Windows subsystem using WSL or CygWin the path returned from llvm-config.exe
|
||||
# could be a Windows style path, make sure to format it into a path usable for WSL/CygWin.
|
||||
if [[ $llvm_host_win32 = 1 ]]; then
|
||||
with_llvm=$(win32_format_path "$with_llvm")
|
||||
fi
|
||||
fi
|
||||
|
||||
# When cross compiling for Windows on system not capable of running Windows binaries, llvm-config.exe can't be used to query for
|
||||
# LLVM parameters. In that scenario we will need to fallback to default values.
|
||||
if [[ $llvm_host_win32 = 1 ]] && [[ $use_llvm_config = 0 ]]; then
|
||||
# Assume we have llvm-config sitting in llvm-install-root/bin directory, get llvm-install-root directory.
|
||||
with_llvm="$(dirname $llvm_config)"
|
||||
with_llvm="$(dirname $with_llvm)"
|
||||
llvm_config_path=$with_llvm/include/llvm/Config/llvm-config.h
|
||||
|
||||
# llvm-config.exe --mono-api-version
|
||||
llvm_api_version=`awk '/MONO_API_VERSION/ { print $3 }' $llvm_config_path`
|
||||
|
||||
# llvm-config.exe --cflags, returned information currently not used.
|
||||
llvm_config_cflags=
|
||||
|
||||
# llvm-config.exe --system-libs
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_system="-limagehlp -lpsapi -lshell32"
|
||||
else
|
||||
llvm_system="-lpsapi -lshell32 -lole32 -luuid -ladvapi32"
|
||||
fi
|
||||
|
||||
# llvm-config.exe --libs analysis core bitwriter
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_core_components="-lLLVMBitWriter -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport"
|
||||
else
|
||||
llvm_core_components="-lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle"
|
||||
fi
|
||||
|
||||
# llvm-config.exe --libs mcjit jit
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_old_jit="-lLLVMJIT -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMMCJIT -lLLVMTarget -lLLVMRuntimeDyld -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMExecutionEngine -lLLVMMC -lLLVMCore -lLLVMSupport"
|
||||
else
|
||||
# Current build of LLVM 60 for cross Windows builds doesn't support LLVM JIT.
|
||||
llvm_old_jit=
|
||||
fi
|
||||
|
||||
# LLVM 36 doesn't support new JIT and LLVM 60 is build without LLVM JIT support for cross Windows builds.
|
||||
llvm_new_jit=
|
||||
|
||||
# Check codegen libs and add needed libraries.
|
||||
case "$llvm_codegen_libs" in
|
||||
*x86codegen*)
|
||||
# llvm-config.exe --libs x86codegen
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_extra="-lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMObject -lLLVMBitReader -lLLVMMCDisassembler -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport"
|
||||
else
|
||||
llvm_extra="-lLLVMX86CodeGen -lLLVMGlobalISel -lLLVMX86Desc -lLLVMX86Info -lLLVMMCDisassembler -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle"
|
||||
fi
|
||||
;;
|
||||
*armcodegen*)
|
||||
# llvm-config.exe --libs armcodegen
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_extra="-lLLVMARMCodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMCore -lLLVMARMDesc -lLLVMMCDisassembler -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMMC -lLLVMSupport"
|
||||
else
|
||||
llvm_extra="-lLLVMARMCodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMARMDesc -lLLVMMCDisassembler -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMARMUtils -lLLVMMC -lLLVMSupport -lLLVMDemangle"
|
||||
fi
|
||||
;;
|
||||
*aarch64codegen*)
|
||||
# llvm-config.exe --libs aarch64codegen
|
||||
if [[ $llvm_api_version -lt 600 ]]; then
|
||||
llvm_extra="-lLLVMAArch64CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMCore -lLLVMAArch64Desc -lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMMC -lLLVMAArch64Utils -lLLVMSupport"
|
||||
else
|
||||
llvm_extra="-lLLVMAArch64CodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMAArch64Desc -lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMMC -lLLVMAArch64Utils -lLLVMSupport -lLLVMDemangle"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
llvm_extra=$llvm_codegen_libs
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ $llvm_config_cflags = *"stdlib=libc++"* ]]; then
|
||||
llvm_libc_c="-stdlib=libc++"
|
||||
llvm_libc_link="-lc++"
|
||||
llvm_libc_c="-stdlib=libc++"
|
||||
llvm_libc_link="-lc++"
|
||||
else
|
||||
llvm_libc_c=""
|
||||
llvm_libc_link="-lstdc++"
|
||||
llvm_libc_c=""
|
||||
llvm_libc_link="-lstdc++"
|
||||
fi
|
||||
|
||||
if [[ $llvm_host_win32 = 1 ]]; then
|
||||
host_cxxflag_additions="-std=gnu++11"
|
||||
host_cflag_additions="-DNDEBUG"
|
||||
else
|
||||
host_cxxflag_additions="-std=c++11"
|
||||
host_cflag_additions=""
|
||||
fi
|
||||
|
||||
if [[ ! -z $llvm_extra_libs ]]; then
|
||||
llvm_extra="$llvm_extra $llvm_extra_libs"
|
||||
fi
|
||||
|
||||
# llvm-config --clfags adds warning and optimization flags we don't want
|
||||
shared_llvm_cflags="-I$with_llvm/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DLLVM_API_VERSION=$llvm_api_version $llvm_libc_c"
|
||||
cxxflag_additions="-std=c++11 -fno-rtti -fexceptions"
|
||||
cflags_additions="-I$with_llvm/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DLLVM_API_VERSION=$llvm_api_version $llvm_libc_c $host_cflag_additions"
|
||||
|
||||
cxxflag_additions="-fno-rtti -fexceptions $host_cxxflag_additions"
|
||||
|
||||
ldflags="-L$with_llvm/lib"
|
||||
|
||||
llvm_system=`$llvm_config --system-libs`
|
||||
|
||||
|
||||
|
||||
llvm_core_components=`$llvm_config --libs analysis core bitwriter`
|
||||
llvm_old_jit=`$llvm_config --libs mcjit jit 2>>/dev/null`
|
||||
llvm_new_jit=`$llvm_config --libs orcjit 2>>/dev/null`
|
||||
llvm_extra=`$llvm_config --libs $extra_libs`
|
||||
llvm_lib_components="$llvm_core_components $llvm_old_jit $llvm_new_jit $llvm_extra"
|
||||
|
||||
echo "LLVM_CFLAGS_INTERNAL=$shared_llvm_cflags"
|
||||
echo "LLVM_CXXFLAGS_INTERNAL=$shared_llvm_cflags $cxxflag_additions"
|
||||
|
||||
echo "LLVM_CFLAGS_INTERNAL=$cflags_additions"
|
||||
echo "LLVM_CXXFLAGS_INTERNAL=$cflags_additions $cxxflag_additions"
|
||||
echo "LLVM_LDFLAGS_INTERNAL=$ldflags"
|
||||
echo "LLVM_LIBS_INTERNAL=$llvm_lib_components $ldflags $llvm_system $llvm_libc_link"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+5
-2
@@ -2,7 +2,7 @@ thisdir = build
|
||||
SUBDIRS =
|
||||
include ../build/rules.make
|
||||
|
||||
BUILT_FILES = common/Consts.cs
|
||||
BUILT_FILES = common/Consts.cs $(topdir)/class/lib/$(PROFILE_DIRECTORY)/Consts.cs
|
||||
|
||||
all-local install-local test-local run-test-local csproj-local run-test-ondotnet-local uninstall-local doc-update-local: $(BUILT_FILES)
|
||||
@:
|
||||
@@ -10,7 +10,10 @@ all-local install-local test-local run-test-local csproj-local run-test-ondotnet
|
||||
clean-local:
|
||||
-rm -f $(BUILT_FILES) deps/*
|
||||
|
||||
common/Consts.cs: common/Consts.cs.in $(wildcard config.make)
|
||||
$(topdir)/class/lib/$(PROFILE_DIRECTORY):
|
||||
mkdir -p $@
|
||||
|
||||
common/Consts.cs $(topdir)/class/lib/$(PROFILE_DIRECTORY)/Consts.cs: common/Consts.cs.in $(wildcard config.make) | $(topdir)/class/lib/$(PROFILE_DIRECTORY)
|
||||
test -n '$(MONO_VERSION)'
|
||||
test -n '$(MONO_CORLIB_VERSION)'
|
||||
sed -e 's,@''MONO_VERSION@,$(MONO_VERSION),' -e 's,@''MONO_CORLIB_VERSION@,$(MONO_CORLIB_VERSION),' $< > $@
|
||||
|
||||
@@ -41,7 +41,7 @@ class X
|
||||
|
||||
Version min_mono_version;
|
||||
#if __MonoCS__
|
||||
min_mono_version = new Version (5, 16);
|
||||
min_mono_version = new Version (5, 18);
|
||||
#else
|
||||
min_mono_version = new Version (5, 10);
|
||||
#endif
|
||||
|
||||
@@ -32,10 +32,10 @@ mono_libdir = $(exec_prefix)/lib
|
||||
sysconfdir = $(prefix)/etc
|
||||
#RUNTIME = mono
|
||||
RUNTIME = false
|
||||
MONO_PATH_TOP = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/
|
||||
MONO_PATH_TOP = $(topdir)/class/lib/$(PROFILE_DIRECTORY)
|
||||
MONO_PATH_TESTS = $(MONO_PATH_TOP)/tests
|
||||
TEST_MONO_PATH = $(MONO_PATH_TOP)$(PLATFORM_PATH_SEPARATOR)$(MONO_PATH_TESTS)
|
||||
TEST_RUNTIME = MONO_PATH="$(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR).$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) --debug
|
||||
TEST_MONO_PATH = $(MONO_PATH_TOP)$(PLATFORM_PATH_SEPARATOR)$(MONO_PATH_TESTS)$(PLATFORM_PATH_SEPARATOR).
|
||||
TEST_RUNTIME = MONO_PATH="$(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) --debug
|
||||
|
||||
# In case you want to add MCS_FLAGS, this lets you not have to
|
||||
# keep track of the default value
|
||||
|
||||
+24
-17
@@ -19,13 +19,22 @@ TEST_RUNTIME_WRAPPERS_PATH = $(shell dirname $(RUNTIME))/_tmpinst/bin
|
||||
## Unit test support
|
||||
ifndef NO_TEST
|
||||
|
||||
test_lib_dir = $(topdir)/class/lib/$(PROFILE)/tests
|
||||
|
||||
test_nunit_lib = nunitlite.dll
|
||||
xunit_core := xunit.core xunit.execution.dotnet xunit.abstractions xunit.assert Xunit.NetCore.Extensions
|
||||
xunit_deps := netstandard System.Runtime
|
||||
xunit_deps := System.Runtime
|
||||
xunit_src := $(patsubst %,$(topdir)/../external/xunit-binaries/%,BenchmarkAttribute.cs BenchmarkDiscover.cs) $(topdir)/../mcs/class/test-helpers/PlatformDetection.cs
|
||||
|
||||
ifeq ($(USE_XTEST_REMOTE_EXECUTOR), YES)
|
||||
XTEST_REMOTE_EXECUTOR = $(topdir)/class/lib/$(PROFILE)/RemoteExecutorConsoleApp.exe
|
||||
XTEST_REMOTE_EXECUTOR = $(test_lib_dir)/RemoteExecutorConsoleApp.exe
|
||||
|
||||
ifeq ($(BUILD_PLATFORM), win32)
|
||||
XTEST_REMOTE_EXECUTOR_ABSPATH = $(shell cygpath -w $(abspath $(XTEST_REMOTE_EXECUTOR)))
|
||||
else
|
||||
XTEST_REMOTE_EXECUTOR_ABSPATH = $(abspath $(XTEST_REMOTE_EXECUTOR))
|
||||
endif
|
||||
|
||||
xunit_src += $(topdir)/../mcs/class/test-helpers/AdminHelper.cs \
|
||||
$(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/IO/FileCleanupTestBase.cs \
|
||||
$(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs \
|
||||
@@ -62,6 +71,7 @@ test_sourcefile = $(ASSEMBLY:$(ASSEMBLY_EXT)=_test.dll.sources)
|
||||
endif
|
||||
|
||||
test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_test.dll)
|
||||
test_lib_output = $(test_lib_dir)/$(test_lib)
|
||||
|
||||
test_sourcefile_excludes = $(test_lib).exclude.sources
|
||||
|
||||
@@ -73,12 +83,13 @@ ifndef NO_BUILD
|
||||
test_flags += -r:$(the_assembly)
|
||||
test_assembly_dep = $(the_assembly)
|
||||
endif
|
||||
tests_CLEAN_FILES += $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.dll) $(ASSEMBLY:$(ASSEMBLY_EXT)=_test*.pdb) $(test_response) $(test_makefrag)
|
||||
tests_CLEAN_FILES += $(test_lib_output) $(test_lib_output:$(ASSEMBLY_EXT)=.pdb) $(test_response) $(test_makefrag)
|
||||
|
||||
xtest_sourcefile = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
|
||||
xtest_sourcefile_excludes = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.exclude.sources)
|
||||
|
||||
xunit_test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xunit-test.dll)
|
||||
xtest_lib_output = $(test_lib_dir)/$(xunit_test_lib)
|
||||
|
||||
xtest_response = $(depsdir)/$(xunit_test_lib).response
|
||||
xtest_makefrag = $(depsdir)/$(xunit_test_lib).makefrag
|
||||
@@ -86,7 +97,7 @@ xtest_flags = -r:$(the_assembly) $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LI
|
||||
|
||||
ifeq ($(wildcard $(xtest_sourcefile)),)
|
||||
xtest_sourcefile = $(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
|
||||
tests_CLEAN_FILES += $(xunit_test_lib) $(xtest_response) $(xtest_makefrag)
|
||||
tests_CLEAN_FILES += $(xtest_lib_output) $(xtest_response) $(xtest_makefrag)
|
||||
endif
|
||||
|
||||
ifndef HAVE_CS_TESTS
|
||||
@@ -113,10 +124,6 @@ endif
|
||||
|
||||
test_assemblies :=
|
||||
|
||||
test_lib_dir = $(topdir)/class/lib/$(PROFILE)/tests
|
||||
|
||||
test_lib_output = $(topdir)/class/lib/$(PROFILE)/tests/$(test_lib)
|
||||
|
||||
ifdef HAVE_CS_TESTS
|
||||
test_assemblies += $(test_lib_output)
|
||||
|
||||
@@ -242,7 +249,7 @@ ifdef HAVE_CS_TESTS
|
||||
$(test_lib_dir):
|
||||
mkdir -p $@
|
||||
|
||||
$(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) $(test_lib_dir)
|
||||
$(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) | $(test_lib_dir)
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response)
|
||||
|
||||
test_response_preprocessed = $(test_response)_preprocessed
|
||||
@@ -305,23 +312,23 @@ XTEST_COVERAGE_FLAGS = -O=-aot --profile=coverage:output=$(topdir)/class/lib/$(P
|
||||
endif
|
||||
|
||||
check: run-xunit-test-local
|
||||
xunit-test-local: $(xunit_test_lib)
|
||||
xunit-test-local: $(xtest_lib_output)
|
||||
run-xunit-test-local: run-xunit-test-lib
|
||||
|
||||
# cp -rf is a HACK for xunit runner to require xunit.execution.dOTNET.dll file in local folder on .net only
|
||||
run-xunit-test-lib: xunit-test-local $(XTEST_REMOTE_EXECUTOR)
|
||||
@cp -rf $(XTEST_HARNESS_PATH)/xunit.execution.dotnet.dll xunit.execution.dotnet.dll
|
||||
run-xunit-test-lib: xunit-test-local
|
||||
@cp -rf $(XTEST_HARNESS_PATH)/xunit.execution.dotnet.dll $(test_lib_dir)/xunit.execution.dotnet.dll
|
||||
ok=:; \
|
||||
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" REMOTE_EXECUTOR=$(XTEST_REMOTE_EXECUTOR) $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(XTEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xunit_test_lib) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) $(XTEST_TRAIT_PLATFORM) || ok=false; \
|
||||
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" REMOTE_EXECUTOR="$(XTEST_REMOTE_EXECUTOR_ABSPATH)" $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(XTEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xtest_lib_output) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) $(XTEST_TRAIT_PLATFORM) || ok=false; \
|
||||
if [ -n "$$MONO_BABYSITTER_NUNIT_XML_LIST_FILE" ]; then echo "$(abspath $(XTEST_RESULT_FILE))" >> "$$MONO_BABYSITTER_NUNIT_XML_LIST_FILE"; fi; \
|
||||
$$ok
|
||||
@rm -f xunit.execution.dotnet.dll
|
||||
@rm -f $(test_lib_dir)/xunit.execution.dotnet.dll
|
||||
|
||||
# Some xunit tests want to be executed in a separate process (see RemoteExecutorTestBase)
|
||||
$(XTEST_REMOTE_EXECUTOR): $(topdir)/../external/corefx/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs
|
||||
$(XTEST_REMOTE_EXECUTOR): $(topdir)/../external/corefx/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs | $(test_lib_dir)
|
||||
$(TEST_COMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll $< -out:$@
|
||||
|
||||
$(xunit_test_lib): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src)
|
||||
$(xtest_lib_output): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src) $(XTEST_REMOTE_EXECUTOR) | $(test_lib_dir)
|
||||
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response) $(xunit_src)
|
||||
|
||||
xtest_response_preprocessed = $(xtest_response)_preprocessed
|
||||
@@ -333,7 +340,7 @@ $(xtest_response): $(xtest_sourcefile) $(wildcard $(xtest_sourcefile_excludes))
|
||||
|
||||
$(xtest_makefrag): $(xtest_response)
|
||||
@echo Creating $@ ...
|
||||
@sed 's,^,$(xunit_test_lib): ,' $< >$@
|
||||
@sed 's,^,$(xtest_lib_output): ,' $< >$@
|
||||
|
||||
-include $(xtest_makefrag)
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Copyright (c) 2018 Microsoft
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: AssemblyTitle ("System.Buffers")]
|
||||
[assembly: AssemblyDescription ("System.Buffers")]
|
||||
[assembly: AssemblyDefaultAlias ("System.Buffers")]
|
||||
[assembly: AssemblyCompany ("Mono development team")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("(c) Various Mono authors")]
|
||||
[assembly: AssemblyVersion ("4.0.99.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.99.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.99.0")]
|
||||
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">net_4_x</Platform>
|
||||
<ProjectGuid>{6C744E56-CCB3-4F4F-BAA8-5993D42DFF48}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<NoWarn>1699,1616,1699</NoWarn>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Windows_NT'">win32</HostPlatform>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix' and $([System.IO.File]::Exists('/usr/lib/libc.dylib'))">darwin</HostPlatform>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix'">linux</HostPlatform>
|
||||
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
||||
<NoStdLib>True</NoStdLib>
|
||||
<NoConfig>True</NoConfig>
|
||||
<AssemblyName>System.Buffers</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.1</TargetFrameworkVersion>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<DelaySign>true</DelaySign>
|
||||
<AssemblyOriginatorKeyFile>../../Open.snk</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0,
|
||||
Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This
|
||||
is a problem to compile the Mono mscorlib.dll -->
|
||||
<PropertyGroup>
|
||||
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monodroid' ">
|
||||
<OutputPath>./../../../class/lib/monodroid/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monotouch' ">
|
||||
<OutputPath>./../../../class/lib/monotouch/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_watch' ">
|
||||
<OutputPath>./../../../class/lib/monotouch_watch/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_tv' ">
|
||||
<OutputPath>./../../../class/lib/monotouch_tv/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;MONOTOUCH_TV</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'testing_aot_full' ">
|
||||
<OutputPath>./../../../class/lib/testing_aot_full/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_REMOTING;DISABLE_COM</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'winaot' ">
|
||||
<OutputPath>./../../../class/lib/winaot/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_REMOTING;DISABLE_COM;WIN_PLATFORM</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
|
||||
<OutputPath>./../../../class/lib/xammac/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;XAMMAC;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;XAMARIN_MODERN</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'orbis' ">
|
||||
<OutputPath>./../../../class/lib/orbis/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;ORBIS;DISABLE_REMOTING;DISABLE_COM</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'unreal' ">
|
||||
<OutputPath>./../../../class/lib/unreal/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;MOBILE;MOBILE_DYNAMIC;NET_3_5;NET_4_0;NET_4_5;MONO</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'wasm' ">
|
||||
<OutputPath>./../../../class/lib/wasm/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;WASM;DISABLE_REMOTING;DISABLE_COM;FEATURE_NO_BSD_SOCKETS</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<!-- @ALL_PROFILE_PROPERTIES@ -->
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<!-- TRACE is set only for Debug configuration, so inherit from platform-specific value -->
|
||||
<DefineConstants>TRACE;$(DefineConstants)</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- @BUILT_SOURCES@ -->
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="TypeForwarders.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup></ItemGroup>
|
||||
<!-- @ALL_SOURCES@ -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../corlib/corlib.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Platform)' == 'testing_aot_full' ">
|
||||
<Reference Include="nunitlite">
|
||||
<HintPath>..\lib\testing_aot_full\nunitlite.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<!-- @ALL_REFERENCES@ -->
|
||||
<!-- @ALL_RESOURCES@ -->
|
||||
</Project>
|
||||
@@ -0,0 +1,24 @@
|
||||
MCS_BUILD_DIR = ../../../build
|
||||
|
||||
thisdir = class/Facades/System.Buffers
|
||||
SUBDIRS =
|
||||
include $(MCS_BUILD_DIR)/rules.make
|
||||
|
||||
LIBRARY_SUBDIR = Facades
|
||||
LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
|
||||
|
||||
LIBRARY = System.Buffers.dll
|
||||
|
||||
KEYFILE = ../../Open.snk
|
||||
LIBRARY_SNK = $(KEYFILE)
|
||||
SIGN_FLAGS = /delaysign /nowarn:1616,1699
|
||||
LIB_REFS =
|
||||
LIB_MCS_FLAGS = $(SIGN_FLAGS)
|
||||
|
||||
PLATFORM_DEBUG_FLAGS =
|
||||
|
||||
NO_TEST = yes
|
||||
|
||||
include $(MCS_BUILD_DIR)/library.make
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
TypeForwarders.cs
|
||||
AssemblyInfo.cs
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Copyright (c) 2018 Microsoft
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
//
|
||||
|
||||
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Buffers.ArrayPool<>))]
|
||||
+14
-2
@@ -36,6 +36,11 @@
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monodroid' ">
|
||||
<OutputPath>./../../../class/lib/monodroid/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monotouch' ">
|
||||
<OutputPath>./../../../class/lib/monotouch/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
@@ -123,9 +128,16 @@
|
||||
<ProjectReference Include="../../System.Drawing/System.Drawing.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Platform)' == 'monodroid' ">
|
||||
<Reference Include="$(EXTERNAL_FACADE_DRAWING_REFERENCE)">
|
||||
<Reference Include="./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(EXTERNAL_FACADE_DRAWING_REFERENCE)</HintPath>
|
||||
<HintPath>./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Platform)' == 'monodroid' ">
|
||||
<Reference Include="./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -20,6 +20,11 @@ LIB_MCS_FLAGS = $(SIGN_FLAGS) $(EXTRA_LIB_MCS_FLAGS)
|
||||
# TODO: find a better solution.
|
||||
EMBEDDED_DRAWING_DEP := $(filter xammac_net_4_5 testing_aot_full testing_aot_hybrid, $(PROFILE))
|
||||
|
||||
ifeq ($(PROFILE),monodroid)
|
||||
# XA implements System.Drawing API inside Mono.Android
|
||||
API_BIN_REFS := Mono.Android
|
||||
else
|
||||
|
||||
ifndef EMBEDDED_DRAWING_DEP
|
||||
|
||||
# profiles which build a System.Drawing.dll in the repo
|
||||
@@ -29,12 +34,12 @@ ifdef REPO_DRAWING_DEP
|
||||
LIB_REFS += System.Drawing
|
||||
else
|
||||
# When System.Drawing.dll is not built in the Mono repo but in
|
||||
# the product repo like in the XI/XA case we need to pass in a reference
|
||||
# the product repo like in the XI case we need to pass in a reference
|
||||
# to the assembly containing drawing types like Rectangle etc. from there.
|
||||
# This needs to be passed in via EXTERNAL_FACADE_DRAWING_REFERENCE.
|
||||
LIB_MCS_FLAGS += /r:$(EXTERNAL_FACADE_DRAWING_REFERENCE)
|
||||
endif
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
PLATFORM_DEBUG_FLAGS =
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Runtime.CompilerServices;
|
||||
[assembly: AssemblyCompany ("Mono development team")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("(c) Various Mono authors")]
|
||||
[assembly: AssemblyVersion ("4.0.1.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyVersion ("4.0.99.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.99.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.99.0")]
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// Copyright (C) 2018 Microsoft Corporation
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: AssemblyTitle ("System.Threading.Tasks.Extensions")]
|
||||
[assembly: AssemblyDescription ("System.Threading.Tasks.Extensions")]
|
||||
[assembly: AssemblyDefaultAlias ("System.Threading.Tasks.Extensions")]
|
||||
[assembly: AssemblyCompany ("Mono development team")]
|
||||
[assembly: AssemblyProduct ("Mono Common Language Infrastructure")]
|
||||
[assembly: AssemblyCopyright ("(c) Various Mono authors")]
|
||||
[assembly: AssemblyVersion ("4.2.0.0")]
|
||||
[assembly: AssemblyInformationalVersion ("4.0.0.0")]
|
||||
[assembly: AssemblyFileVersion ("4.0.0.0")]
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- WARNING: this file is autogenerated, don't modify it. Edit the .sources file of the corresponding assembly instead if you want to add/remove C# source files. -->
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">net_4_x</Platform>
|
||||
<ProjectGuid>{9586C064-AF1F-4F6D-BD4F-6BE7C8AEAF44}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<NoWarn>1699,1616,1699</NoWarn>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Windows_NT'">win32</HostPlatform>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix' and $([System.IO.File]::Exists('/usr/lib/libc.dylib'))">darwin</HostPlatform>
|
||||
<HostPlatform Condition=" '$(HostPlatform)' == '' and '$(OS)' == 'Unix'">linux</HostPlatform>
|
||||
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
||||
<NoStdLib>True</NoStdLib>
|
||||
<NoConfig>True</NoConfig>
|
||||
<AssemblyName>System.Threading.Tasks.Extensions</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.1</TargetFrameworkVersion>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<DelaySign>true</DelaySign>
|
||||
<AssemblyOriginatorKeyFile>../../Open.snk</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0,
|
||||
Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This
|
||||
is a problem to compile the Mono mscorlib.dll -->
|
||||
<PropertyGroup>
|
||||
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monodroid' ">
|
||||
<OutputPath>./../../../class/lib/monodroid/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monotouch' ">
|
||||
<OutputPath>./../../../class/lib/monotouch/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_watch' ">
|
||||
<OutputPath>./../../../class/lib/monotouch_watch/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_tv' ">
|
||||
<OutputPath>./../../../class/lib/monotouch_tv/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;MONOTOUCH_TV</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'testing_aot_full' ">
|
||||
<OutputPath>./../../../class/lib/testing_aot_full/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_REMOTING;DISABLE_COM</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'winaot' ">
|
||||
<OutputPath>./../../../class/lib/winaot/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;DISABLE_REMOTING;DISABLE_COM;WIN_PLATFORM</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'xammac' ">
|
||||
<OutputPath>./../../../class/lib/xammac/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_DYNAMIC;XAMMAC;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;XAMARIN_MODERN</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'orbis' ">
|
||||
<OutputPath>./../../../class/lib/orbis/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;ORBIS;DISABLE_REMOTING;DISABLE_COM</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'unreal' ">
|
||||
<OutputPath>./../../../class/lib/unreal/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;MOBILE;MOBILE_DYNAMIC;NET_3_5;NET_4_0;NET_4_5;MONO</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'wasm' ">
|
||||
<OutputPath>./../../../class/lib/wasm/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;FULL_AOT_DESKTOP;FULL_AOT_RUNTIME;WASM;DISABLE_REMOTING;DISABLE_COM;FEATURE_NO_BSD_SOCKETS</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<!-- @ALL_PROFILE_PROPERTIES@ -->
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<!-- TRACE is set only for Debug configuration, so inherit from platform-specific value -->
|
||||
<DefineConstants>TRACE;$(DefineConstants)</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- @BUILT_SOURCES@ -->
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="TypeForwarders.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup></ItemGroup>
|
||||
<!-- @ALL_SOURCES@ -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../corlib/corlib.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Platform)' == 'testing_aot_full' ">
|
||||
<Reference Include="nunitlite">
|
||||
<HintPath>..\lib\testing_aot_full\nunitlite.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<!-- @ALL_REFERENCES@ -->
|
||||
<!-- @ALL_RESOURCES@ -->
|
||||
</Project>
|
||||
@@ -0,0 +1,24 @@
|
||||
MCS_BUILD_DIR = ../../../build
|
||||
|
||||
thisdir = class/Facades/System.Threading.Tasks.Extensions
|
||||
SUBDIRS =
|
||||
include $(MCS_BUILD_DIR)/rules.make
|
||||
|
||||
LIBRARY_SUBDIR = Facades
|
||||
LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)/Facades
|
||||
|
||||
LIBRARY = System.Threading.Tasks.Extensions.dll
|
||||
|
||||
KEYFILE = ../../Open.snk
|
||||
LIBRARY_SNK = $(KEYFILE)
|
||||
SIGN_FLAGS = /delaysign /nowarn:1616,1699
|
||||
LIB_REFS =
|
||||
LIB_MCS_FLAGS = $(SIGN_FLAGS)
|
||||
|
||||
PLATFORM_DEBUG_FLAGS =
|
||||
|
||||
NO_TEST = yes
|
||||
|
||||
include $(MCS_BUILD_DIR)/library.make
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
AssemblyInfo.cs
|
||||
TypeForwarders.cs
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// Copyright (C) 2018 Microsoft Corporation
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.AsyncMethodBuilderAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder<>))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<>))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ValueTaskAwaiter))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.CompilerServices.ValueTaskAwaiter<>))]
|
||||
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.ValueTask))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.ValueTask<>))]
|
||||
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.Sources.IValueTaskSource))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.Sources.IValueTaskSource<>))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Threading.Tasks.Sources.ValueTaskSourceStatus))]
|
||||
|
||||
@@ -36,6 +36,11 @@
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monodroid' ">
|
||||
<OutputPath>./../../../class/lib/monodroid/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID;NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MONO;MOBILE;MOBILE_LEGACY;MOBILE_DYNAMIC;MONODROID;ANDROID</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monotouch' ">
|
||||
<OutputPath>./../../../class/lib/monotouch/Facades</OutputPath>
|
||||
<IntermediateOutputPath>./../../../class/obj/$(AssemblyName)-Facades</IntermediateOutputPath>
|
||||
@@ -137,9 +142,17 @@
|
||||
<ProjectReference Include="../../System.Drawing/System.Drawing.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Platform)' == 'monodroid' ">
|
||||
<Reference Include="$(EXTERNAL_FACADE_DRAWING_REFERENCE)">
|
||||
<Reference Include="./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(EXTERNAL_FACADE_DRAWING_REFERENCE)</HintPath>
|
||||
<HintPath>./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<ProjectReference Include="../../System.Web.Services/System.Web.Services.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Platform)' == 'monodroid' ">
|
||||
<Reference Include="./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>./../../../../external/binary-reference-assemblies/build/monodroid/Mono.Android.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<ProjectReference Include="../../System.Web.Services/System.Web.Services.csproj" />
|
||||
|
||||
@@ -28,6 +28,11 @@ else
|
||||
LIB_REFS += System.Web
|
||||
endif
|
||||
|
||||
ifeq ($(PROFILE),monodroid)
|
||||
# XA implements System.Drawing API inside Mono.Android
|
||||
API_BIN_REFS := Mono.Android
|
||||
else
|
||||
|
||||
# profiles which build a System.Drawing.dll in the repo
|
||||
REPO_DRAWING_DEP := $(filter net_4_x orbis winaot unreal wasm, $(PROFILE))
|
||||
|
||||
@@ -51,7 +56,7 @@ else
|
||||
# This needs to be passed in via EXTERNAL_FACADE_DRAWING_REFERENCE.
|
||||
LIB_MCS_FLAGS += /r:$(EXTERNAL_FACADE_DRAWING_REFERENCE)
|
||||
endif
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
PLATFORM_DEBUG_FLAGS =
|
||||
|
||||
@@ -40,6 +40,9 @@ netstandard_drawing_SUBDIRS = System.Drawing.Primitives netstandard
|
||||
monotouch_SUBDIRS = $(common_DEPS_SUBDIRS) $(mobile_only_DEPS_SUBDIRS)
|
||||
monotouch_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
|
||||
|
||||
monodroid_SUBDIRS = $(monotouch_SUBDIRS) $(netstandard_drawing_SUBDIRS)
|
||||
monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
|
||||
|
||||
# We don't build netstandard/System.Drawing.Primitives on monotouch etc. profiles by default,
|
||||
# except when EXTERNAL_FACADE_DRAWING_REFERENCE is defined which allows us to build it in Mono CI
|
||||
# (since the dependent drawing types are normally built in the product repos).
|
||||
@@ -63,9 +66,6 @@ System.Text.Encoding.CodePages
|
||||
|
||||
build_PARALLEL_SUBDIRS = $(basic_PARALLEL_SUBDIRS) System.Text.RegularExpressions System.Diagnostics.Contracts
|
||||
|
||||
monodroid_SUBDIRS = $(monotouch_SUBDIRS)
|
||||
monodroid_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
|
||||
|
||||
xammac_SUBDIRS = $(monotouch_SUBDIRS)
|
||||
xammac_PARALLEL_SUBDIRS = $(monotouch_PARALLEL_SUBDIRS)
|
||||
|
||||
@@ -90,8 +90,8 @@ unreal_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
|
||||
wasm_SUBDIRS = $(common_DEPS_SUBDIRS) $(netstandard_drawing_SUBDIRS) $(mobile_only_DEPS_SUBDIRS)
|
||||
wasm_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
|
||||
|
||||
mobile_only_SUBDIRS = System.Security.Cryptography.Pkcs \
|
||||
System.Security.Cryptography.Cng System.Runtime.Loader System.Xml.XPath.XmlDocument System.Reflection.DispatchProxy System.Memory System.Drawing.Common
|
||||
mobile_only_SUBDIRS = System.Security.Cryptography.Pkcs System.Threading.Tasks.Extensions System.Memory System.Buffers \
|
||||
System.Security.Cryptography.Cng System.Runtime.Loader System.Xml.XPath.XmlDocument System.Reflection.DispatchProxy System.Drawing.Common
|
||||
|
||||
mobile_only_DEPS_SUBDIRS = System.Security.Cryptography.OpenSsl
|
||||
|
||||
|
||||
@@ -30,4 +30,4 @@ CLEAN_FILES += $(TEST_RESX_RESOURCES)
|
||||
$(TEST_RESX_RESOURCES): %.resources: %.resx
|
||||
$(RESGEN) $< || cp $@.prebuilt $@
|
||||
|
||||
$(test_lib_output): $(TEST_RESX_RESOURCES) $(test_lib_dir)
|
||||
$(test_lib_output): $(TEST_RESX_RESOURCES) | $(test_lib_dir)
|
||||
@@ -0,0 +1 @@
|
||||
../../../external/corefx/src/Microsoft.CSharp/tests/AccessTests.netcoreapp.cs
|
||||
@@ -0,0 +1 @@
|
||||
../../../external/corefx/src/Microsoft.CSharp/tests/AccessTests.netcoreapp.cs
|
||||
@@ -0,0 +1 @@
|
||||
Bug27864.cs
|
||||
@@ -535,42 +535,52 @@ namespace Mono.Debugger.Soft
|
||||
}
|
||||
|
||||
internal T GetObject<T> (long id, long domain_id, long type_id) where T : ObjectMirror {
|
||||
ObjectMirror obj = null;
|
||||
lock (objects_lock) {
|
||||
if (objects == null)
|
||||
objects = new Dictionary <long, ObjectMirror> ();
|
||||
ObjectMirror obj;
|
||||
if (!objects.TryGetValue (id, out obj)) {
|
||||
/*
|
||||
* Obtain the domain/type of the object to determine the type of
|
||||
* object we need to create.
|
||||
*/
|
||||
if (domain_id == 0 || type_id == 0) {
|
||||
if (conn.Version.AtLeast (2, 5)) {
|
||||
var info = conn.Object_GetInfo (id);
|
||||
domain_id = info.domain_id;
|
||||
type_id = info.type_id;
|
||||
} else {
|
||||
if (domain_id == 0)
|
||||
domain_id = conn.Object_GetDomain (id);
|
||||
if (type_id == 0)
|
||||
type_id = conn.Object_GetType (id);
|
||||
}
|
||||
}
|
||||
AppDomainMirror d = GetDomain (domain_id);
|
||||
TypeMirror t = GetType (type_id);
|
||||
|
||||
if (t.Assembly == d.Corlib && t.Namespace == "System.Threading" && t.Name == "Thread")
|
||||
obj = new ThreadMirror (this, id, t, d);
|
||||
else if (t.Assembly == d.Corlib && t.Namespace == "System" && t.Name == "String")
|
||||
obj = new StringMirror (this, id, t, d);
|
||||
else if (typeof (T) == typeof (ArrayMirror))
|
||||
obj = new ArrayMirror (this, id, t, d);
|
||||
else
|
||||
obj = new ObjectMirror (this, id, t, d);
|
||||
objects [id] = obj;
|
||||
}
|
||||
return (T)obj;
|
||||
objects.TryGetValue (id, out obj);
|
||||
}
|
||||
|
||||
if (obj == null) {
|
||||
/*
|
||||
* Obtain the domain/type of the object to determine the type of
|
||||
* object we need to create. Do this outside the lock.
|
||||
*/
|
||||
if (domain_id == 0 || type_id == 0) {
|
||||
if (conn.Version.AtLeast (2, 5)) {
|
||||
var info = conn.Object_GetInfo (id);
|
||||
domain_id = info.domain_id;
|
||||
type_id = info.type_id;
|
||||
} else {
|
||||
if (domain_id == 0)
|
||||
domain_id = conn.Object_GetDomain (id);
|
||||
if (type_id == 0)
|
||||
type_id = conn.Object_GetType (id);
|
||||
}
|
||||
}
|
||||
AppDomainMirror d = GetDomain (domain_id);
|
||||
TypeMirror t = GetType (type_id);
|
||||
|
||||
if (t.Assembly == d.Corlib && t.Namespace == "System.Threading" && t.Name == "Thread")
|
||||
obj = new ThreadMirror (this, id, t, d);
|
||||
else if (t.Assembly == d.Corlib && t.Namespace == "System" && t.Name == "String")
|
||||
obj = new StringMirror (this, id, t, d);
|
||||
else if (typeof (T) == typeof (ArrayMirror))
|
||||
obj = new ArrayMirror (this, id, t, d);
|
||||
else
|
||||
obj = new ObjectMirror (this, id, t, d);
|
||||
|
||||
// Publish
|
||||
lock (objects_lock) {
|
||||
ObjectMirror prev_obj;
|
||||
if (objects.TryGetValue (id, out prev_obj))
|
||||
obj = prev_obj;
|
||||
else
|
||||
objects [id] = obj;
|
||||
}
|
||||
}
|
||||
return (T)obj;
|
||||
}
|
||||
|
||||
internal T GetObject<T> (long id) where T : ObjectMirror {
|
||||
|
||||
@@ -85,6 +85,31 @@ public class Tests2 {
|
||||
}
|
||||
}
|
||||
|
||||
public struct TestEnumeratorInsideGenericStruct<TKey, TValue>
|
||||
{
|
||||
private KeyValuePair<TKey, TValue> _bucket;
|
||||
private Position _currentPosition;
|
||||
internal TestEnumeratorInsideGenericStruct(KeyValuePair<TKey, TValue> bucket)
|
||||
{
|
||||
_bucket = bucket;
|
||||
_currentPosition = Position.BeforeFirst;
|
||||
}
|
||||
|
||||
public KeyValuePair<TKey, TValue> Current
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_currentPosition == Position.BeforeFirst)
|
||||
return _bucket;
|
||||
return _bucket;
|
||||
}
|
||||
}
|
||||
private enum Position
|
||||
{
|
||||
BeforeFirst
|
||||
}
|
||||
}
|
||||
|
||||
public struct AStruct : ITest2 {
|
||||
public int i;
|
||||
public string s;
|
||||
@@ -384,6 +409,7 @@ public class Tests : TestsBase, ITest2
|
||||
new Tests ().invoke_abort ();
|
||||
new Tests ().evaluate_method ();
|
||||
Bug59649 ();
|
||||
inspect_enumerator_in_generic_struct();
|
||||
return 3;
|
||||
}
|
||||
|
||||
@@ -576,6 +602,11 @@ public class Tests : TestsBase, ITest2
|
||||
ss_nested_with_two_args(ss_nested_arg (), ss_nested_arg ());
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static void inspect_enumerator_in_generic_struct() {
|
||||
TestEnumeratorInsideGenericStruct<String, String> generic_struct = new TestEnumeratorInsideGenericStruct<String, String>(new KeyValuePair<string, string>("0", "f1"));
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.NoInlining)]
|
||||
public static int ss_nested_with_two_args (int a1, int a2) {
|
||||
return a1 + a2;
|
||||
|
||||
@@ -4461,6 +4461,25 @@ public class DebuggerTests
|
||||
assert_location(e, "ss_nested_arg");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InspectEnumeratorInGenericStruct() {
|
||||
//files.myBucket.GetEnumerator().get_Current().Key watching this generates an exception in Debugger
|
||||
Event e = run_until("inspect_enumerator_in_generic_struct");
|
||||
var req = create_step(e);
|
||||
req.Enable();
|
||||
e = step_once();
|
||||
e = step_over();
|
||||
StackFrame frame = e.Thread.GetFrames () [0];
|
||||
var ginst = frame.Method.GetLocal ("generic_struct");
|
||||
Value variable = frame.GetValue (ginst);
|
||||
StructMirror thisObj = (StructMirror)variable;
|
||||
TypeMirror thisType = thisObj.Type;
|
||||
variable = thisObj.InvokeMethod(e.Thread, thisType.GetMethod("get_Current"), null);
|
||||
thisObj = (StructMirror)variable;
|
||||
thisType = thisObj.Type;
|
||||
AssertValue ("f1", thisObj["value"]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
// Uses a fixed port
|
||||
[Category("NotWorking")]
|
||||
|
||||
@@ -11,17 +11,18 @@ LIB_MCS_FLAGS = /unsafe /publicsign /nowarn:0618
|
||||
|
||||
XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks
|
||||
|
||||
xunit-test-local: log-profiler-test.exe
|
||||
xunit-test-local: $(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe
|
||||
|
||||
log-profiler-test.exe: Test/log-profiler-test.cs
|
||||
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe: Test/log-profiler-test.cs
|
||||
mkdir -p $(dir $@)
|
||||
$(CSCOMPILE) $(PLATFORM_DEBUG_FLAGS) /unsafe $(if $(MCS_MODE),,/warnaserror) /r:$(build_libdir)/mscorlib.dll /r:$(build_lib) /out:$@ $<
|
||||
|
||||
EXTRA_DISTFILES = \
|
||||
Test/log-profiler-test.cs
|
||||
|
||||
CLEAN_FILES = \
|
||||
log-profiler-test.exe \
|
||||
log-profiler-test.exe.mdb \
|
||||
log-profiler-test.pdb
|
||||
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe \
|
||||
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.exe.mdb \
|
||||
$(topdir)/class/lib/$(PROFILE_DIRECTORY)/tests/log-profiler-test.pdb
|
||||
|
||||
include ../../build/library.make
|
||||
@@ -37,8 +37,13 @@ namespace MonoTests.Mono.Profiler.Log {
|
||||
|
||||
static volatile int _id;
|
||||
|
||||
static string _testAssemblyPath;
|
||||
static Process _currentProcess;
|
||||
|
||||
public ProfilerTestRun (string name, string options)
|
||||
{
|
||||
_testAssemblyPath = Path.Combine (Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location), "log-profiler-test.exe");
|
||||
_currentProcess = Process.GetCurrentProcess();
|
||||
Name = name;
|
||||
Options = options;
|
||||
_output = $"test-{_id++}.mlpd";
|
||||
@@ -57,8 +62,8 @@ namespace MonoTests.Mono.Profiler.Log {
|
||||
using (var proc = new Process ()) {
|
||||
proc.StartInfo = new ProcessStartInfo {
|
||||
UseShellExecute = false,
|
||||
FileName = Path.GetFullPath (Path.Combine ("..", "..", "..", "runtime", "mono-wrapper")),
|
||||
Arguments = $"--debug --profile=log:nodefaults,output={_output},{Options} log-profiler-test.exe {Name}",
|
||||
FileName = _currentProcess.MainModule.FileName,
|
||||
Arguments = $"--debug --profile=log:nodefaults,output=\"{_output}\",{Options} {_testAssemblyPath} {Name}",
|
||||
};
|
||||
|
||||
proc.Start ();
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Diagnostics/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Factories/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/Integration/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/UnitTesting/*.cs
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Diagnostics/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Factories/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/Integration/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/UnitTesting/*.cs
|
||||
-8
@@ -110,14 +110,6 @@ namespace System.ComponentModel.Composition.ReflectionModel
|
||||
{
|
||||
Requires.NotNull(importDefinition, "importDefinition");
|
||||
|
||||
ReflectionImportDefinition reflectionImportDefinition = importDefinition as ReflectionImportDefinition;
|
||||
if (reflectionImportDefinition == null)
|
||||
{
|
||||
throw new ArgumentException(
|
||||
string.Format(CultureInfo.CurrentCulture, Strings.ReflectionModel_InvalidImportDefinition, importDefinition.GetType()),
|
||||
"importDefinition");
|
||||
}
|
||||
|
||||
return (importDefinition is IPartCreatorImportDefinition);
|
||||
}
|
||||
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/AttributedModel/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Diagnostics/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Factories/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/Primitives/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/Integration/*.cs
|
||||
../../../external/corefx/src/System.ComponentModel.Composition/tests/System/UnitTesting/*.cs
|
||||
@@ -42,12 +42,6 @@ ifeq (monotouch_runtime, $(PROFILE))
|
||||
LIB_MCS_FLAGS += -d:FULL_AOT_RUNTIME
|
||||
endif
|
||||
|
||||
ifneq (basic, $(PROFILE))
|
||||
ifneq (2.1, $(FRAMEWORK_VERSION))
|
||||
LIB_REFS += Mono.Posix
|
||||
endif
|
||||
endif
|
||||
|
||||
CC_PROFILE := $(filter monotouch% xammac, $(PROFILE))
|
||||
ifdef CC_PROFILE
|
||||
BUILT_SOURCES = \
|
||||
|
||||
@@ -1315,9 +1315,6 @@
|
||||
<ProjectReference Include="../System/System.csproj" />
|
||||
<ProjectReference Include="../corlib/corlib.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Platform)' == 'net_4_x' ">
|
||||
<ProjectReference Include="../Mono.Posix/Mono.Posix.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Platform)' == 'testing_aot_hybrid' ">
|
||||
<Reference Include="nunitlite">
|
||||
<HintPath>..\lib\testing_aot_hybrid\nunitlite.dll</HintPath>
|
||||
@@ -1330,9 +1327,6 @@
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(Platform)' == 'xammac_net_4_5' ">
|
||||
<ProjectReference Include="../Mono.Posix/Mono.Posix.csproj" />
|
||||
</ItemGroup>
|
||||
<!-- @ALL_REFERENCES@ -->
|
||||
<!-- @ALL_RESOURCES@ -->
|
||||
</Project>
|
||||
@@ -0,0 +1 @@
|
||||
../../../external/corefx/src/System.Linq.Expressions/tests/Dynamic/InvokeMemberBindingTests.cs
|
||||
@@ -0,0 +1 @@
|
||||
../../../external/corefx/src/System.Linq.Expressions/tests/Dynamic/InvokeMemberBindingTests.cs
|
||||
@@ -17,7 +17,11 @@ ifndef MOBILE_PROFILE
|
||||
LIB_MCS_FLAGS += -d:FEATURE_TYPECONVERTER,SUPPORTS_WINDOWS_COLORS
|
||||
endif
|
||||
|
||||
TEST_LIB_REFS = System.Drawing System.Runtime.Serialization.Formatters.Soap System.Xml
|
||||
TEST_LIB_REFS = System.Drawing System.Xml
|
||||
|
||||
ifneq ($(PROFILE),wasm)
|
||||
TEST_LIB_REFS += System.Runtime.Serialization.Formatters.Soap
|
||||
endif
|
||||
|
||||
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -define:TEST -resource:Test/resources/indexed.png,indexed.png \
|
||||
-nowarn:0618 -nowarn:219 -nowarn:169
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
System.Drawing/GDIPlusTest.cs
|
||||
System.Drawing/TestBitmap.cs
|
||||
System.Drawing/TestGraphics.cs
|
||||
System.Drawing/TestIcon.cs
|
||||
System.Drawing/TestIconConverter.cs
|
||||
System.Drawing/TestImage.cs
|
||||
System.Drawing/TestImageConverter.cs
|
||||
@@ -57,13 +57,35 @@ namespace System.Net.Http
|
||||
public HttpRequestMessage Request;
|
||||
public CancellationTokenRegistration CancellationTokenRegistration;
|
||||
public CFContentStream ContentStream;
|
||||
public bool StreamCanBeDisposed;
|
||||
|
||||
public void Close ()
|
||||
{
|
||||
CancellationTokenRegistration.Dispose ();
|
||||
if (ContentStream != null) {
|
||||
ContentStream.Close ();
|
||||
}
|
||||
if (ContentStream != null) {
|
||||
// The Close method of the CFContentStream blocks as you can see:
|
||||
// public void Close ()
|
||||
// {
|
||||
// data_read_event.WaitOne (); // make sure there's no pending data
|
||||
//
|
||||
// data_mutex.WaitOne ();
|
||||
// data = null;
|
||||
// this.http_stream.ErrorEvent -= HandleErrorEvent;
|
||||
// data_mutex.ReleaseMutex ();
|
||||
//
|
||||
// data_event.Set ();
|
||||
// }
|
||||
// This means. that when we want to ignore the data of the content, which happens
|
||||
// in the first request of a redirect, if we want to close, ignoring the content
|
||||
// we will have a deadlock.
|
||||
// Dispose will clean all the data, without waiting for the read, which by design in the
|
||||
// CFContentStream, blocks the thread. This happens ONLY after the first request that gets
|
||||
// a redirect status code. All other cases should call close.
|
||||
if (StreamCanBeDisposed)
|
||||
ContentStream.Dispose ();
|
||||
else
|
||||
ContentStream.Close ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +195,11 @@ namespace System.Net.Http
|
||||
}
|
||||
|
||||
protected internal override async Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken)
|
||||
{
|
||||
return await SendAsync (request, cancellationToken, true).ConfigureAwait (false);
|
||||
}
|
||||
|
||||
internal async Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken, bool isFirstRequest)
|
||||
{
|
||||
sentRequest = true;
|
||||
|
||||
@@ -194,7 +221,8 @@ namespace System.Net.Http
|
||||
}
|
||||
}
|
||||
|
||||
stream.ShouldAutoredirect = allowAutoRedirect;
|
||||
if (!isFirstRequest && allowAutoRedirect)
|
||||
stream.ShouldAutoredirect = allowAutoRedirect;
|
||||
stream.HasBytesAvailableEvent += HandleHasBytesAvailableEvent;
|
||||
stream.ErrorEvent += HandleErrorEvent;
|
||||
stream.ClosedEvent += HandleClosedEvent;
|
||||
@@ -234,9 +262,31 @@ namespace System.Net.Http
|
||||
CloseStream (stream);
|
||||
});
|
||||
|
||||
if (isFirstRequest) {
|
||||
var initialRequest = await response.Task;
|
||||
var status = initialRequest.StatusCode;
|
||||
if (IsRedirect (status) && allowAutoRedirect) {
|
||||
bucket.StreamCanBeDisposed = true;
|
||||
// remove headers in a redirect for Authentication.
|
||||
request.Headers.Authorization = null;
|
||||
return await SendAsync (request, cancellationToken, false).ConfigureAwait (false);
|
||||
}
|
||||
return initialRequest;
|
||||
}
|
||||
return await response.Task;
|
||||
}
|
||||
|
||||
// Decide if we redirect or not, similar to what is done in the managed handler
|
||||
// https://github.com/mono/mono/blob/eca15996c7163f331c9f2cd0a17b63e8f92b1d55/mcs/class/referencesource/System/net/System/Net/HttpWebRequest.cs#L5681
|
||||
static bool IsRedirect (HttpStatusCode status)
|
||||
{
|
||||
return status == HttpStatusCode.Ambiguous || // 300
|
||||
status == HttpStatusCode.Moved || // 301
|
||||
status == HttpStatusCode.Redirect || // 302
|
||||
status == HttpStatusCode.RedirectMethod || // 303
|
||||
status == HttpStatusCode.RedirectKeepVerb; // 307
|
||||
}
|
||||
|
||||
void HandleErrorEvent (object sender, CFStream.StreamEventArgs e)
|
||||
{
|
||||
var stream = (CFHTTPStream)sender;
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace System.Net.Http.Headers
|
||||
public ProductHeaderValue (string name, string version)
|
||||
: this (name)
|
||||
{
|
||||
if (version != null)
|
||||
if (!string.IsNullOrEmpty (version))
|
||||
Parser.Token.Check (version);
|
||||
|
||||
Version = version;
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace MonoTests.System.Net.Http.Headers
|
||||
public void Ctor ()
|
||||
{
|
||||
new ProductHeaderValue ("aa", null);
|
||||
new ProductHeaderValue ("aa", "");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -13,7 +13,13 @@ LIB_MCS_FLAGS = \
|
||||
$(RESOURCE_FILES:%=/resource:%)
|
||||
TXT_RESOURCE_STRINGS = ../referencesource/System.Runtime.Serialization/System.Runtime.Serialization.txt
|
||||
|
||||
XTEST_LIB_REFS = System System.Core System.Xml System.Xml.Linq System.Drawing Facades/System.Threading.Tasks
|
||||
XTEST_LIB_REFS = System System.Core System.Xml System.Xml.Linq Facades/System.Threading.Tasks
|
||||
|
||||
ifneq ($(PROFILE),monodroid)
|
||||
ifneq ($(PROFILE),monotouch)
|
||||
XTEST_LIB_REFS += System.Drawing
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (2.1, $(FRAMEWORK_VERSION))
|
||||
LIB_REFS += System.Data System.Configuration SMDiagnostics
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../external/corefx/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.RuntimeOnly.cs
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../external/corefx/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.RuntimeOnly.cs
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../external/corefx/src/System.Runtime.Serialization.Xml/tests/SerializationTypes.RuntimeOnly.cs
|
||||
@@ -0,0 +1 @@
|
||||
System.Security.Permissions/DataProtectionPermissionAttributeTest.cs
|
||||
@@ -0,0 +1,8 @@
|
||||
System.Web.Services.Configuration/DiagnosticsElementTest.cs
|
||||
System.Web.Services.Configuration/ProtocolElementTest.cs
|
||||
System.Web.Services.Configuration/SoapEnvelopeProcessingElementTest.cs
|
||||
System.Web.Services.Configuration/SoapExtensionTypeElementTest.cs
|
||||
System.Web.Services.Configuration/TypeElementTest.cs
|
||||
System.Web.Services.Configuration/WsdlHelpGeneratorElementTest.cs
|
||||
System.Web.Services.Configuration/WsiProfilesElementTest.cs
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
System.Web.Services.Configuration/DiagnosticsElementTest.cs
|
||||
System.Web.Services.Configuration/ProtocolElementTest.cs
|
||||
System.Web.Services.Configuration/SoapEnvelopeProcessingElementTest.cs
|
||||
System.Web.Services.Configuration/SoapExtensionTypeElementTest.cs
|
||||
System.Web.Services.Configuration/TypeElementTest.cs
|
||||
System.Web.Services.Configuration/WsdlHelpGeneratorElementTest.cs
|
||||
System.Web.Services.Configuration/WsiProfilesElementTest.cs
|
||||
|
||||
@@ -272,7 +272,8 @@ namespace System.Web.Configuration
|
||||
{
|
||||
string path = NormalizeVirtualPath (virtualPath);
|
||||
|
||||
foreach (VirtualDirectoryMapping mapping in map.VirtualDirectories) {
|
||||
for (int j = 0; j < map.VirtualDirectories.Count; j++) {
|
||||
VirtualDirectoryMapping mapping = map.VirtualDirectories.Get(j);
|
||||
if (path.StartsWith (mapping.VirtualDirectory)) {
|
||||
int i = mapping.VirtualDirectory.Length;
|
||||
if (path.Length == i) {
|
||||
|
||||
@@ -142,3 +142,9 @@ notepad.exe: samples/notepad.cs $(topdir)/class/lib/$(PROFILE)/System.Windows.Fo
|
||||
|
||||
test-notepad: notepad.exe
|
||||
$(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) notepad.exe
|
||||
|
||||
issue10235.exe: samples/issue10235.cs $(topdir)/class/lib/$(PROFILE)/System.Windows.Forms.dll $(topdir)/class/lib/$(PROFILE)/System.Drawing.dll $(topdir)/class/lib/$(PROFILE)/System.dll $(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
$(CSCOMPILE) -out:$@ samples/issue10235.cs -r:$(topdir)/class/lib/$(PROFILE)/System.Windows.Forms.dll -r:$(topdir)/class/lib/$(PROFILE)/System.Drawing.dll -r:$(topdir)/class/lib/$(PROFILE)/System.dll -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
||||
|
||||
test-issue10235: issue10235.exe
|
||||
$(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) issue10235.exe
|
||||
@@ -195,8 +195,13 @@ namespace System.Windows.Forms.Layout
|
||||
{
|
||||
IArrangedContainer parent = (IArrangedContainer)container;
|
||||
|
||||
LayoutDockedChildren (parent, parent.Controls);
|
||||
LayoutAnchoredChildren (parent, parent.Controls);
|
||||
if (parent.Controls is Control.ControlCollection controlCollection) {
|
||||
LayoutDockedChildren (parent, controlCollection.GetAllControls());
|
||||
LayoutAnchoredChildren (parent, controlCollection.GetAllControls());
|
||||
} else {
|
||||
LayoutDockedChildren (parent, parent.Controls);
|
||||
LayoutAnchoredChildren (parent, parent.Controls);
|
||||
}
|
||||
|
||||
return parent.AutoSize;
|
||||
}
|
||||
|
||||
@@ -73,6 +73,9 @@ namespace System.Windows.Forms
|
||||
|
||||
internal bool has_been_focused;
|
||||
|
||||
private bool delayed_font_or_color_change;
|
||||
private int requested_height;
|
||||
|
||||
internal int selection_length = -1; // set to the user-specified selection length, or -1 if none
|
||||
internal bool show_caret_w_selection; // TextBox shows the caret when the selection is visible
|
||||
internal int canvas_width;
|
||||
@@ -163,6 +166,8 @@ namespace System.Windows.Forms
|
||||
|
||||
Cursor = Cursors.IBeam;
|
||||
|
||||
requested_height = Height;
|
||||
|
||||
can_cache_preferred_size = true;
|
||||
}
|
||||
#endregion // Internal Constructor
|
||||
@@ -1008,6 +1013,9 @@ namespace System.Windows.Forms
|
||||
protected override void OnHandleCreated (EventArgs e)
|
||||
{
|
||||
base.OnHandleCreated (e);
|
||||
if (delayed_font_or_color_change) {
|
||||
TextBoxBase_FontOrColorChanged (this, e);
|
||||
}
|
||||
FixupHeight ();
|
||||
}
|
||||
|
||||
@@ -1467,20 +1475,13 @@ namespace System.Windows.Forms
|
||||
{
|
||||
// Make sure we don't get sized bigger than we want to be
|
||||
|
||||
if ((specified & BoundsSpecified.Height) != 0) {
|
||||
requested_height = height;
|
||||
}
|
||||
|
||||
if (!richtext) {
|
||||
if (!document.multiline) {
|
||||
if (height != PreferredHeight) {
|
||||
// If the specified has Height, we need to store that in the
|
||||
// ExplicitBounds because we are going to override it
|
||||
if ((specified & BoundsSpecified.Height) != 0) {
|
||||
Rectangle r = ExplicitBounds;
|
||||
r.Height = height;
|
||||
ExplicitBounds = r;
|
||||
specified &= ~BoundsSpecified.Height;
|
||||
}
|
||||
|
||||
height = PreferredHeight;
|
||||
}
|
||||
height = PreferredHeight;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1763,13 +1764,15 @@ namespace System.Windows.Forms
|
||||
private void FixupHeight ()
|
||||
{
|
||||
if (!richtext) {
|
||||
int saved_requested_height = requested_height;
|
||||
if (!document.multiline) {
|
||||
if (PreferredHeight != Height) {
|
||||
SetBoundsCore (Left, Top, Width, PreferredHeight, BoundsSpecified.None);
|
||||
SetBoundsCore (Left, Top, Width, PreferredHeight, BoundsSpecified.Height);
|
||||
}
|
||||
} else {
|
||||
SetBoundsCore (Left, Top, Width, Math.Max(PreferredHeight, ExplicitBounds.Height), BoundsSpecified.None);
|
||||
SetBoundsCore (Left, Top, Width, Math.Max(PreferredHeight, requested_height), BoundsSpecified.Height);
|
||||
}
|
||||
requested_height = saved_requested_height;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2238,8 +2241,10 @@ namespace System.Windows.Forms
|
||||
{
|
||||
Line line;
|
||||
|
||||
if (!IsHandleCreated)
|
||||
if (!IsHandleCreated) {
|
||||
delayed_font_or_color_change = true;
|
||||
return;
|
||||
}
|
||||
|
||||
document.SuspendRecalc ();
|
||||
// Font changes apply to the whole document
|
||||
|
||||
@@ -318,10 +318,15 @@ namespace System.Windows.Forms
|
||||
|
||||
internal static void DrawTextInternal (IDeviceContext dc, string text, Font font, Point pt, Color foreColor, Color backColor, TextFormatFlags flags, bool useDrawString)
|
||||
{
|
||||
Size sz = MeasureTextInternal (dc, text, font, useDrawString);
|
||||
Size sz = MeasureTextInternal (dc, text, font, flags, useDrawString);
|
||||
DrawTextInternal (dc, text, font, new Rectangle (pt, sz), foreColor, backColor, flags, useDrawString);
|
||||
}
|
||||
|
||||
internal static Size MeasureTextInternal (IDeviceContext dc, string text, Font font, TextFormatFlags flags, bool useMeasureString)
|
||||
{
|
||||
return MeasureTextInternal (dc, text, font, Size.Empty, flags, useMeasureString);
|
||||
}
|
||||
|
||||
internal static Size MeasureTextInternal (IDeviceContext dc, string text, Font font, bool useMeasureString)
|
||||
{
|
||||
return MeasureTextInternal (dc, text, font, Size.Empty, TextFormatFlags.Default, useMeasureString);
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Test
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Der Haupteinstiegspunkt für die Anwendung.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.comboBox1.AutoSize = true; // necessary in Windows .Net to avoid wrong behaviour in TableLayout in particular wrong positioning
|
||||
this.comboBox1.DataSource = new string[] { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen" };
|
||||
this.Font = new Font(DefaultFont.FontFamily.Name, DefaultFont.Size * 2.0f); // double font size for the whole form i.e. including all controls
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Erforderliche Designervariable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Verwendete Ressourcen bereinigen.
|
||||
/// </summary>
|
||||
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Vom Windows Form-Designer generierter Code
|
||||
|
||||
/// <summary>
|
||||
/// Erforderliche Methode für die Designerunterstützung.
|
||||
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.comboBox1, 1, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.numericUpDown1, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.textBox1, 1, 2);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 3;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(184, 162);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(3, 20);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(3);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(35, 13);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "label1";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(3, 74);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(3);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(35, 13);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "label2";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(3, 128);
|
||||
this.label3.Margin = new System.Windows.Forms.Padding(3);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(35, 13);
|
||||
this.label3.TabIndex = 2;
|
||||
this.label3.Text = "label3";
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBox1.Location = new System.Drawing.Point(44, 70);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(137, 21);
|
||||
this.comboBox1.TabIndex = 4;
|
||||
//
|
||||
// numericUpDown1
|
||||
//
|
||||
this.numericUpDown1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.numericUpDown1.Location = new System.Drawing.Point(44, 17);
|
||||
this.numericUpDown1.Name = "numericUpDown1";
|
||||
this.numericUpDown1.Size = new System.Drawing.Size(137, 20);
|
||||
this.numericUpDown1.TabIndex = 5;
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.textBox1.Location = new System.Drawing.Point(44, 125);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(137, 20);
|
||||
this.textBox1.TabIndex = 6;
|
||||
this.textBox1.Text = "test";
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.ClientSize = new System.Drawing.Size(184, 162);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Name = "Form1";
|
||||
this.Text = "Form1";
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.NumericUpDown numericUpDown1;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,13 @@ endif
|
||||
|
||||
TEST_LIB_REFS = System.Data System.Core
|
||||
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:0618 -nowarn:219 -nowarn:169
|
||||
XTEST_LIB_REFS = System System.Core System.Xml System.Xml.Linq System.Drawing Facades/System.Threading.Tasks System.Runtime.Serialization Facades/System.Text.Encoding.CodePages
|
||||
XTEST_LIB_REFS = System System.Core System.Xml System.Xml.Linq Facades/System.Threading.Tasks System.Runtime.Serialization Facades/System.Text.Encoding.CodePages
|
||||
|
||||
ifneq ($(PROFILE),monodroid)
|
||||
ifneq ($(PROFILE),monotouch)
|
||||
XTEST_LIB_REFS += System.Drawing
|
||||
endif
|
||||
endif
|
||||
|
||||
LIBRARY_WARN_AS_ERROR = yes
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ using NUnit.Framework;
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using Network = System.Net;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.Schema;
|
||||
using System.Collections.Generic;
|
||||
@@ -94,7 +93,7 @@ namespace MonoTests.System.Xml.Schema
|
||||
{
|
||||
// Create a resolver with default credentials.
|
||||
XmlUrlResolver resolver = new XmlUrlResolver ();
|
||||
resolver.Credentials = Network.CredentialCache.DefaultCredentials;
|
||||
resolver.Credentials = global::System.Net.CredentialCache.DefaultCredentials;
|
||||
// Set the reader settings object to use the resolver.
|
||||
XmlReaderSettings settings = new XmlReaderSettings ();
|
||||
settings.XmlResolver = resolver;
|
||||
|
||||
@@ -82,3 +82,7 @@ using System.Runtime.InteropServices;
|
||||
#if XAMMAC || XAMMAC_4_5
|
||||
[assembly: InternalsVisibleTo ("Xamarin.Mac, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
|
||||
#endif
|
||||
|
||||
#if MONODROID
|
||||
[assembly: InternalsVisibleTo ("Mono.Android, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
|
||||
#endif
|
||||
@@ -85,6 +85,10 @@ ifdef ONLY_APPLETLS
|
||||
LIB_MCS_FLAGS += -d:ONLY_APPLETLS
|
||||
endif
|
||||
|
||||
ifdef MONO_FEATURE_APPLE_X509
|
||||
LIB_MCS_FLAGS += -d:MONO_FEATURE_APPLE_X509
|
||||
endif
|
||||
|
||||
ifndef PROFILE_DISABLE_BTLS
|
||||
ifdef HAVE_BTLS
|
||||
|
||||
@@ -128,7 +132,7 @@ EXTRA_DISTFILES = \
|
||||
|
||||
include ../../build/library.make
|
||||
|
||||
$(test_lib_output): $(TEST_RESOURCES) $(test_lib_dir)
|
||||
$(test_lib_output): $(TEST_RESOURCES) | $(test_lib_dir)
|
||||
|
||||
# Helper target to run the perl regex test suite
|
||||
regex-check:
|
||||
|
||||
@@ -33,7 +33,6 @@ using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography.Apple;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
using Mono.Net;
|
||||
|
||||
namespace Mono.AppleTls
|
||||
{
|
||||
@@ -56,7 +55,7 @@ namespace Mono.AppleTls
|
||||
if (Interlocked.CompareExchange (ref initialized, 1, 0) != 0)
|
||||
return;
|
||||
|
||||
var handle = CFObject.dlopen (AppleTlsContext.SecurityLibrary, 0);
|
||||
var handle = CFObject.dlopen (SecurityLibrary, 0);
|
||||
if (handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
@@ -93,7 +92,7 @@ namespace Mono.AppleTls
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport (AppleTlsContext.SecurityLibrary)]
|
||||
[DllImport (SecurityLibrary)]
|
||||
extern static SecStatusCode SecPKCS12Import (IntPtr pkcs12_data, IntPtr options, out IntPtr items);
|
||||
|
||||
static SecStatusCode ImportPkcs12 (byte[] buffer, CFDictionary options, out CFDictionary[] array)
|
||||
@@ -134,7 +133,7 @@ namespace Mono.AppleTls
|
||||
return identity ?? new SafeSecIdentityHandle ();
|
||||
}
|
||||
|
||||
[DllImport (AppleTlsContext.SecurityLibrary)]
|
||||
[DllImport (SecurityLibrary)]
|
||||
extern static SecStatusCode SecItemCopyMatching (/* CFDictionaryRef */ IntPtr query, /* CFTypeRef* */ out IntPtr result);
|
||||
|
||||
public static SafeSecIdentityHandle FindIdentity (SafeSecCertificateHandle certificate, bool throwOnError = false)
|
||||
|
||||
@@ -33,13 +33,14 @@ using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography.Apple;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
using Mono.Net;
|
||||
|
||||
namespace Mono.AppleTls
|
||||
{
|
||||
static partial class MonoCertificatePal
|
||||
{
|
||||
[DllImport (AppleTlsContext.SecurityLibrary)]
|
||||
const string SecurityLibrary = OSX509Certificates.SecurityLibrary;
|
||||
|
||||
[DllImport (SecurityLibrary)]
|
||||
extern static IntPtr SecCertificateCreateWithData (IntPtr allocator, IntPtr cfData);
|
||||
|
||||
public static SafeSecCertificateHandle FromOtherCertificate (X509Certificate certificate)
|
||||
@@ -66,7 +67,7 @@ namespace Mono.AppleTls
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport (AppleTlsContext.SecurityLibrary)]
|
||||
[DllImport (SecurityLibrary)]
|
||||
extern static IntPtr SecIdentityGetTypeID ();
|
||||
|
||||
public static bool IsSecIdentity (IntPtr ptr)
|
||||
@@ -76,7 +77,7 @@ namespace Mono.AppleTls
|
||||
return CFType.GetTypeID (ptr) == SecIdentityGetTypeID ();
|
||||
}
|
||||
|
||||
[DllImport (AppleTlsContext.SecurityLibrary)]
|
||||
[DllImport (SecurityLibrary)]
|
||||
public extern static IntPtr SecKeyGetTypeID ();
|
||||
|
||||
public static bool IsSecKey (IntPtr ptr)
|
||||
@@ -86,7 +87,7 @@ namespace Mono.AppleTls
|
||||
return CFType.GetTypeID (ptr) == SecKeyGetTypeID ();
|
||||
}
|
||||
|
||||
[DllImport (AppleTlsContext.SecurityLibrary)]
|
||||
[DllImport (SecurityLibrary)]
|
||||
extern static /* OSStatus */ SecStatusCode SecIdentityCopyCertificate (/* SecIdentityRef */ IntPtr identityRef, /* SecCertificateRef* */ out IntPtr certificateRef);
|
||||
|
||||
public static SafeSecCertificateHandle GetCertificate (SafeSecIdentityHandle identity)
|
||||
@@ -99,7 +100,7 @@ namespace Mono.AppleTls
|
||||
return new SafeSecCertificateHandle (cert, true);
|
||||
}
|
||||
|
||||
[DllImport (AppleTlsContext.SecurityLibrary)]
|
||||
[DllImport (SecurityLibrary)]
|
||||
extern static IntPtr SecCertificateCopySubjectSummary (IntPtr cert);
|
||||
|
||||
public static string GetSubjectSummary (SafeSecCertificateHandle certificate)
|
||||
@@ -117,7 +118,7 @@ namespace Mono.AppleTls
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport (AppleTlsContext.SecurityLibrary)]
|
||||
[DllImport (SecurityLibrary)]
|
||||
extern static /* CFDataRef */ IntPtr SecCertificateCopyData (/* SecCertificateRef */ IntPtr cert);
|
||||
|
||||
public static byte[] GetRawData (SafeSecCertificateHandle certificate)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography.Apple;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
using Mono.Net;
|
||||
using Mono;
|
||||
|
||||
namespace System.Security.Cryptography.X509Certificates
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography.Apple;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
using Mono.Net;
|
||||
using Mono;
|
||||
|
||||
namespace System.Security.Cryptography.X509Certificates
|
||||
{
|
||||
|
||||
@@ -33,6 +33,7 @@ using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net.Security;
|
||||
using System.Security.Cryptography;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Security.Authentication;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
@@ -221,9 +222,100 @@ namespace Mono.Btls
|
||||
X509Chain chain, MonoBtlsX509StoreCtx storeCtx,
|
||||
bool success, ref MonoSslPolicyErrors errors, ref int status11)
|
||||
{
|
||||
if (!success) {
|
||||
errors = MonoSslPolicyErrors.RemoteCertificateChainErrors;
|
||||
status11 = unchecked((int)0);
|
||||
if (success)
|
||||
return;
|
||||
errors = MonoSslPolicyErrors.RemoteCertificateChainErrors;
|
||||
if (!wantsChain || storeCtx == null || chain == null) {
|
||||
status11 = unchecked((int)0x800B010B);
|
||||
return;
|
||||
}
|
||||
var error = storeCtx.GetError();
|
||||
if (error != Mono.Btls.MonoBtlsX509Error.OK &
|
||||
error != Mono.Btls.MonoBtlsX509Error.CRL_NOT_YET_VALID) {
|
||||
chain.Impl.AddStatus(MapVerifyErrorToChainStatus(error));
|
||||
status11 = unchecked((int)0x800B010B);
|
||||
}
|
||||
}
|
||||
|
||||
internal static X509ChainStatusFlags MapVerifyErrorToChainStatus (MonoBtlsX509Error code)
|
||||
{
|
||||
switch (code) {
|
||||
case MonoBtlsX509Error.OK :
|
||||
return X509ChainStatusFlags.NoError;
|
||||
|
||||
case MonoBtlsX509Error.CERT_NOT_YET_VALID :
|
||||
case MonoBtlsX509Error.CERT_HAS_EXPIRED:
|
||||
case MonoBtlsX509Error.ERROR_IN_CERT_NOT_BEFORE_FIELD:
|
||||
case MonoBtlsX509Error.ERROR_IN_CERT_NOT_AFTER_FIELD:
|
||||
return X509ChainStatusFlags.NotTimeValid;
|
||||
|
||||
case MonoBtlsX509Error.CERT_REVOKED:
|
||||
return X509ChainStatusFlags.Revoked;
|
||||
|
||||
case MonoBtlsX509Error.UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY:
|
||||
case MonoBtlsX509Error.CERT_SIGNATURE_FAILURE:
|
||||
return X509ChainStatusFlags.NotSignatureValid;
|
||||
|
||||
case MonoBtlsX509Error.CERT_UNTRUSTED:
|
||||
case MonoBtlsX509Error.DEPTH_ZERO_SELF_SIGNED_CERT:
|
||||
case MonoBtlsX509Error.SELF_SIGNED_CERT_IN_CHAIN:
|
||||
return X509ChainStatusFlags.UntrustedRoot;
|
||||
|
||||
case MonoBtlsX509Error.CRL_HAS_EXPIRED:
|
||||
return X509ChainStatusFlags.OfflineRevocation;
|
||||
|
||||
case MonoBtlsX509Error.CRL_NOT_YET_VALID:
|
||||
case MonoBtlsX509Error.CRL_SIGNATURE_FAILURE:
|
||||
case MonoBtlsX509Error.ERROR_IN_CRL_LAST_UPDATE_FIELD:
|
||||
case MonoBtlsX509Error.ERROR_IN_CRL_NEXT_UPDATE_FIELD:
|
||||
case MonoBtlsX509Error.KEYUSAGE_NO_CRL_SIGN:
|
||||
case MonoBtlsX509Error.UNABLE_TO_DECRYPT_CRL_SIGNATURE:
|
||||
case MonoBtlsX509Error.UNABLE_TO_GET_CRL:
|
||||
case MonoBtlsX509Error.UNABLE_TO_GET_CRL_ISSUER:
|
||||
case MonoBtlsX509Error.UNHANDLED_CRITICAL_CRL_EXTENSION:
|
||||
return X509ChainStatusFlags.RevocationStatusUnknown;
|
||||
|
||||
case MonoBtlsX509Error.INVALID_EXTENSION:
|
||||
return X509ChainStatusFlags.InvalidExtension;
|
||||
|
||||
case MonoBtlsX509Error.UNABLE_TO_GET_ISSUER_CERT:
|
||||
case MonoBtlsX509Error.UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
|
||||
case MonoBtlsX509Error.UNABLE_TO_VERIFY_LEAF_SIGNATURE:
|
||||
return X509ChainStatusFlags.PartialChain;
|
||||
|
||||
case MonoBtlsX509Error.INVALID_PURPOSE:
|
||||
return X509ChainStatusFlags.NotValidForUsage;
|
||||
|
||||
case MonoBtlsX509Error.INVALID_CA:
|
||||
case MonoBtlsX509Error.INVALID_NON_CA:
|
||||
case MonoBtlsX509Error.PATH_LENGTH_EXCEEDED:
|
||||
case MonoBtlsX509Error.KEYUSAGE_NO_CERTSIGN:
|
||||
case MonoBtlsX509Error.KEYUSAGE_NO_DIGITAL_SIGNATURE:
|
||||
return X509ChainStatusFlags.InvalidBasicConstraints;
|
||||
|
||||
case MonoBtlsX509Error.INVALID_POLICY_EXTENSION:
|
||||
case MonoBtlsX509Error.NO_EXPLICIT_POLICY:
|
||||
return X509ChainStatusFlags.InvalidPolicyConstraints;
|
||||
|
||||
case MonoBtlsX509Error.CERT_REJECTED:
|
||||
return X509ChainStatusFlags.ExplicitDistrust;
|
||||
|
||||
case MonoBtlsX509Error.UNHANDLED_CRITICAL_EXTENSION:
|
||||
return X509ChainStatusFlags.HasNotSupportedCriticalExtension;
|
||||
|
||||
case MonoBtlsX509Error.HOSTNAME_MISMATCH:
|
||||
// FIXME: we should have a better error flag for this.
|
||||
return X509ChainStatusFlags.UntrustedRoot;
|
||||
|
||||
case MonoBtlsX509Error.CERT_CHAIN_TOO_LONG:
|
||||
throw new CryptographicException ();
|
||||
|
||||
case MonoBtlsX509Error.OUT_OF_MEM:
|
||||
throw new OutOfMemoryException ();
|
||||
|
||||
default:
|
||||
throw new CryptographicException ("Unrecognized X509VerifyStatusCode:" + code);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -142,6 +142,11 @@ namespace Mono.Btls
|
||||
return mono_btls_x509_store_ctx_get_error (Handle.DangerousGetHandle (), out error_string_ptr);
|
||||
}
|
||||
|
||||
public int GetErrorDepth ()
|
||||
{
|
||||
return mono_btls_x509_store_ctx_get_error_depth (Handle.DangerousGetHandle ());
|
||||
}
|
||||
|
||||
public MonoBtlsX509Exception GetException ()
|
||||
{
|
||||
IntPtr error_string_ptr;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
// THE SOFTWARE.
|
||||
#if SECURITY_DEP && MONO_FEATURE_BTLS
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Security;
|
||||
using System.Security.Cryptography;
|
||||
@@ -42,6 +43,7 @@ namespace Mono.Btls
|
||||
X509Certificate2Collection untrusted;
|
||||
X509Certificate2[] certificates;
|
||||
X509ChainPolicy policy;
|
||||
List<X509ChainStatus> chainStatusList;
|
||||
|
||||
internal X509ChainImplBtls (MonoBtlsX509Chain chain)
|
||||
{
|
||||
@@ -124,7 +126,16 @@ namespace Mono.Btls
|
||||
}
|
||||
|
||||
public override X509ChainStatus[] ChainStatus {
|
||||
get { throw new NotImplementedException (); }
|
||||
get {
|
||||
return chainStatusList.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddStatus (X509ChainStatusFlags errorCode)
|
||||
{
|
||||
if (chainStatusList == null)
|
||||
chainStatusList = new List<X509ChainStatus>();
|
||||
chainStatusList.Add (new X509ChainStatus(errorCode));
|
||||
}
|
||||
|
||||
public override bool Build (X509Certificate2 certificate)
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace Mono.Net.Security
|
||||
Settings = settings;
|
||||
Provider = provider;
|
||||
|
||||
readBuffer = new BufferOffsetSize2 (16834);
|
||||
readBuffer = new BufferOffsetSize2 (16500);
|
||||
writeBuffer = new BufferOffsetSize2 (16384);
|
||||
operation = Operation.None;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ using System.Security.Cryptography;
|
||||
|
||||
namespace Mono.Net.Security
|
||||
{
|
||||
class MonoTlsStream
|
||||
class MonoTlsStream : IDisposable
|
||||
{
|
||||
#if SECURITY_DEP
|
||||
readonly MonoTlsProvider provider;
|
||||
@@ -136,6 +136,7 @@ namespace Mono.Net.Security
|
||||
request.ServicePoint.UpdateClientCertificate (sslStream.InternalLocalCertificate);
|
||||
else {
|
||||
request.ServicePoint.UpdateClientCertificate (null);
|
||||
sslStream.Dispose ();
|
||||
sslStream = null;
|
||||
}
|
||||
}
|
||||
@@ -154,5 +155,13 @@ namespace Mono.Net.Security
|
||||
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
if (sslStream != null) {
|
||||
sslStream.Dispose ();
|
||||
sslStream = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,673 @@
|
||||
//
|
||||
// MacProxy.cs
|
||||
//
|
||||
// Author: Jeffrey Stedfast <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2012-2014 Xamarin Inc.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using ObjCRuntimeInternal;
|
||||
|
||||
namespace Mono
|
||||
{
|
||||
internal class CFType {
|
||||
[DllImport (CFObject.CoreFoundationLibrary, EntryPoint="CFGetTypeID")]
|
||||
public static extern IntPtr GetTypeID (IntPtr typeRef);
|
||||
}
|
||||
|
||||
internal class CFObject : IDisposable, INativeObject
|
||||
{
|
||||
public const string CoreFoundationLibrary = "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation";
|
||||
const string SystemLibrary = "/usr/lib/libSystem.dylib";
|
||||
|
||||
[DllImport (SystemLibrary)]
|
||||
public static extern IntPtr dlopen (string path, int mode);
|
||||
|
||||
[DllImport (SystemLibrary)]
|
||||
static extern IntPtr dlsym (IntPtr handle, string symbol);
|
||||
|
||||
[DllImport (SystemLibrary)]
|
||||
public static extern void dlclose (IntPtr handle);
|
||||
|
||||
public static IntPtr GetIndirect (IntPtr handle, string symbol)
|
||||
{
|
||||
return dlsym (handle, symbol);
|
||||
}
|
||||
|
||||
public static CFString GetStringConstant (IntPtr handle, string symbol)
|
||||
{
|
||||
var indirect = dlsym (handle, symbol);
|
||||
if (indirect == IntPtr.Zero)
|
||||
return null;
|
||||
var actual = Marshal.ReadIntPtr (indirect);
|
||||
if (actual == IntPtr.Zero)
|
||||
return null;
|
||||
return new CFString (actual, false);
|
||||
}
|
||||
|
||||
public static IntPtr GetIntPtr (IntPtr handle, string symbol)
|
||||
{
|
||||
var indirect = dlsym (handle, symbol);
|
||||
if (indirect == IntPtr.Zero)
|
||||
return IntPtr.Zero;
|
||||
return Marshal.ReadIntPtr (indirect);
|
||||
}
|
||||
|
||||
public static IntPtr GetCFObjectHandle (IntPtr handle, string symbol)
|
||||
{
|
||||
var indirect = dlsym (handle, symbol);
|
||||
if (indirect == IntPtr.Zero)
|
||||
return IntPtr.Zero;
|
||||
|
||||
return Marshal.ReadIntPtr (indirect);
|
||||
}
|
||||
|
||||
public CFObject (IntPtr handle, bool own)
|
||||
{
|
||||
Handle = handle;
|
||||
|
||||
if (!own)
|
||||
Retain ();
|
||||
}
|
||||
|
||||
~CFObject ()
|
||||
{
|
||||
Dispose (false);
|
||||
}
|
||||
|
||||
public IntPtr Handle { get; private set; }
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
internal extern static IntPtr CFRetain (IntPtr handle);
|
||||
|
||||
void Retain ()
|
||||
{
|
||||
CFRetain (Handle);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
internal extern static void CFRelease (IntPtr handle);
|
||||
|
||||
void Release ()
|
||||
{
|
||||
CFRelease (Handle);
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (Handle != IntPtr.Zero) {
|
||||
Release ();
|
||||
Handle = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
GC.SuppressFinalize (this);
|
||||
}
|
||||
}
|
||||
|
||||
internal class CFArray : CFObject
|
||||
{
|
||||
public CFArray (IntPtr handle, bool own) : base (handle, own) { }
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFArrayCreate (IntPtr allocator, IntPtr values, /* CFIndex */ IntPtr numValues, IntPtr callbacks);
|
||||
static readonly IntPtr kCFTypeArrayCallbacks;
|
||||
|
||||
static CFArray ()
|
||||
{
|
||||
var handle = dlopen (CoreFoundationLibrary, 0);
|
||||
if (handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
try {
|
||||
kCFTypeArrayCallbacks = GetIndirect (handle, "kCFTypeArrayCallBacks");
|
||||
} finally {
|
||||
dlclose (handle);
|
||||
}
|
||||
}
|
||||
|
||||
public static CFArray FromNativeObjects (params INativeObject[] values)
|
||||
{
|
||||
return new CFArray (Create (values), true);
|
||||
}
|
||||
|
||||
public static unsafe IntPtr Create (params IntPtr[] values)
|
||||
{
|
||||
if (values == null)
|
||||
throw new ArgumentNullException ("values");
|
||||
fixed (IntPtr* pv = values) {
|
||||
return CFArrayCreate (IntPtr.Zero, (IntPtr) pv, (IntPtr)values.Length, kCFTypeArrayCallbacks);
|
||||
}
|
||||
}
|
||||
|
||||
internal static unsafe CFArray CreateArray (params IntPtr[] values)
|
||||
{
|
||||
if (values == null)
|
||||
throw new ArgumentNullException ("values");
|
||||
|
||||
fixed (IntPtr *pv = values) {
|
||||
IntPtr handle = CFArrayCreate (IntPtr.Zero, (IntPtr) pv, (IntPtr) values.Length, kCFTypeArrayCallbacks);
|
||||
|
||||
return new CFArray (handle, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static CFArray CreateArray (params INativeObject[] values)
|
||||
{
|
||||
return new CFArray (Create (values), true);
|
||||
}
|
||||
|
||||
public static IntPtr Create (params INativeObject[] values)
|
||||
{
|
||||
if (values == null)
|
||||
throw new ArgumentNullException ("values");
|
||||
IntPtr[] _values = new IntPtr [values.Length];
|
||||
for (int i = 0; i < _values.Length; ++i)
|
||||
_values [i] = values [i].Handle;
|
||||
return Create (_values);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static /* CFIndex */ IntPtr CFArrayGetCount (IntPtr handle);
|
||||
|
||||
public int Count {
|
||||
get { return (int) CFArrayGetCount (Handle); }
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFArrayGetValueAtIndex (IntPtr handle, /* CFIndex */ IntPtr index);
|
||||
|
||||
public IntPtr this[int index] {
|
||||
get {
|
||||
return CFArrayGetValueAtIndex (Handle, (IntPtr) index);
|
||||
}
|
||||
}
|
||||
|
||||
static public T [] ArrayFromHandle<T> (IntPtr handle, Func<IntPtr, T> creation) where T : class, INativeObject
|
||||
{
|
||||
if (handle == IntPtr.Zero)
|
||||
return null;
|
||||
|
||||
var c = CFArrayGetCount (handle);
|
||||
T [] ret = new T [(int)c];
|
||||
|
||||
for (uint i = 0; i < (uint)c; i++) {
|
||||
ret [i] = creation (CFArrayGetValueAtIndex (handle, (IntPtr)i));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
internal class CFNumber : CFObject
|
||||
{
|
||||
public CFNumber (IntPtr handle, bool own) : base (handle, own) { }
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
[return: MarshalAs (UnmanagedType.I1)]
|
||||
extern static bool CFNumberGetValue (IntPtr handle, /* CFNumberType */ IntPtr type, [MarshalAs (UnmanagedType.I1)] out bool value);
|
||||
|
||||
public static bool AsBool (IntPtr handle)
|
||||
{
|
||||
bool value;
|
||||
|
||||
if (handle == IntPtr.Zero)
|
||||
return false;
|
||||
|
||||
CFNumberGetValue (handle, (IntPtr) 1, out value);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static implicit operator bool (CFNumber number)
|
||||
{
|
||||
return AsBool (number.Handle);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
[return: MarshalAs (UnmanagedType.I1)]
|
||||
extern static bool CFNumberGetValue (IntPtr handle, /* CFNumberType */ IntPtr type, out int value);
|
||||
|
||||
public static int AsInt32 (IntPtr handle)
|
||||
{
|
||||
int value;
|
||||
|
||||
if (handle == IntPtr.Zero)
|
||||
return 0;
|
||||
|
||||
// 9 == kCFNumberIntType == C int
|
||||
CFNumberGetValue (handle, (IntPtr) 9, out value);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFNumberCreate (IntPtr allocator, IntPtr theType, IntPtr valuePtr);
|
||||
|
||||
public static CFNumber FromInt32 (int number)
|
||||
{
|
||||
// 9 == kCFNumberIntType == C int
|
||||
return new CFNumber (CFNumberCreate (IntPtr.Zero, (IntPtr)9, (IntPtr)number), true);
|
||||
}
|
||||
|
||||
public static implicit operator int (CFNumber number)
|
||||
{
|
||||
return AsInt32 (number.Handle);
|
||||
}
|
||||
}
|
||||
|
||||
internal struct CFRange {
|
||||
public IntPtr Location, Length;
|
||||
|
||||
public CFRange (int loc, int len)
|
||||
{
|
||||
Location = (IntPtr) loc;
|
||||
Length = (IntPtr) len;
|
||||
}
|
||||
}
|
||||
|
||||
internal class CFString : CFObject
|
||||
{
|
||||
string str;
|
||||
|
||||
public CFString (IntPtr handle, bool own) : base (handle, own) { }
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFStringCreateWithCharacters (IntPtr alloc, IntPtr chars, /* CFIndex */ IntPtr length);
|
||||
|
||||
public static CFString Create (string value)
|
||||
{
|
||||
IntPtr handle;
|
||||
|
||||
unsafe {
|
||||
fixed (char *ptr = value) {
|
||||
handle = CFStringCreateWithCharacters (IntPtr.Zero, (IntPtr) ptr, (IntPtr) value.Length);
|
||||
}
|
||||
}
|
||||
|
||||
if (handle == IntPtr.Zero)
|
||||
return null;
|
||||
|
||||
return new CFString (handle, true);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static /* CFIndex */ IntPtr CFStringGetLength (IntPtr handle);
|
||||
|
||||
public int Length {
|
||||
get {
|
||||
if (str != null)
|
||||
return str.Length;
|
||||
|
||||
return (int) CFStringGetLength (Handle);
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static int CFStringCompare (IntPtr theString1, IntPtr theString2, int compareOptions);
|
||||
|
||||
public static int Compare (IntPtr string1, IntPtr string2, int compareOptions = 0)
|
||||
{
|
||||
return CFStringCompare (string1, string2, compareOptions);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFStringGetCharactersPtr (IntPtr handle);
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFStringGetCharacters (IntPtr handle, CFRange range, IntPtr buffer);
|
||||
|
||||
public static string AsString (IntPtr handle)
|
||||
{
|
||||
if (handle == IntPtr.Zero)
|
||||
return null;
|
||||
|
||||
int len = (int) CFStringGetLength (handle);
|
||||
|
||||
if (len == 0)
|
||||
return string.Empty;
|
||||
|
||||
IntPtr chars = CFStringGetCharactersPtr (handle);
|
||||
IntPtr buffer = IntPtr.Zero;
|
||||
|
||||
if (chars == IntPtr.Zero) {
|
||||
CFRange range = new CFRange (0, len);
|
||||
buffer = Marshal.AllocHGlobal (len * 2);
|
||||
CFStringGetCharacters (handle, range, buffer);
|
||||
chars = buffer;
|
||||
}
|
||||
|
||||
string str;
|
||||
|
||||
unsafe {
|
||||
str = new string ((char *) chars, 0, len);
|
||||
}
|
||||
|
||||
if (buffer != IntPtr.Zero)
|
||||
Marshal.FreeHGlobal (buffer);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
if (str == null)
|
||||
str = AsString (Handle);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
public static implicit operator string (CFString str)
|
||||
{
|
||||
return str.ToString ();
|
||||
}
|
||||
|
||||
public static implicit operator CFString (string str)
|
||||
{
|
||||
return Create (str);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal class CFData : CFObject
|
||||
{
|
||||
public CFData (IntPtr handle, bool own) : base (handle, own) { }
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static /* CFDataRef */ IntPtr CFDataCreate (/* CFAllocatorRef */ IntPtr allocator, /* UInt8* */ IntPtr bytes, /* CFIndex */ IntPtr length);
|
||||
public unsafe static CFData FromData (byte [] buffer)
|
||||
{
|
||||
fixed (byte* p = buffer)
|
||||
{
|
||||
return FromData ((IntPtr)p, (IntPtr)buffer.Length);
|
||||
}
|
||||
}
|
||||
|
||||
public static CFData FromData (IntPtr buffer, IntPtr length)
|
||||
{
|
||||
return new CFData (CFDataCreate (IntPtr.Zero, buffer, length), true);
|
||||
}
|
||||
|
||||
public IntPtr Length {
|
||||
get { return CFDataGetLength (Handle); }
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
internal extern static /* CFIndex */ IntPtr CFDataGetLength (/* CFDataRef */ IntPtr theData);
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
internal extern static /* UInt8* */ IntPtr CFDataGetBytePtr (/* CFDataRef */ IntPtr theData);
|
||||
|
||||
/*
|
||||
* Exposes a read-only pointer to the underlying storage.
|
||||
*/
|
||||
public IntPtr Bytes {
|
||||
get { return CFDataGetBytePtr (Handle); }
|
||||
}
|
||||
|
||||
public byte this [long idx] {
|
||||
get {
|
||||
if (idx < 0 || (ulong) idx > (ulong) Length)
|
||||
throw new ArgumentException ("idx");
|
||||
return Marshal.ReadByte (new IntPtr (Bytes.ToInt64 () + idx));
|
||||
}
|
||||
|
||||
set {
|
||||
throw new NotImplementedException ("NSData arrays can not be modified, use an NSMutableData instead");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal class CFDictionary : CFObject
|
||||
{
|
||||
static readonly IntPtr KeyCallbacks;
|
||||
static readonly IntPtr ValueCallbacks;
|
||||
|
||||
static CFDictionary ()
|
||||
{
|
||||
var handle = dlopen (CoreFoundationLibrary, 0);
|
||||
if (handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
try {
|
||||
KeyCallbacks = GetIndirect (handle, "kCFTypeDictionaryKeyCallBacks");
|
||||
ValueCallbacks = GetIndirect (handle, "kCFTypeDictionaryValueCallBacks");
|
||||
} finally {
|
||||
dlclose (handle);
|
||||
}
|
||||
}
|
||||
|
||||
public CFDictionary (IntPtr handle, bool own) : base (handle, own) { }
|
||||
|
||||
public static CFDictionary FromObjectAndKey (IntPtr obj, IntPtr key)
|
||||
{
|
||||
return new CFDictionary (CFDictionaryCreate (IntPtr.Zero, new IntPtr[] { key }, new IntPtr [] { obj }, (IntPtr)1, KeyCallbacks, ValueCallbacks), true);
|
||||
}
|
||||
|
||||
public static CFDictionary FromKeysAndObjects (IList<Tuple<IntPtr,IntPtr>> items)
|
||||
{
|
||||
var keys = new IntPtr [items.Count];
|
||||
var values = new IntPtr [items.Count];
|
||||
for (int i = 0; i < items.Count; i++) {
|
||||
keys [i] = items [i].Item1;
|
||||
values [i] = items [i].Item2;
|
||||
}
|
||||
return new CFDictionary (CFDictionaryCreate (IntPtr.Zero, keys, values, (IntPtr)items.Count, KeyCallbacks, ValueCallbacks), true);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFDictionaryCreate (IntPtr allocator, IntPtr[] keys, IntPtr[] vals, IntPtr len, IntPtr keyCallbacks, IntPtr valCallbacks);
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFDictionaryGetValue (IntPtr handle, IntPtr key);
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFDictionaryCreateCopy (IntPtr allocator, IntPtr handle);
|
||||
|
||||
public CFDictionary Copy ()
|
||||
{
|
||||
return new CFDictionary (CFDictionaryCreateCopy (IntPtr.Zero, Handle), true);
|
||||
}
|
||||
|
||||
public CFMutableDictionary MutableCopy ()
|
||||
{
|
||||
return new CFMutableDictionary (CFDictionaryCreateMutableCopy (IntPtr.Zero, IntPtr.Zero, Handle), true);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFDictionaryCreateMutableCopy (IntPtr allocator, IntPtr capacity, IntPtr theDict);
|
||||
|
||||
public IntPtr GetValue (IntPtr key)
|
||||
{
|
||||
return CFDictionaryGetValue (Handle, key);
|
||||
}
|
||||
|
||||
public IntPtr this[IntPtr key] {
|
||||
get {
|
||||
return GetValue (key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class CFMutableDictionary : CFDictionary
|
||||
{
|
||||
public CFMutableDictionary (IntPtr handle, bool own) : base (handle, own) { }
|
||||
|
||||
public void SetValue (IntPtr key, IntPtr val)
|
||||
{
|
||||
CFDictionarySetValue (Handle, key, val);
|
||||
}
|
||||
|
||||
public static CFMutableDictionary Create ()
|
||||
{
|
||||
var handle = CFDictionaryCreateMutable (IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
|
||||
if (handle == IntPtr.Zero)
|
||||
throw new InvalidOperationException ();
|
||||
return new CFMutableDictionary (handle, true);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static void CFDictionarySetValue (IntPtr handle, IntPtr key, IntPtr val);
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFDictionaryCreateMutable (IntPtr allocator, IntPtr capacity, IntPtr keyCallback, IntPtr valueCallbacks);
|
||||
|
||||
}
|
||||
|
||||
class CFBoolean : INativeObject, IDisposable {
|
||||
IntPtr handle;
|
||||
|
||||
public static readonly CFBoolean True;
|
||||
public static readonly CFBoolean False;
|
||||
|
||||
static CFBoolean ()
|
||||
{
|
||||
var handle = CFObject.dlopen (CFObject.CoreFoundationLibrary, 0);
|
||||
if (handle == IntPtr.Zero)
|
||||
return;
|
||||
try {
|
||||
True = new CFBoolean (CFObject.GetCFObjectHandle (handle, "kCFBooleanTrue"), false);
|
||||
False = new CFBoolean (CFObject.GetCFObjectHandle (handle, "kCFBooleanFalse"), false);
|
||||
}
|
||||
finally {
|
||||
CFObject.dlclose (handle);
|
||||
}
|
||||
}
|
||||
|
||||
internal CFBoolean (IntPtr handle, bool owns)
|
||||
{
|
||||
this.handle = handle;
|
||||
if (!owns)
|
||||
CFObject.CFRetain (handle);
|
||||
}
|
||||
|
||||
~CFBoolean ()
|
||||
{
|
||||
Dispose (false);
|
||||
}
|
||||
|
||||
public IntPtr Handle {
|
||||
get {
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
GC.SuppressFinalize (this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (handle != IntPtr.Zero){
|
||||
CFObject.CFRelease (handle);
|
||||
handle = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
public static implicit operator bool (CFBoolean value)
|
||||
{
|
||||
return value.Value;
|
||||
}
|
||||
|
||||
public static explicit operator CFBoolean (bool value)
|
||||
{
|
||||
return FromBoolean (value);
|
||||
}
|
||||
|
||||
public static CFBoolean FromBoolean (bool value)
|
||||
{
|
||||
return value ? True : False;
|
||||
}
|
||||
|
||||
[DllImport (CFObject.CoreFoundationLibrary)]
|
||||
[return: MarshalAs (UnmanagedType.I1)]
|
||||
extern static /* Boolean */ bool CFBooleanGetValue (/* CFBooleanRef */ IntPtr boolean);
|
||||
|
||||
public bool Value {
|
||||
get {return CFBooleanGetValue (handle);}
|
||||
}
|
||||
|
||||
public static bool GetValue (IntPtr boolean)
|
||||
{
|
||||
return CFBooleanGetValue (boolean);
|
||||
}
|
||||
}
|
||||
|
||||
internal class CFDate : INativeObject, IDisposable {
|
||||
IntPtr handle;
|
||||
|
||||
internal CFDate (IntPtr handle, bool owns)
|
||||
{
|
||||
this.handle = handle;
|
||||
if (!owns)
|
||||
CFObject.CFRetain (handle);
|
||||
}
|
||||
|
||||
~CFDate ()
|
||||
{
|
||||
Dispose (false);
|
||||
}
|
||||
|
||||
[DllImport (CFObject.CoreFoundationLibrary)]
|
||||
extern static IntPtr CFDateCreate (IntPtr allocator, /* CFAbsoluteTime */ double at);
|
||||
|
||||
public static CFDate Create (DateTime date)
|
||||
{
|
||||
var referenceTime = new DateTime (2001, 1, 1);
|
||||
var difference = (date - referenceTime).TotalSeconds;
|
||||
var handle = CFDateCreate (IntPtr.Zero, difference);
|
||||
if (handle == IntPtr.Zero)
|
||||
throw new NotSupportedException ();
|
||||
return new CFDate (handle, true);
|
||||
}
|
||||
|
||||
public IntPtr Handle {
|
||||
get {
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
GC.SuppressFinalize (this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (handle != IntPtr.Zero) {
|
||||
CFObject.CFRelease (handle);
|
||||
handle = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -75,6 +75,7 @@ namespace Mono
|
||||
|
||||
static int initialized;
|
||||
static X509PalImpl x509pal;
|
||||
static object syncRoot = new object ();
|
||||
|
||||
static void EnsureInitialized ()
|
||||
{
|
||||
@@ -83,13 +84,15 @@ namespace Mono
|
||||
* MonoTlsProviderFactory.InitializeInternal().
|
||||
*
|
||||
*/
|
||||
if (Interlocked.CompareExchange (ref initialized, 1, 0) != 0)
|
||||
return;
|
||||
lock (syncRoot) {
|
||||
if (Interlocked.CompareExchange (ref initialized, 1, 0) != 0)
|
||||
return;
|
||||
|
||||
#if MONO_FEATURE_BTLS || MONO_FEATURE_APPLETLS
|
||||
provider = MonoTlsProviderFactory.GetProvider ();
|
||||
#endif
|
||||
x509pal = GetX509Pal ();
|
||||
x509pal = GetX509Pal ();
|
||||
}
|
||||
}
|
||||
|
||||
public X509PalImpl X509Pal {
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace Mono
|
||||
class SystemDependencyProvider : ISystemDependencyProvider
|
||||
{
|
||||
static SystemDependencyProvider instance;
|
||||
static object syncRoot = new object ();
|
||||
|
||||
public static SystemDependencyProvider Instance {
|
||||
get {
|
||||
@@ -44,8 +45,12 @@ namespace Mono
|
||||
|
||||
internal static void Initialize ()
|
||||
{
|
||||
if (instance == null)
|
||||
Interlocked.CompareExchange (ref instance, new SystemDependencyProvider (), null);
|
||||
lock (syncRoot) {
|
||||
if (instance != null)
|
||||
return;
|
||||
|
||||
instance = new SystemDependencyProvider ();
|
||||
}
|
||||
}
|
||||
|
||||
ISystemCertificateProvider ISystemDependencyProvider.CertificateProvider => CertificateProvider;
|
||||
|
||||
@@ -508,9 +508,12 @@ namespace System.Diagnostics
|
||||
int size = 0;
|
||||
|
||||
for (int i = 0; i < processes.Length; i++) {
|
||||
var process = processes[i];
|
||||
try {
|
||||
if (String.Compare (processName, processes[i].ProcessName, true) == 0)
|
||||
processes [size++] = processes[i];
|
||||
if (String.Compare (processName, process.ProcessName, true) == 0)
|
||||
processes [size++] = process;
|
||||
else
|
||||
process.Dispose();
|
||||
} catch (SystemException) {
|
||||
/* The process might exit between GetProcesses_internal and GetProcessById */
|
||||
}
|
||||
@@ -687,29 +690,19 @@ namespace System.Diagnostics
|
||||
var procInfo = new ProcInfo ();
|
||||
|
||||
if (startInfo.HaveEnvVars) {
|
||||
List<string> envVariables = null;
|
||||
StringBuilder sb = null;
|
||||
List<string> envVariables = new List<string> ();
|
||||
|
||||
foreach (DictionaryEntry de in startInfo.EnvironmentVariables) {
|
||||
if (de.Value == null)
|
||||
continue;
|
||||
|
||||
if (envVariables == null)
|
||||
envVariables = new List<string> ();
|
||||
|
||||
if (sb == null)
|
||||
sb = new StringBuilder ();
|
||||
else
|
||||
sb.Clear ();
|
||||
|
||||
sb.Append ((string) de.Key);
|
||||
sb.Append ('=');
|
||||
sb.Append ((string) de.Value);
|
||||
|
||||
envVariables.Add (sb.ToString ());
|
||||
envVariables.Add (string.Concat (
|
||||
(string) de.Key,
|
||||
"=",
|
||||
(string) de.Value));
|
||||
}
|
||||
|
||||
procInfo.envVariables = envVariables?.ToArray ();
|
||||
procInfo.envVariables = envVariables.ToArray ();
|
||||
}
|
||||
|
||||
MonoIOError error;
|
||||
|
||||
@@ -380,7 +380,12 @@ namespace System.IO.Compression
|
||||
GC.SuppressFinalize (this);
|
||||
|
||||
io_buffer = null;
|
||||
|
||||
} else {
|
||||
// When we are in the finalizer we don't want to access the underlying stream anymore
|
||||
base_stream = Stream.Null;
|
||||
}
|
||||
|
||||
if (z_stream != null) {
|
||||
z_stream.Dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -946,6 +946,11 @@ namespace System.Net
|
||||
} catch {
|
||||
// Ignore; we report the timeout.
|
||||
}
|
||||
#pragma warning disable 4014
|
||||
// Make sure the workerTask's Exception is actually observed.
|
||||
// Fixes https://github.com/mono/mono/issues/10488.
|
||||
workerTask.ContinueWith (t => t.Exception?.GetHashCode (), TaskContinuationOptions.OnlyOnFaulted);
|
||||
#pragma warning restore 4014
|
||||
throw new WebException (SR.net_timeout, WebExceptionStatus.Timeout);
|
||||
} catch (Exception ex) {
|
||||
throw GetWebException (ex, aborted ());
|
||||
|
||||
@@ -33,264 +33,6 @@ using ObjCRuntimeInternal;
|
||||
|
||||
namespace Mono.Net
|
||||
{
|
||||
internal class CFType {
|
||||
[DllImport (CFObject.CoreFoundationLibrary, EntryPoint="CFGetTypeID")]
|
||||
public static extern IntPtr GetTypeID (IntPtr typeRef);
|
||||
}
|
||||
|
||||
internal class CFObject : IDisposable, INativeObject
|
||||
{
|
||||
public const string CoreFoundationLibrary = "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation";
|
||||
const string SystemLibrary = "/usr/lib/libSystem.dylib";
|
||||
|
||||
[DllImport (SystemLibrary)]
|
||||
public static extern IntPtr dlopen (string path, int mode);
|
||||
|
||||
[DllImport (SystemLibrary)]
|
||||
static extern IntPtr dlsym (IntPtr handle, string symbol);
|
||||
|
||||
[DllImport (SystemLibrary)]
|
||||
public static extern void dlclose (IntPtr handle);
|
||||
|
||||
public static IntPtr GetIndirect (IntPtr handle, string symbol)
|
||||
{
|
||||
return dlsym (handle, symbol);
|
||||
}
|
||||
|
||||
public static CFString GetStringConstant (IntPtr handle, string symbol)
|
||||
{
|
||||
var indirect = dlsym (handle, symbol);
|
||||
if (indirect == IntPtr.Zero)
|
||||
return null;
|
||||
var actual = Marshal.ReadIntPtr (indirect);
|
||||
if (actual == IntPtr.Zero)
|
||||
return null;
|
||||
return new CFString (actual, false);
|
||||
}
|
||||
|
||||
public static IntPtr GetIntPtr (IntPtr handle, string symbol)
|
||||
{
|
||||
var indirect = dlsym (handle, symbol);
|
||||
if (indirect == IntPtr.Zero)
|
||||
return IntPtr.Zero;
|
||||
return Marshal.ReadIntPtr (indirect);
|
||||
}
|
||||
|
||||
public static IntPtr GetCFObjectHandle (IntPtr handle, string symbol)
|
||||
{
|
||||
var indirect = dlsym (handle, symbol);
|
||||
if (indirect == IntPtr.Zero)
|
||||
return IntPtr.Zero;
|
||||
|
||||
return Marshal.ReadIntPtr (indirect);
|
||||
}
|
||||
|
||||
public CFObject (IntPtr handle, bool own)
|
||||
{
|
||||
Handle = handle;
|
||||
|
||||
if (!own)
|
||||
Retain ();
|
||||
}
|
||||
|
||||
~CFObject ()
|
||||
{
|
||||
Dispose (false);
|
||||
}
|
||||
|
||||
public IntPtr Handle { get; private set; }
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
internal extern static IntPtr CFRetain (IntPtr handle);
|
||||
|
||||
void Retain ()
|
||||
{
|
||||
CFRetain (Handle);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
internal extern static void CFRelease (IntPtr handle);
|
||||
|
||||
void Release ()
|
||||
{
|
||||
CFRelease (Handle);
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (Handle != IntPtr.Zero) {
|
||||
Release ();
|
||||
Handle = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
GC.SuppressFinalize (this);
|
||||
}
|
||||
}
|
||||
|
||||
internal class CFArray : CFObject
|
||||
{
|
||||
public CFArray (IntPtr handle, bool own) : base (handle, own) { }
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFArrayCreate (IntPtr allocator, IntPtr values, /* CFIndex */ IntPtr numValues, IntPtr callbacks);
|
||||
static readonly IntPtr kCFTypeArrayCallbacks;
|
||||
|
||||
static CFArray ()
|
||||
{
|
||||
var handle = dlopen (CoreFoundationLibrary, 0);
|
||||
if (handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
try {
|
||||
kCFTypeArrayCallbacks = GetIndirect (handle, "kCFTypeArrayCallBacks");
|
||||
} finally {
|
||||
dlclose (handle);
|
||||
}
|
||||
}
|
||||
|
||||
public static CFArray FromNativeObjects (params INativeObject[] values)
|
||||
{
|
||||
return new CFArray (Create (values), true);
|
||||
}
|
||||
|
||||
public static unsafe IntPtr Create (params IntPtr[] values)
|
||||
{
|
||||
if (values == null)
|
||||
throw new ArgumentNullException ("values");
|
||||
fixed (IntPtr* pv = values) {
|
||||
return CFArrayCreate (IntPtr.Zero, (IntPtr) pv, (IntPtr)values.Length, kCFTypeArrayCallbacks);
|
||||
}
|
||||
}
|
||||
|
||||
internal static unsafe CFArray CreateArray (params IntPtr[] values)
|
||||
{
|
||||
if (values == null)
|
||||
throw new ArgumentNullException ("values");
|
||||
|
||||
fixed (IntPtr *pv = values) {
|
||||
IntPtr handle = CFArrayCreate (IntPtr.Zero, (IntPtr) pv, (IntPtr) values.Length, kCFTypeArrayCallbacks);
|
||||
|
||||
return new CFArray (handle, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static CFArray CreateArray (params INativeObject[] values)
|
||||
{
|
||||
return new CFArray (Create (values), true);
|
||||
}
|
||||
|
||||
public static IntPtr Create (params INativeObject[] values)
|
||||
{
|
||||
if (values == null)
|
||||
throw new ArgumentNullException ("values");
|
||||
IntPtr[] _values = new IntPtr [values.Length];
|
||||
for (int i = 0; i < _values.Length; ++i)
|
||||
_values [i] = values [i].Handle;
|
||||
return Create (_values);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static /* CFIndex */ IntPtr CFArrayGetCount (IntPtr handle);
|
||||
|
||||
public int Count {
|
||||
get { return (int) CFArrayGetCount (Handle); }
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFArrayGetValueAtIndex (IntPtr handle, /* CFIndex */ IntPtr index);
|
||||
|
||||
public IntPtr this[int index] {
|
||||
get {
|
||||
return CFArrayGetValueAtIndex (Handle, (IntPtr) index);
|
||||
}
|
||||
}
|
||||
|
||||
static public T [] ArrayFromHandle<T> (IntPtr handle, Func<IntPtr, T> creation) where T : class, INativeObject
|
||||
{
|
||||
if (handle == IntPtr.Zero)
|
||||
return null;
|
||||
|
||||
var c = CFArrayGetCount (handle);
|
||||
T [] ret = new T [(int)c];
|
||||
|
||||
for (uint i = 0; i < (uint)c; i++) {
|
||||
ret [i] = creation (CFArrayGetValueAtIndex (handle, (IntPtr)i));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
internal class CFNumber : CFObject
|
||||
{
|
||||
public CFNumber (IntPtr handle, bool own) : base (handle, own) { }
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
[return: MarshalAs (UnmanagedType.I1)]
|
||||
extern static bool CFNumberGetValue (IntPtr handle, /* CFNumberType */ IntPtr type, [MarshalAs (UnmanagedType.I1)] out bool value);
|
||||
|
||||
public static bool AsBool (IntPtr handle)
|
||||
{
|
||||
bool value;
|
||||
|
||||
if (handle == IntPtr.Zero)
|
||||
return false;
|
||||
|
||||
CFNumberGetValue (handle, (IntPtr) 1, out value);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static implicit operator bool (CFNumber number)
|
||||
{
|
||||
return AsBool (number.Handle);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
[return: MarshalAs (UnmanagedType.I1)]
|
||||
extern static bool CFNumberGetValue (IntPtr handle, /* CFNumberType */ IntPtr type, out int value);
|
||||
|
||||
public static int AsInt32 (IntPtr handle)
|
||||
{
|
||||
int value;
|
||||
|
||||
if (handle == IntPtr.Zero)
|
||||
return 0;
|
||||
|
||||
// 9 == kCFNumberIntType == C int
|
||||
CFNumberGetValue (handle, (IntPtr) 9, out value);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFNumberCreate (IntPtr allocator, IntPtr theType, IntPtr valuePtr);
|
||||
|
||||
public static CFNumber FromInt32 (int number)
|
||||
{
|
||||
// 9 == kCFNumberIntType == C int
|
||||
return new CFNumber (CFNumberCreate (IntPtr.Zero, (IntPtr)9, (IntPtr)number), true);
|
||||
}
|
||||
|
||||
public static implicit operator int (CFNumber number)
|
||||
{
|
||||
return AsInt32 (number.Handle);
|
||||
}
|
||||
}
|
||||
|
||||
internal struct CFRange {
|
||||
public IntPtr Location, Length;
|
||||
|
||||
public CFRange (int loc, int len)
|
||||
{
|
||||
Location = (IntPtr) loc;
|
||||
Length = (IntPtr) len;
|
||||
}
|
||||
}
|
||||
|
||||
internal struct CFStreamClientContext {
|
||||
public IntPtr Version;
|
||||
public IntPtr Info;
|
||||
@@ -299,255 +41,6 @@ namespace Mono.Net
|
||||
public IntPtr CopyDescription;
|
||||
}
|
||||
|
||||
internal class CFString : CFObject
|
||||
{
|
||||
string str;
|
||||
|
||||
public CFString (IntPtr handle, bool own) : base (handle, own) { }
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFStringCreateWithCharacters (IntPtr alloc, IntPtr chars, /* CFIndex */ IntPtr length);
|
||||
|
||||
public static CFString Create (string value)
|
||||
{
|
||||
IntPtr handle;
|
||||
|
||||
unsafe {
|
||||
fixed (char *ptr = value) {
|
||||
handle = CFStringCreateWithCharacters (IntPtr.Zero, (IntPtr) ptr, (IntPtr) value.Length);
|
||||
}
|
||||
}
|
||||
|
||||
if (handle == IntPtr.Zero)
|
||||
return null;
|
||||
|
||||
return new CFString (handle, true);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static /* CFIndex */ IntPtr CFStringGetLength (IntPtr handle);
|
||||
|
||||
public int Length {
|
||||
get {
|
||||
if (str != null)
|
||||
return str.Length;
|
||||
|
||||
return (int) CFStringGetLength (Handle);
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static int CFStringCompare (IntPtr theString1, IntPtr theString2, int compareOptions);
|
||||
|
||||
public static int Compare (IntPtr string1, IntPtr string2, int compareOptions = 0)
|
||||
{
|
||||
return CFStringCompare (string1, string2, compareOptions);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFStringGetCharactersPtr (IntPtr handle);
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFStringGetCharacters (IntPtr handle, CFRange range, IntPtr buffer);
|
||||
|
||||
public static string AsString (IntPtr handle)
|
||||
{
|
||||
if (handle == IntPtr.Zero)
|
||||
return null;
|
||||
|
||||
int len = (int) CFStringGetLength (handle);
|
||||
|
||||
if (len == 0)
|
||||
return string.Empty;
|
||||
|
||||
IntPtr chars = CFStringGetCharactersPtr (handle);
|
||||
IntPtr buffer = IntPtr.Zero;
|
||||
|
||||
if (chars == IntPtr.Zero) {
|
||||
CFRange range = new CFRange (0, len);
|
||||
buffer = Marshal.AllocHGlobal (len * 2);
|
||||
CFStringGetCharacters (handle, range, buffer);
|
||||
chars = buffer;
|
||||
}
|
||||
|
||||
string str;
|
||||
|
||||
unsafe {
|
||||
str = new string ((char *) chars, 0, len);
|
||||
}
|
||||
|
||||
if (buffer != IntPtr.Zero)
|
||||
Marshal.FreeHGlobal (buffer);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
if (str == null)
|
||||
str = AsString (Handle);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
public static implicit operator string (CFString str)
|
||||
{
|
||||
return str.ToString ();
|
||||
}
|
||||
|
||||
public static implicit operator CFString (string str)
|
||||
{
|
||||
return Create (str);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal class CFData : CFObject
|
||||
{
|
||||
public CFData (IntPtr handle, bool own) : base (handle, own) { }
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static /* CFDataRef */ IntPtr CFDataCreate (/* CFAllocatorRef */ IntPtr allocator, /* UInt8* */ IntPtr bytes, /* CFIndex */ IntPtr length);
|
||||
public unsafe static CFData FromData (byte [] buffer)
|
||||
{
|
||||
fixed (byte* p = buffer)
|
||||
{
|
||||
return FromData ((IntPtr)p, (IntPtr)buffer.Length);
|
||||
}
|
||||
}
|
||||
|
||||
public static CFData FromData (IntPtr buffer, IntPtr length)
|
||||
{
|
||||
return new CFData (CFDataCreate (IntPtr.Zero, buffer, length), true);
|
||||
}
|
||||
|
||||
public IntPtr Length {
|
||||
get { return CFDataGetLength (Handle); }
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
internal extern static /* CFIndex */ IntPtr CFDataGetLength (/* CFDataRef */ IntPtr theData);
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
internal extern static /* UInt8* */ IntPtr CFDataGetBytePtr (/* CFDataRef */ IntPtr theData);
|
||||
|
||||
/*
|
||||
* Exposes a read-only pointer to the underlying storage.
|
||||
*/
|
||||
public IntPtr Bytes {
|
||||
get { return CFDataGetBytePtr (Handle); }
|
||||
}
|
||||
|
||||
public byte this [long idx] {
|
||||
get {
|
||||
if (idx < 0 || (ulong) idx > (ulong) Length)
|
||||
throw new ArgumentException ("idx");
|
||||
return Marshal.ReadByte (new IntPtr (Bytes.ToInt64 () + idx));
|
||||
}
|
||||
|
||||
set {
|
||||
throw new NotImplementedException ("NSData arrays can not be modified, use an NSMutableData instead");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal class CFDictionary : CFObject
|
||||
{
|
||||
static readonly IntPtr KeyCallbacks;
|
||||
static readonly IntPtr ValueCallbacks;
|
||||
|
||||
static CFDictionary ()
|
||||
{
|
||||
var handle = dlopen (CoreFoundationLibrary, 0);
|
||||
if (handle == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
try {
|
||||
KeyCallbacks = GetIndirect (handle, "kCFTypeDictionaryKeyCallBacks");
|
||||
ValueCallbacks = GetIndirect (handle, "kCFTypeDictionaryValueCallBacks");
|
||||
} finally {
|
||||
dlclose (handle);
|
||||
}
|
||||
}
|
||||
|
||||
public CFDictionary (IntPtr handle, bool own) : base (handle, own) { }
|
||||
|
||||
public static CFDictionary FromObjectAndKey (IntPtr obj, IntPtr key)
|
||||
{
|
||||
return new CFDictionary (CFDictionaryCreate (IntPtr.Zero, new IntPtr[] { key }, new IntPtr [] { obj }, (IntPtr)1, KeyCallbacks, ValueCallbacks), true);
|
||||
}
|
||||
|
||||
public static CFDictionary FromKeysAndObjects (IList<Tuple<IntPtr,IntPtr>> items)
|
||||
{
|
||||
var keys = new IntPtr [items.Count];
|
||||
var values = new IntPtr [items.Count];
|
||||
for (int i = 0; i < items.Count; i++) {
|
||||
keys [i] = items [i].Item1;
|
||||
values [i] = items [i].Item2;
|
||||
}
|
||||
return new CFDictionary (CFDictionaryCreate (IntPtr.Zero, keys, values, (IntPtr)items.Count, KeyCallbacks, ValueCallbacks), true);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFDictionaryCreate (IntPtr allocator, IntPtr[] keys, IntPtr[] vals, IntPtr len, IntPtr keyCallbacks, IntPtr valCallbacks);
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFDictionaryGetValue (IntPtr handle, IntPtr key);
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFDictionaryCreateCopy (IntPtr allocator, IntPtr handle);
|
||||
|
||||
public CFDictionary Copy ()
|
||||
{
|
||||
return new CFDictionary (CFDictionaryCreateCopy (IntPtr.Zero, Handle), true);
|
||||
}
|
||||
|
||||
public CFMutableDictionary MutableCopy ()
|
||||
{
|
||||
return new CFMutableDictionary (CFDictionaryCreateMutableCopy (IntPtr.Zero, IntPtr.Zero, Handle), true);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFDictionaryCreateMutableCopy (IntPtr allocator, IntPtr capacity, IntPtr theDict);
|
||||
|
||||
public IntPtr GetValue (IntPtr key)
|
||||
{
|
||||
return CFDictionaryGetValue (Handle, key);
|
||||
}
|
||||
|
||||
public IntPtr this[IntPtr key] {
|
||||
get {
|
||||
return GetValue (key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class CFMutableDictionary : CFDictionary
|
||||
{
|
||||
public CFMutableDictionary (IntPtr handle, bool own) : base (handle, own) { }
|
||||
|
||||
public void SetValue (IntPtr key, IntPtr val)
|
||||
{
|
||||
CFDictionarySetValue (Handle, key, val);
|
||||
}
|
||||
|
||||
public static CFMutableDictionary Create ()
|
||||
{
|
||||
var handle = CFDictionaryCreateMutable (IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
|
||||
if (handle == IntPtr.Zero)
|
||||
throw new InvalidOperationException ();
|
||||
return new CFMutableDictionary (handle, true);
|
||||
}
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static void CFDictionarySetValue (IntPtr handle, IntPtr key, IntPtr val);
|
||||
|
||||
[DllImport (CoreFoundationLibrary)]
|
||||
extern static IntPtr CFDictionaryCreateMutable (IntPtr allocator, IntPtr capacity, IntPtr keyCallback, IntPtr valueCallbacks);
|
||||
|
||||
}
|
||||
|
||||
internal class CFUrl : CFObject
|
||||
{
|
||||
public CFUrl (IntPtr handle, bool own) : base (handle, own) { }
|
||||
@@ -1287,135 +780,4 @@ namespace Mono.Net
|
||||
}
|
||||
}
|
||||
|
||||
class CFBoolean : INativeObject, IDisposable {
|
||||
IntPtr handle;
|
||||
|
||||
public static readonly CFBoolean True;
|
||||
public static readonly CFBoolean False;
|
||||
|
||||
static CFBoolean ()
|
||||
{
|
||||
var handle = CFObject.dlopen (CFObject.CoreFoundationLibrary, 0);
|
||||
if (handle == IntPtr.Zero)
|
||||
return;
|
||||
try {
|
||||
True = new CFBoolean (CFObject.GetCFObjectHandle (handle, "kCFBooleanTrue"), false);
|
||||
False = new CFBoolean (CFObject.GetCFObjectHandle (handle, "kCFBooleanFalse"), false);
|
||||
}
|
||||
finally {
|
||||
CFObject.dlclose (handle);
|
||||
}
|
||||
}
|
||||
|
||||
internal CFBoolean (IntPtr handle, bool owns)
|
||||
{
|
||||
this.handle = handle;
|
||||
if (!owns)
|
||||
CFObject.CFRetain (handle);
|
||||
}
|
||||
|
||||
~CFBoolean ()
|
||||
{
|
||||
Dispose (false);
|
||||
}
|
||||
|
||||
public IntPtr Handle {
|
||||
get {
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
GC.SuppressFinalize (this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (handle != IntPtr.Zero){
|
||||
CFObject.CFRelease (handle);
|
||||
handle = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
public static implicit operator bool (CFBoolean value)
|
||||
{
|
||||
return value.Value;
|
||||
}
|
||||
|
||||
public static explicit operator CFBoolean (bool value)
|
||||
{
|
||||
return FromBoolean (value);
|
||||
}
|
||||
|
||||
public static CFBoolean FromBoolean (bool value)
|
||||
{
|
||||
return value ? True : False;
|
||||
}
|
||||
|
||||
[DllImport (CFObject.CoreFoundationLibrary)]
|
||||
[return: MarshalAs (UnmanagedType.I1)]
|
||||
extern static /* Boolean */ bool CFBooleanGetValue (/* CFBooleanRef */ IntPtr boolean);
|
||||
|
||||
public bool Value {
|
||||
get {return CFBooleanGetValue (handle);}
|
||||
}
|
||||
|
||||
public static bool GetValue (IntPtr boolean)
|
||||
{
|
||||
return CFBooleanGetValue (boolean);
|
||||
}
|
||||
}
|
||||
|
||||
internal class CFDate : INativeObject, IDisposable {
|
||||
IntPtr handle;
|
||||
|
||||
internal CFDate (IntPtr handle, bool owns)
|
||||
{
|
||||
this.handle = handle;
|
||||
if (!owns)
|
||||
CFObject.CFRetain (handle);
|
||||
}
|
||||
|
||||
~CFDate ()
|
||||
{
|
||||
Dispose (false);
|
||||
}
|
||||
|
||||
[DllImport (CFObject.CoreFoundationLibrary)]
|
||||
extern static IntPtr CFDateCreate (IntPtr allocator, /* CFAbsoluteTime */ double at);
|
||||
|
||||
public static CFDate Create (DateTime date)
|
||||
{
|
||||
var referenceTime = new DateTime (2001, 1, 1);
|
||||
var difference = (date - referenceTime).TotalSeconds;
|
||||
var handle = CFDateCreate (IntPtr.Zero, difference);
|
||||
if (handle == IntPtr.Zero)
|
||||
throw new NotSupportedException ();
|
||||
return new CFDate (handle, true);
|
||||
}
|
||||
|
||||
public IntPtr Handle {
|
||||
get {
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
Dispose (true);
|
||||
GC.SuppressFinalize (this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (handle != IntPtr.Zero) {
|
||||
CFObject.CFRelease (handle);
|
||||
handle = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -405,6 +405,7 @@ namespace System.Net
|
||||
void CloseSocket ()
|
||||
{
|
||||
lock (this) {
|
||||
Debug ($"WC CLOSE SOCKET: Cnc={ID} NS={networkStream} TLS={monoTlsStream}");
|
||||
if (networkStream != null) {
|
||||
try {
|
||||
networkStream.Dispose ();
|
||||
@@ -412,6 +413,13 @@ namespace System.Net
|
||||
networkStream = null;
|
||||
}
|
||||
|
||||
if (monoTlsStream != null) {
|
||||
try {
|
||||
monoTlsStream.Dispose ();
|
||||
} catch { }
|
||||
monoTlsStream = null;
|
||||
}
|
||||
|
||||
if (socket != null) {
|
||||
try {
|
||||
socket.Dispose ();
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace System.Net
|
||||
}
|
||||
|
||||
#if MONO_WEB_DEBUG
|
||||
internal string ME => $"WRS({GetType ().Name}:Op={operation.ID})";
|
||||
internal string ME => $"WRS({GetType ().Name}:Op={Operation.ID})";
|
||||
#else
|
||||
internal string ME => null;
|
||||
#endif
|
||||
|
||||
@@ -309,7 +309,7 @@ namespace System.Net
|
||||
break;
|
||||
ms.Write (buffer, 0, ret);
|
||||
}
|
||||
return ms.GetBuffer ();
|
||||
return ms.ToArray ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,8 @@ namespace System.Security.Cryptography.X509Certificates
|
||||
|
||||
public abstract bool Build (X509Certificate2 certificate);
|
||||
|
||||
public abstract void AddStatus (X509ChainStatusFlags errorCode);
|
||||
|
||||
public abstract void Reset ();
|
||||
|
||||
public void Dispose ()
|
||||
|
||||
@@ -110,6 +110,10 @@ namespace System.Security.Cryptography.X509Certificates {
|
||||
|
||||
// methods
|
||||
|
||||
public override void AddStatus (X509ChainStatusFlags error)
|
||||
{
|
||||
}
|
||||
|
||||
[MonoTODO ("Not totally RFC3280 compliant, but neither is MS implementation...")]
|
||||
public override bool Build (X509Certificate2 certificate)
|
||||
{
|
||||
|
||||
@@ -47,12 +47,12 @@
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_watch' ">
|
||||
<OutputPath>./../../class/lib/monotouch_watch</OutputPath>
|
||||
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-monotouch_watch</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH;COREFX;CONFIGURATION_2_0;XML_DEP;SECURITY_DEP;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;INSIDE_SYSTEM</DefineConstants>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FULL_AOT_RUNTIME;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH;COREFX;CONFIGURATION_2_0;XML_DEP;SECURITY_DEP;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;INSIDE_SYSTEM;MONO_FEATURE_APPLE_X509</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_watch_runtime' ">
|
||||
<OutputPath>./../../class/lib/monotouch_watch_runtime</OutputPath>
|
||||
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-monotouch_watch_runtime</IntermediateOutputPath>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH;COREFX;CONFIGURATION_2_0;XML_DEP;SECURITY_DEP;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_MULTIPLE_APPDOMAINS;INSIDE_SYSTEM</DefineConstants>
|
||||
<DefineConstants>NET_1_1;NET_2_0;NET_2_1;NET_3_5;NET_4_0;NET_4_5;MOBILE;MOBILE_LEGACY;MONO;MONOTOUCH;DISABLE_REMOTING;DISABLE_COM;FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK;FEATURE_NO_BSD_SOCKETS;MONOTOUCH_WATCH;COREFX;CONFIGURATION_2_0;XML_DEP;SECURITY_DEP;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_MULTIPLE_APPDOMAINS;INSIDE_SYSTEM;MONO_FEATURE_APPLE_X509</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'monotouch_tv' ">
|
||||
<OutputPath>./../../class/lib/monotouch_tv</OutputPath>
|
||||
@@ -802,6 +802,7 @@
|
||||
<Compile Include="Mono.Btls\X509PalImpl.Btls.cs" />
|
||||
<Compile Include="Mono.Util\MonoPInvokeCallbackAttribute.cs" />
|
||||
<Compile Include="MonoTouch\Dummy.cs" />
|
||||
<Compile Include="Mono\AppleTypes.cs" />
|
||||
<Compile Include="Mono\SystemCertificateProvider.cs" />
|
||||
<Compile Include="Mono\SystemDependencyProvider.cs" />
|
||||
<Compile Include="Mono\X509Pal.cs" />
|
||||
@@ -1324,6 +1325,13 @@
|
||||
<Compile Include="..\..\..\external\corefx\src\System.IO.FileSystem.Watcher\src\System\IO\FileSystemWatcher.UnknownUnix.cs" />
|
||||
<Compile Include="..\Mono.Security\Mono.Security.X509.Extensions\AuthorityKeyIdentifierExtension.cs" />
|
||||
<Compile Include="Internal.Cryptography\OidLookup.Managed.cs" />
|
||||
<Compile Include="Mono.AppleTls\Enums.cs" />
|
||||
<Compile Include="Mono.AppleTls\MonoCertificatePal.Mobile.cs" />
|
||||
<Compile Include="Mono.AppleTls\MonoCertificatePal.cs" />
|
||||
<Compile Include="Mono.AppleTls\SafeHandles.Mono.cs" />
|
||||
<Compile Include="Mono.AppleTls\SafeHandles.cs" />
|
||||
<Compile Include="Mono.AppleTls\X509CertificateImplApple.cs" />
|
||||
<Compile Include="Mono.AppleTls\X509PalImpl.Apple.cs" />
|
||||
<Compile Include="System.Net.Mail\SmtpClient.platformnotsupported.cs" />
|
||||
<Compile Include="System.Net.NetworkInformation\LinuxIPInterfaceProperties.cs" />
|
||||
<Compile Include="System.Net.NetworkInformation\LinuxIPv4InterfaceProperties.cs" />
|
||||
|
||||
@@ -732,6 +732,53 @@ namespace MonoTests.System.Diagnostics
|
||||
|
||||
public int bytesRead = -1;
|
||||
|
||||
[Test]
|
||||
[NUnit.Framework.Category ("MobileNotWorking")]
|
||||
public void TestEnvironmentVariablesClearedDoNotInherit ()
|
||||
{
|
||||
if (!RunningOnUnix)
|
||||
Assert.Ignore ("env not available on Windows");
|
||||
|
||||
var stdout = new StringBuilder ();
|
||||
|
||||
Process p = new Process ();
|
||||
p.StartInfo = new ProcessStartInfo ("/usr/bin/env");
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
p.OutputDataReceived += (s, e) => { if (e.Data != null) stdout.AppendLine (e.Data); };
|
||||
p.StartInfo.Environment.Clear (); // i.e. don't inherit
|
||||
p.StartInfo.Environment["HELLO"] = "123";
|
||||
|
||||
p.Start ();
|
||||
p.BeginOutputReadLine ();
|
||||
p.WaitForExit ();
|
||||
|
||||
Assert.AreEqual ("HELLO=123\n", stdout.ToString ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
[NUnit.Framework.Category ("MobileNotWorking")]
|
||||
public void TestEnvironmentVariablesClearedDoNotInheritEmpty ()
|
||||
{
|
||||
if (!RunningOnUnix)
|
||||
Assert.Ignore ("env not available on Windows");
|
||||
|
||||
var stdout = new StringBuilder ();
|
||||
|
||||
Process p = new Process ();
|
||||
p.StartInfo = new ProcessStartInfo ("/usr/bin/env");
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
p.OutputDataReceived += (s, e) => { if (e.Data != null) stdout.AppendLine (e.Data); };
|
||||
p.StartInfo.Environment.Clear (); // i.e. don't inherit
|
||||
|
||||
p.Start ();
|
||||
p.BeginOutputReadLine ();
|
||||
p.WaitForExit ();
|
||||
|
||||
Assert.AreEqual ("", stdout.ToString ());
|
||||
}
|
||||
|
||||
[Test]
|
||||
[NUnit.Framework.Category ("MobileNotWorking")]
|
||||
// This was for bug #459450
|
||||
|
||||
@@ -480,6 +480,61 @@ namespace MonoTests.System.IO.Compression
|
||||
|
||||
Assert.AreEqual(125387, byteCount);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Issue10054_ZeroRead()
|
||||
{
|
||||
// "HelloWorld" as UTF8/DeflateStream(...,CompressionMode.Compress)
|
||||
var buffer = new byte[] { 243, 72, 205, 201, 201, 15, 207, 47, 202, 73, 1, 0 };
|
||||
var mem = new MemoryStream(buffer);
|
||||
var chu = new ChunkedReader(mem);
|
||||
var def = new DeflateStream(chu, CompressionMode.Decompress);
|
||||
|
||||
var buffer2 = new byte[4096];
|
||||
int read2 = 0;
|
||||
|
||||
chu.limit = 3;
|
||||
read2 += def.Read(buffer2, read2, buffer2.Length - read2);
|
||||
chu.limit = 100;
|
||||
read2 += def.Read(buffer2, read2, buffer2.Length - read2);
|
||||
|
||||
var res = Encoding.UTF8.GetString(buffer2, 0, read2);
|
||||
Assert.AreEqual("HelloWorld", res);
|
||||
}
|
||||
|
||||
public class ChunkedReader : Stream
|
||||
{
|
||||
public int limit = 0;
|
||||
private Stream baseStream;
|
||||
|
||||
public ChunkedReader(Stream baseStream)
|
||||
{
|
||||
this.baseStream = baseStream;
|
||||
}
|
||||
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
int read = baseStream.Read(buffer, offset, Math.Min(count, this.limit));
|
||||
this.limit -= read;
|
||||
return read;
|
||||
}
|
||||
|
||||
public override void Flush() => baseStream.Flush();
|
||||
public override long Seek(long offset, SeekOrigin origin) => baseStream.Seek(offset, origin);
|
||||
public override void SetLength(long value) => baseStream.SetLength(value);
|
||||
public override void Write(byte[] buffer, int offset, int count) => baseStream.Write(buffer, offset, count);
|
||||
|
||||
public override bool CanRead => baseStream.CanRead;
|
||||
public override bool CanSeek => baseStream.CanSeek;
|
||||
public override bool CanWrite => baseStream.CanWrite;
|
||||
public override long Length => baseStream.Length;
|
||||
|
||||
public override long Position
|
||||
{
|
||||
get => baseStream.Position;
|
||||
set => baseStream.Position = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
Mono.AppleTls/Enums.cs
|
||||
Mono.AppleTls/X509CertificateImplApple.cs
|
||||
Mono.AppleTls/X509PalImpl.Apple.cs
|
||||
|
||||
Mono.AppleTls/MonoCertificatePal.cs
|
||||
Mono.AppleTls/SafeHandles.Mono.cs
|
||||
Loaded 100 of 397 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user