]> git.proxmox.com Git - libgit2.git/commitdiff
Use C99 stdio in mingw-w64
authorCarlos Martín Nieto <cmn@elego.de>
Fri, 8 Mar 2013 14:13:25 +0000 (15:13 +0100)
committerCarlos Martín Nieto <cmn@elego.de>
Fri, 8 Mar 2013 14:30:18 +0000 (15:30 +0100)
MinGW >= 3.14 does this automatically, but mingw-64 wants us to define
it.

CMakeLists.txt

index 03775432156dce95873ae2ef72e0129d6263b018..37a5830993d9c6857cebc278239ade627752f4ba 100644 (file)
@@ -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 ()