Skip to content

Commit 84ba707

Browse files
sdsolletodaysoftware
authored andcommitted
Added option for Windows to use delayed (e.g. on-demand) loading of git2.dll
1 parent b980b7b commit 84ba707

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+803
-796
lines changed

src/git2/annotated_commit.inc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*)
2626

2727
function git_annotated_commit_from_ref(out_: PPgit_annotated_commit; repo: Pgit_repository;
28-
ref: Pgit_reference): Integer; cdecl; external libgit2_dll;
28+
ref: Pgit_reference): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
2929

3030
(**
3131
* Creates a `git_annotated_commit` from the given fetch head data.
@@ -41,7 +41,7 @@ function git_annotated_commit_from_ref(out_: PPgit_annotated_commit; repo: Pgit_
4141
*)
4242

4343
function git_annotated_commit_from_fetchhead(out_: PPgit_annotated_commit; repo: Pgit_repository; branch_name, remote_url:
44-
PAnsiChar; id: Pgit_oid): Integer; cdecl; external libgit2_dll;
44+
PAnsiChar; id: Pgit_oid): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
4545

4646
(**
4747
* Creates a `git_annotated_commit` from the given commit id.
@@ -63,7 +63,7 @@ function git_annotated_commit_from_fetchhead(out_: PPgit_annotated_commit; repo:
6363
*)
6464

6565
function git_annotated_commit_lookup(out_: PPgit_annotated_commit; repo: Pgit_repository;
66-
id: Pgit_oid): Integer; cdecl; external libgit2_dll;
66+
id: Pgit_oid): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
6767

6868
(**
6969
* Creates a `git_annotated_commit` from a revision string.
@@ -79,7 +79,7 @@ function git_annotated_commit_lookup(out_: PPgit_annotated_commit; repo: Pgit_re
7979
*)
8080

8181
function git_annotated_commit_from_revspec(out_: PPgit_annotated_commit; repo: Pgit_repository;
82-
revspec: PAnsiChar): Integer; cdecl; external libgit2_dll;
82+
revspec: PAnsiChar): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
8383

8484
(**
8585
* Gets the commit ID that the given `git_annotated_commit` refers to.
@@ -88,7 +88,7 @@ function git_annotated_commit_from_revspec(out_: PPgit_annotated_commit; repo: P
8888
* @return commit id
8989
*)
9090

91-
function git_annotated_commit_id(commit: Pgit_annotated_commit): Pgit_oid; cdecl; external libgit2_dll;
91+
function git_annotated_commit_id(commit: Pgit_annotated_commit): Pgit_oid; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
9292

9393
(**
9494
* Get the refname that the given `git_annotated_commit` refers to.
@@ -97,15 +97,15 @@ function git_annotated_commit_id(commit: Pgit_annotated_commit): Pgit_oid; cdecl
9797
* @return ref name.
9898
*)
9999

100-
function git_annotated_commit_ref(commit: Pgit_annotated_commit): PAnsiChar; cdecl; external libgit2_dll;
100+
function git_annotated_commit_ref(commit: Pgit_annotated_commit): PAnsiChar; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
101101

102102
(**
103103
* Frees a `git_annotated_commit`.
104104
*
105105
* @param commit annotated commit to free
106106
*)
107107

108-
procedure git_annotated_commit_free(commit: Pgit_annotated_commit); cdecl; external libgit2_dll;
108+
procedure git_annotated_commit_free(commit: Pgit_annotated_commit); cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
109109

110110
(** @} *)
111111

src/git2/apply.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const
111111
*)
112112

113113
function git_apply_options_init(opts: Pgit_apply_options; version: Cardinal)
114-
: Integer; cdecl; external libgit2_dll;
114+
: Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
115115

116116
(**
117117
* Apply a `git_diff` to a `git_tree`, and return the resulting image
@@ -126,7 +126,7 @@ function git_apply_options_init(opts: Pgit_apply_options; version: Cardinal)
126126
*)
127127

128128
function git_apply_to_tree(out_: PPgit_index; repo: Pgit_repository; preimage: Pgit_tree; diff: Pgit_diff; options:
129-
Pgit_apply_options): Integer; cdecl; external libgit2_dll;
129+
Pgit_apply_options): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
130130

131131
(** Possible application locations for git_apply *)
132132

@@ -161,7 +161,7 @@ type
161161
*)
162162

163163
function git_apply(repo: Pgit_repository; diff: Pgit_diff; location: git_apply_location_t; options: Pgit_apply_options): Integer;
164-
cdecl; external libgit2_dll;
164+
cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
165165

166166
(** @} *)
167167

src/git2/attr.inc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ type
9797
* @return the value type for the attribute
9898
*)
9999

100-
function git_attr_value(attr: PAnsiChar): git_attr_value_t; cdecl; external libgit2_dll;
100+
function git_attr_value(attr: PAnsiChar): git_attr_value_t; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
101101

102102
(**
103103
* Check attribute flags: Reading values from index and working directory.
@@ -189,7 +189,7 @@ const
189189
*)
190190

191191
function git_attr_get(value_out: PPAnsiChar; repo: Pgit_repository; flags: uint32_t; path,
192-
name_: PAnsiChar): Integer; cdecl; external libgit2_dll;
192+
name_: PAnsiChar): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
193193

194194
(**
195195
* Look up the value of one git attribute for path with extended options.
@@ -209,7 +209,7 @@ function git_attr_get(value_out: PPAnsiChar; repo: Pgit_repository; flags: uint3
209209
*)
210210

211211
function git_attr_get_ext(value_out: PPAnsiChar; repo: Pgit_repository; opts: Pgit_attr_options;
212-
path, name_: PAnsiChar): Integer; cdecl; external libgit2_dll;
212+
path, name_: PAnsiChar): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
213213

214214
(**
215215
* Look up a list of git attributes for path.
@@ -243,7 +243,7 @@ function git_attr_get_ext(value_out: PPAnsiChar; repo: Pgit_repository; opts: Pg
243243
*)
244244

245245
function git_attr_get_many(values_out: PPAnsiChar; repo: Pgit_repository; flags: uint32_t; path: PAnsiChar;
246-
num_attr: size_t; names: PPAnsiChar): Integer; cdecl; external libgit2_dll;
246+
num_attr: size_t; names: PPAnsiChar): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
247247

248248
(**
249249
* Look up a list of git attributes for path with extended options.
@@ -264,7 +264,7 @@ function git_attr_get_many(values_out: PPAnsiChar; repo: Pgit_repository; flags:
264264
*)
265265

266266
function git_attr_get_many_ext(values_out: PPAnsiChar; repo: Pgit_repository; opts: Pgit_attr_options; path: PAnsiChar; num_attr:
267-
size_t; names: PPAnsiChar): Integer; cdecl; external libgit2_dll;
267+
size_t; names: PPAnsiChar): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
268268

269269
(**
270270
* The callback used with git_attr_foreach.
@@ -301,7 +301,7 @@ type
301301
*)
302302

303303
function git_attr_foreach(repo: Pgit_repository; flags: uint32_t; path: PAnsiChar; callback: git_attr_foreach_cb;
304-
payload: Pointer): Integer; cdecl; external libgit2_dll;
304+
payload: Pointer): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
305305

306306
(**
307307
* Loop over all the git attributes for a path with extended options.
@@ -318,7 +318,7 @@ function git_attr_foreach(repo: Pgit_repository; flags: uint32_t; path: PAnsiCha
318318
*)
319319

320320
function git_attr_foreach_ext(repo: Pgit_repository; opts: Pgit_attr_options; path: PAnsiChar;
321-
callback: git_attr_foreach_cb; payload: Pointer): Integer; cdecl; external libgit2_dll;
321+
callback: git_attr_foreach_cb; payload: Pointer): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
322322

