2004-09-30 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Thu, 30 Sep 2004 10:06:42 +0000 (10:06 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 30 Sep 2004 10:06:42 +0000 (10:06 -0000)
* marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.

* marshal.c: Fix warnings.

svn path=/trunk/mono/; revision=34551

mono/metadata/ChangeLog
mono/metadata/icall.c
mono/metadata/marshal.c
mono/metadata/marshal.h

index 176bd3e3acf71be2d4a6080a08d663f34d74be69..f9413116af6640eaa6118d2eb30b2d45c870a421 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
+
+       * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
+
+       * marshal.c: Fix warnings.
+
 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
 
        * marshal.c (mono_ftnptr_to_delegate): This method was improperly
index fab4ce15f23670821c48777e3daa54f04d06a3a3..db1fd6c7604bd722bda1650f5f1369009264cd3f 100644 (file)
@@ -6101,6 +6101,7 @@ static const IcallEntry marshal_icalls [] = {
        {"FreeCoTaskMem", ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem},
        {"FreeHGlobal", ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal},
        {"GetFunctionPointerForDelegateInternal", mono_delegate_to_ftnptr},
+       {"GetDelegateForFunctionPointerInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal},
        {"GetLastWin32Error", ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error},
        {"OffsetOf", ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf},
        {"Prelink", ves_icall_System_Runtime_InteropServices_Marshal_Prelink},
index 8506097978d100624f1f7a49a6ba6a9c2f0941a2..e100abf89d6df83ff400f085952cd1a143918382 100644 (file)
@@ -191,11 +191,11 @@ mono_delegate_to_ftnptr (MonoDelegate *delegate)
 static GHashTable *delegate_hash_table;
 
 static GHashTable *
-delegate_hash_table_new () {
+delegate_hash_table_new (void) {
        return g_hash_table_new (NULL, NULL);
 }
 
-void 
+static void 
 delegate_hash_table_remove (MonoDelegate *d)
 {
        EnterCriticalSection (&marshal_mutex);
@@ -6147,6 +6147,12 @@ ves_icall_System_Runtime_InteropServices_Marshal_UnsafeAddrOfPinnedArrayElement
        return mono_array_addr_with_size (arrayobj, mono_array_element_size (arrayobj->obj.vtable->klass), index);
 }
 
+MonoDelegate*
+ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (MonoReflectionType *type, void *ftn)
+{
+       return mono_ftnptr_to_delegate (mono_type_get_class (type->type), ftn);
+}
+
 MonoMarshalType *
 mono_marshal_load_type_info (MonoClass* klass)
 {
index aa58fb755d8b7b2aab3eb86ac09eaa4cc2614f68..7986b63b6e29329b855705734d1e21bd3fde7abf 100644 (file)
@@ -324,5 +324,8 @@ ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal (void *ptr);
 void*
 ves_icall_System_Runtime_InteropServices_Marshal_UnsafeAddrOfPinnedArrayElement (MonoArray *arrayobj, int index);
 
+MonoDelegate*
+ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal (MonoReflectionType *type, void *ftn);
+
 #endif /* __MONO_MARSHAL_H__ */