File tree Expand file tree Collapse file tree 5 files changed +18
-26
lines changed
Expand file tree Collapse file tree 5 files changed +18
-26
lines changed Original file line number Diff line number Diff line change 1212 * <http://creativecommons.org/publicdomain/zero/1.0/>.
1313 */
1414
15+ #include <sys/types.h>
16+ #include <sys/stat.h>
1517#include <stdio.h>
1618#include <string.h>
1719#include <stdlib.h>
1820#include <git2.h>
21+ #include <fcntl.h>
22+
23+ #ifdef _WIN32
24+ # include <io.h>
25+ # include <Windows.h>
26+ # define open _open
27+ # define read _read
28+ # define close _close
29+ # define ssize_t int
30+ # define sleep (a ) Sleep(a * 1000)
31+ #else
32+ # include <unistd.h>
33+ #endif
1934
2035#ifndef PRIuZ
2136/* Define the printf format specifer to use for size_t output */
Original file line number Diff line number Diff line change 11#include <git2.h>
2- #include <stdio.h>
32#include "common.h"
43
54static int show_ref (git_reference * ref , void * data )
Original file line number Diff line number Diff line change 3636 * [pg]: https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain
3737 */
3838
39+ #include "common.h"
40+
3941/**
4042 * ### Includes
4143 *
4244 * Including the `git2.h` header will include all the other libgit2 headers
4345 * that you need. It should be the only thing you need to include in order
4446 * to compile properly and get all the libgit2 API.
4547 */
46- #include <git2.h>
47- #include <stdio.h>
48- #include <string.h>
48+ #include "git2.h"
4949
5050static void oid_parsing (git_oid * out );
5151static void object_database (git_repository * repo , git_oid * oid );
Original file line number Diff line number Diff line change 11#include "common.h"
22
3- #include <sys/types.h>
4- #include <sys/stat.h>
5- #include <fcntl.h>
6- #ifdef _WIN32
7- # include <io.h>
8- # include <Windows.h>
9-
10- # define open _open
11- # define read _read
12- # define close _close
13-
14- #define ssize_t int
15- #else
16- # include <unistd.h>
17- #endif
18-
193/*
204 * This could be run in the main loop whilst the application waits for
215 * the indexing to finish in a worker thread
Original file line number Diff line number Diff line change 1313 */
1414
1515#include "common.h"
16- #ifdef _WIN32
17- # include <Windows.h>
18- # define sleep (a ) Sleep(a * 1000)
19- #else
20- # include <unistd.h>
21- #endif
2216
2317/**
2418 * This example demonstrates the use of the libgit2 status APIs,
You can’t perform that action at this time.
0 commit comments