summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@elego.de>2013-03-08 15:13:25 +0100
committerCarlos Martín Nieto <cmn@elego.de>2013-03-08 15:30:18 +0100
commit0887b580bfe83a9f6e9a8530368a22e478411a0f (patch)
tree158b1d1889bfef4a548b1cca7bce547f350de73a
parent92ebbe99c9b557aee3382f51ddf6dd6637ee2fe4 (diff)
downloadlibgit2-0887b580bfe83a9f6e9a8530368a22e478411a0f.tar.gz
Use C99 stdio in mingw-w64
MinGW >= 3.14 does this automatically, but mingw-64 wants us to define it.
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 037754321..37a583099 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -205,6 +205,11 @@ ELSE ()
IF (MINGW) # MinGW always does PIC and complains if we tell it to
STRING(REGEX REPLACE "-fPIC" "" CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}")
+ # MinGW >= 3.14 uses the C99-style stdio functions
+ # automatically, but forks like mingw-w64 still want
+ # us to define this in order to use them
+ ADD_DEFINITIONS(-D__USE_MINGW_ANSI_STDIO=1)
+
ELSEIF (BUILD_SHARED_LIBS)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fPIC")
ENDIF ()