323323
(**
324324
* Flush the gitattributes cache.
@@ -332,7 +332,7 @@ function git_attr_foreach_ext(repo: Pgit_repository; opts: Pgit_attr_options; pa
332332
* @return 0 on success, or an error code
333333
*)
334334

335-
function git_attr_cache_flush(repo: Pgit_repository): Integer; cdecl; external libgit2_dll;
335+
function git_attr_cache_flush(repo: Pgit_repository): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
336336

337337
(**
338338
* Add a macro definition.
@@ -350,7 +350,7 @@ function git_attr_cache_flush(repo: Pgit_repository): Integer; cdecl; external l
350350
* @return 0 or an error code.
351351
*)
352352

353-
function git_attr_add_macro(repo: Pgit_repository; name_, values: PAnsiChar): Integer; cdecl; external libgit2_dll;
353+
function git_attr_add_macro(repo: Pgit_repository; name_, values: PAnsiChar): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
354354

355355
(** @} *)
356356

src/git2/blame.inc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const
122122
* @return Zero on success; -1 on failure.
123123
*)
124124

125-
function git_blame_options_init(opts: Pgit_blame_options; version: Cardinal): Integer; cdecl; external libgit2_dll;
125+
function git_blame_options_init(opts: Pgit_blame_options; version: Cardinal): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
126126

127127
(**
128128
* Structure that represents a blame hunk.
@@ -215,15 +215,15 @@ type
215215
* @param blame The blame structure to query.
216216
* @return The number of line.
217217
*)
218-
function git_blame_linecount(blame: Pgit_blame): size_t; cdecl; external libgit2_dll;
218+
function git_blame_linecount(blame: Pgit_blame): size_t; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
219219

220220
(**
221221
* Gets the number of hunks that exist in the blame structure.
222222
*
223223
* @param blame The blame structure to query.
224224
* @return The number of hunks.
225225
*)
226-
function git_blame_hunkcount(blame: Pgit_blame): size_t; cdecl; external libgit2_dll;
226+
function git_blame_hunkcount(blame: Pgit_blame): size_t; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
227227

228228
(**
229229
* Gets the blame hunk at the given index.
@@ -232,7 +232,7 @@ function git_blame_hunkcount(blame: Pgit_blame): size_t; cdecl; external libgit2
232232
* @param index index of the hunk to retrieve
233233
* @return the hunk at the given index, or NULL on error
234234
*)
235-
function git_blame_hunk_byindex(blame: Pgit_blame; index: size_t): Pgit_blame_hunk; cdecl; external libgit2_dll;
235+
function git_blame_hunk_byindex(blame: Pgit_blame; index: size_t): Pgit_blame_hunk; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
236236

237237
(**
238238
* Gets the hunk that relates to the given line number in the newest
@@ -242,7 +242,7 @@ function git_blame_hunk_byindex(blame: Pgit_blame; index: size_t): Pgit_blame_hu
242242
* @param lineno the (1-based) line number to find a hunk for
243243
* @return the hunk that contains the given line, or NULL on error
244244
*)
245-
function git_blame_hunk_byline(blame: Pgit_blame; lineno: size_t): Pgit_blame_hunk; cdecl; external libgit2_dll;
245+
function git_blame_hunk_byline(blame: Pgit_blame; lineno: size_t): Pgit_blame_hunk; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
246246

247247
(**
248248
* Gets the information about the line in the blame.
@@ -251,7 +251,7 @@ function git_blame_hunk_byline(blame: Pgit_blame; lineno: size_t): Pgit_blame_hu
251251
* @param idx the (1-based) line number
252252
* @return the blamed line, or NULL on error
253253
*)
254-
function git_blame_line_byindex(blame: Pgit_blame; idx: size_t): Pgit_blame_line; cdecl; external libgit2_dll;
254+
function git_blame_line_byindex(blame: Pgit_blame; idx: size_t): Pgit_blame_line; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
255255

256256
{$IFNDEF GIT_DEPRECATE_HARD}
257257
(**
@@ -261,7 +261,7 @@ function git_blame_line_byindex(blame: Pgit_blame; idx: size_t): Pgit_blame_line
261261
* @return The number of hunks.
262262
*)
263263

264-
function git_blame_get_hunk_count(blame: Pgit_blame): uint32_t; cdecl; external libgit2_dll;
264+
function git_blame_get_hunk_count(blame: Pgit_blame): uint32_t; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
265265

266266
(**
267267
* Gets the blame hunk at the given index.
@@ -271,7 +271,7 @@ function git_blame_get_hunk_count(blame: Pgit_blame): uint32_t; cdecl; external
271271
* @return the hunk at the given index, or NULL on error
272272
*)
273273

274-
function git_blame_get_hunk_byindex(blame: Pgit_blame; index_: uint32_t): Pgit_blame_hunk; cdecl; external libgit2_dll;
274+
function git_blame_get_hunk_byindex(blame: Pgit_blame; index_: uint32_t): Pgit_blame_hunk; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
275275

276276
(**
277277
* Gets the hunk that relates to the given line number in the newest commit.
@@ -281,7 +281,7 @@ function git_blame_get_hunk_byindex(blame: Pgit_blame; index_: uint32_t): Pgit_b
281281
* @return the hunk that contains the given line, or NULL on error
282282
*)
283283

284-
function git_blame_get_hunk_byline(blame: Pgit_blame; lineno: size_t): Pgit_blame_hunk; cdecl; external libgit2_dll;
284+
function git_blame_get_hunk_byline(blame: Pgit_blame; lineno: size_t): Pgit_blame_hunk; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
285285
{$ENDIF}
286286

287287
(**
@@ -295,7 +295,7 @@ function git_blame_get_hunk_byline(blame: Pgit_blame; lineno: size_t): Pgit_blam
295295
*)
296296

297297
function git_blame_file(out_: PPgit_blame; repo: Pgit_repository; path: PAnsiChar;
298-
options: Pgit_blame_options): Integer; cdecl; external libgit2_dll;
298+
options: Pgit_blame_options): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
299299

300300
(**
301301
* Get the blame for a single file in the repository, using the specified
@@ -311,7 +311,7 @@ function git_blame_file(out_: PPgit_blame; repo: Pgit_repository; path: PAnsiCha
311311
* @return 0 on success, or an error code
312312
*)
313313
function git_blame_file_from_buffer(out_: PPgit_blame; repo: Pgit_repository; path, contents: PAnsiChar;
314-
contents_len: size_t; options: Pgit_blame_options): Integer; cdecl; external libgit2_dll;
314+
contents_len: size_t; options: Pgit_blame_options): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
315315

316316
(**
317317
* Get blame data for a file that has been modified in memory. The `blame`
@@ -332,15 +332,15 @@ function git_blame_file_from_buffer(out_: PPgit_blame; repo: Pgit_repository; pa
332332
*)
333333

334334
function git_blame_buffer(out_: PPgit_blame; base: Pgit_blame; buffer: PAnsiChar;
335-
buffer_len: size_t): Integer; cdecl; external libgit2_dll;
335+
buffer_len: size_t): Integer; cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
336336

337337
(**
338338
* Free memory allocated by git_blame_file or git_blame_buffer.
339339
*
340340
* @param blame the blame structure to free
341341
*)
342342

343-
procedure git_blame_free(blame: Pgit_blame); cdecl; external libgit2_dll;
343+
procedure git_blame_free(blame: Pgit_blame); cdecl; external libgit2_dll {$IFDEF LIBGIT2_DLL_DELAY_LOAD}delayed{$ENDIF};
344344

345345
(** @} *)
346346

0 commit comments

Comments
 (0)