summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt14
-rw-r--r--README.md1
-rw-r--r--include/git2/common.h2
3 files changed, 3 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eff2500d5..f1da8c9f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,14 +74,6 @@ IF (APPLE)
ENDIF()
IF(MSVC)
- # This option is only available when building with MSVC. By default, libgit2
- # is build using the cdecl calling convention, which is useful if you're
- # writing C. However, the CLR and Win32 API both expect stdcall.
- #
- # If you are writing a CLR program and want to link to libgit2, you'll want
- # to turn this on by invoking CMake with the "-DSTDCALL=ON" argument.
- OPTION(STDCALL "Build libgit2 with the __stdcall convention" OFF)
-
# This option must match the settings used in your program, in particular if you
# are linking statically
OPTION(STATIC_CRT "Link the static CRT libraries" ON)
@@ -125,10 +117,8 @@ IF (MSVC)
# /MP - Parallel build
SET(CMAKE_C_FLAGS "/GF /MP /nologo ${CMAKE_C_FLAGS}")
- IF (STDCALL)
- # /Gz - stdcall calling convention
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gz")
- ENDIF ()
+ # /Gd - explicitly set cdecl calling convention
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd")
IF (STATIC_CRT)
SET(CRT_FLAG_DEBUG "/MTd")
diff --git a/README.md b/README.md
index 69ddfd610..8569df078 100644
--- a/README.md
+++ b/README.md
@@ -255,7 +255,6 @@ The following CMake variables are declared:
- `BUILD_SHARED_LIBS`: Build libgit2 as a Shared Library (defaults to ON)
- `BUILD_CLAR`: Build [Clar](https://github.com/vmg/clar)-based test suite (defaults to ON)
- `THREADSAFE`: Build libgit2 with threading support (defaults to ON)
-- `STDCALL`: Build libgit2 as `stdcall`. Turn off for `cdecl` (Windows; defaults to ON)
To list all build options and their current value, you can do the
following:
diff --git a/include/git2/common.h b/include/git2/common.h
index 82f6ba48b..b97f9ef8a 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -43,7 +43,7 @@ typedef size_t size_t;
__attribute__((visibility("default"))) \
type
#elif defined(_MSC_VER)
-# define GIT_EXTERN(type) __declspec(dllexport) type
+# define GIT_EXTERN(type) __declspec(dllexport) type __cdecl
#else
# define GIT_EXTERN(type) extern type
#endif