@@ -55,6 +55,7 @@ static GitOdbBackend()
5555/// <param name="backend">[in] A pointer to the backend which is being asked to perform the task.</param>
5656/// <param name="oid">[in] The OID which the backend is being asked to look up.</param>
5757/// <returns>0 if successful; an error code otherwise.</returns>
58+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
5859public delegate int read_callback (
5960out IntPtr buffer_p ,
6061out UIntPtr len_p ,
@@ -77,6 +78,7 @@ public delegate int read_callback(
7778/// <param name="short_oid">[in] The short-form OID which the backend is being asked to look up.</param>
7879/// <param name="len">[in] The length of the short-form OID (short_oid).</param>
7980/// <returns>0 if successful; an error code otherwise.</returns>
81+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
8082public delegate int read_prefix_callback (
8183out GitOid out_oid ,
8284out IntPtr buffer_p ,
@@ -95,6 +97,7 @@ public delegate int read_prefix_callback(
9597/// <param name="backend">[in] A pointer to the backend which is being asked to perform the task.</param>
9698/// <param name="oid">[in] The OID which the backend is being asked to look up.</param>
9799/// <returns>0 if successful; an error code otherwise.</returns>
100+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
98101public delegate int read_header_callback (
99102out UIntPtr len_p ,
100103out GitObjectType type_p ,
@@ -111,6 +114,7 @@ public delegate int read_header_callback(
111114/// <param name="len">[in] The length of the buffer pointed to by data.</param>
112115/// <param name="type">[in] The type of the object.</param>
113116/// <returns>0 if successful; an error code otherwise.</returns>
117+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
114118public delegate int write_callback (
115119IntPtr backend ,
116120ref GitOid oid ,
@@ -128,6 +132,7 @@ public delegate int write_callback(
128132/// <param name="length">[in] The length of the object's contents.</param>
129133/// <param name="type">[in] The type of the object being written.</param>
130134/// <returns>0 if successful; an error code otherwise.</returns>
135+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
131136public delegate int writestream_callback (
132137out IntPtr stream_out ,
133138IntPtr backend ,
@@ -142,6 +147,7 @@ public delegate int writestream_callback(
142147/// <param name="backend">[in] A pointer to the backend which is being asked to perform the task.</param>
143148/// <param name="oid">[in] The object ID that the caller is requesting.</param>
144149/// <returns>0 if successful; an error code otherwise.</returns>
150+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
145151public delegate int readstream_callback (
146152out IntPtr stream_out ,
147153IntPtr backend ,
@@ -154,6 +160,7 @@ public delegate int readstream_callback(
154160/// <param name="backend">[in] A pointer to the backend which is being asked to perform the task.</param>
155161/// <param name="oid">[in] The object ID that the caller is requesting.</param>
156162/// <returns>True if the object exists; false otherwise</returns>
163+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
157164public delegate bool exists_callback (
158165IntPtr backend ,
159166ref GitOid oid ) ;
@@ -169,6 +176,7 @@ public delegate bool exists_callback(
169176/// <param name="short_oid">[in] The short-form OID which the backend is being asked to look up.</param>
170177/// <param name="len">[in] The length of the short-form OID (short_oid).</param>
171178/// <returns>1 if the object exists, 0 if the object doesn't; an error code otherwise.</returns>
179+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
172180public delegate int exists_prefix_callback (
173181ref GitOid found_oid ,
174182IntPtr backend ,
@@ -182,6 +190,7 @@ public delegate int exists_prefix_callback(
182190/// <param name="backend">[in] A pointer to the backend which is being asked to perform the task.</param>
183191/// <param name="cb">[in] The callback function to invoke.</param>
184192/// <param name="data">[in] An arbitrary parameter to pass through to the callback</param>
193+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
185194public delegate int foreach_callback (
186195IntPtr backend ,
187196foreach_callback_callback cb ,
@@ -191,6 +200,7 @@ public delegate int foreach_callback(
191200/// The owner of this backend is finished with it. The backend is asked to clean up and shut down.
192201/// </summary>
193202/// <param name="backend">[in] A pointer to the backend which is being freed.</param>
203+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
194204public delegate void free_callback (
195205IntPtr backend ) ;
196206
@@ -200,6 +210,7 @@ public delegate void free_callback(
200210/// <param name="oid">The oid of each object in the backing store.</param>
201211/// <param name="data">The arbitrary parameter given to foreach_callback.</param>
202212/// <returns>A non-negative result indicates the enumeration should continue. Otherwise, the enumeration should stop.</returns>
213+ [ UnmanagedFunctionPointer ( CallingConvention . Cdecl ) ]
203214public delegate int foreach_callback_callback (
204215IntPtr oid ,
205216IntPtr data ) ;
0 commit comments