Use __GNUC__ macro in the resource script Fix the default LIBGIT2_FILENAME for GNU windres
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2aea589..8f139ec 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -278,10 +278,6 @@ list(SORT SRC_H)
# On Windows use specific platform sources
if(WIN32 AND NOT CYGWIN)
- if(NOT MSVC)
- ADD_DEFINITIONS(-DGCC_WINDRES)
- endif()
-
SET(WIN_RC "win32/git2.rc")
file(GLOB SRC_OS win32/*.c win32/*.h)
diff --git a/src/win32/git2.rc b/src/win32/git2.rc
index d325a5c..d273afd 100644
--- a/src/win32/git2.rc
+++ b/src/win32/git2.rc
@@ -2,21 +2,25 @@
#include "../../include/git2/version.h"
#ifndef LIBGIT2_FILENAME
-# define LIBGIT2_FILENAME "git2"
+# ifdef __GNUC__
+# define LIBGIT2_FILENAME git2
+# else
+# define LIBGIT2_FILENAME "git2"
+# endif
#endif
#ifndef LIBGIT2_COMMENTS
# define LIBGIT2_COMMENTS "For more information visit http://libgit2.github.com/"
#endif
-#ifdef GCC_WINDRES
+#ifdef __GNUC__
# define _STR(x) #x
# define STR(x) _STR(x)
#else
# define STR(x) x
#endif
-#ifdef GCC_WINDRES
+#ifdef __GNUC__
VS_VERSION_INFO VERSIONINFO
#else
VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE