Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
a41bf612
Commit
a41bf612
authored
Aug 08, 2011
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #357 from carlosmn/calling-convention
Use __stdcall by default on Windows
parents
5bd4fb59
1b5078f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
CMakeLists.txt
+4
-0
src/transport_local.c
+1
-9
tests/test_main.c
+6
-1
No files found.
CMakeLists.txt
View file @
a41bf612
...
...
@@ -45,10 +45,14 @@ SET(INSTALL_INC include CACHE PATH "Where to install headers to.")
OPTION
(
BUILD_SHARED_LIBS
"Build Shared Library (OFF for Static)"
ON
)
OPTION
(
BUILD_TESTS
"Build Tests"
ON
)
OPTION
(
THREADSAFE
"Build libgit2 as threadsafe"
OFF
)
OPTION
(
STDCALL
"Buildl libgit2 with the __stdcall convention (Windows)"
ON
)
# Platform specific compilation flags
IF
(
MSVC
)
SET
(
CMAKE_C_FLAGS
"/W4 /WX /nologo /Zi"
)
IF
(
STDCALL
)
SET
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
/Gz"
)
ENDIF
()
# TODO: bring back /RTC1 /RTCc
SET
(
CMAKE_C_FLAGS_DEBUG
"/Od /DEBUG /MTd"
)
SET
(
CMAKE_C_FLAGS_RELEASE
"/MT /O2"
)
...
...
src/transport_local.c
View file @
a41bf612
...
...
@@ -14,14 +14,6 @@ typedef struct {
git_vector
*
refs
;
}
transport_local
;
static
int
cmp_refs
(
const
void
*
a
,
const
void
*
b
)
{
const
char
*
stra
=
*
(
const
char
*
const
*
)
a
;
const
char
*
strb
=
*
(
const
char
*
const
*
)
b
;
return
strcmp
(
stra
,
strb
);
}
/*
* Try to open the url as a git directory. The direction doesn't
* matter in this case because we're calulating the heads ourselves.
...
...
@@ -148,7 +140,7 @@ static int local_ls(git_transport *transport, git_headarray *array)
return
error
;
/* Sort the references first */
qsort
(
refs
.
strings
,
refs
.
count
,
sizeof
(
char
*
),
cmp_refs
);
git__tsort
((
void
**
)
refs
.
strings
,
refs
.
count
,
(
git_vector_cmp
)
strcmp
);
/* Add HEAD */
error
=
add_ref
(
GIT_HEAD_FILE
,
repo
,
vec
);
...
...
tests/test_main.c
View file @
a41bf612
...
...
@@ -69,7 +69,12 @@ static libgit2_suite suite_methods[]= {
#define GIT_SUITE_COUNT (ARRAY_SIZE(suite_methods))
int
main
(
int
GIT_UNUSED
(
argc
),
char
*
GIT_UNUSED
(
argv
[]))
#ifdef GIT_WIN32
int
__cdecl
#else
int
#endif
main
(
int
GIT_UNUSED
(
argc
),
char
*
GIT_UNUSED
(
argv
[]))
{
unsigned
int
i
,
failures
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment