File tree Expand file tree Collapse file tree 6 files changed +11
-8
lines changed Expand file tree Collapse file tree 6 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,13 @@ SET(CMAKE_MODULE_PATH
11
11
"${CMAKE_MODULE_PATH} " )
12
12
13
13
IF (NOT MSVC )
14
+ IF (MINGW )
15
+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=format" )
16
+ ELSE ()
14
17
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=implicit-function-declaration -Werror=format" )
18
+ ENDIF (MINGW )
15
19
ENDIF (NOT MSVC )
16
20
17
-
18
21
# Flags
19
22
# When using MSVC
20
23
IF (MSVC )
Original file line number Diff line number Diff line change 1
1
#include "general.h"
2
2
3
- #ifdef _MSC_VER
3
+ #if (defined( _MSC_VER ) || defined( __MINGW32__ ))
4
4
#include <time.h>
5
5
#else
6
6
#include <sys/time.h>
@@ -19,7 +19,7 @@ typedef struct _Timer
19
19
double startusertime ;
20
20
double startsystime ;
21
21
22
- #ifdef _MSC_VER
22
+ #if (defined( _MSC_VER ) || defined( __MINGW32__ ))
23
23
time_t base_time ;
24
24
#endif
25
25
Original file line number Diff line number Diff line change 7
7
#include "luaT.h"
8
8
#include "TH.h"
9
9
10
- #ifdef _MSC_VER
10
+ #if (defined( _MSC_VER ) || defined( __MINGW32__ ))
11
11
12
12
#define snprintf _snprintf
13
13
#define popen _popen
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ void THFree(void *ptr)
150
150
151
151
double THLog1p (const double x )
152
152
{
153
- #ifdef _MSC_VER
153
+ #if (defined( _MSC_VER ) || defined( __MINGW32__ ))
154
154
volatile double y = 1 + x ;
155
155
return log (y ) - ((y - 1 )- x )/y ; /* cancels errors with IEEE arithmetic */
156
156
#else
Original file line number Diff line number Diff line change 89
89
#define THMin (X , Y ) ((X) < (Y) ? (X) : (Y))
90
90
#define THMax (X , Y ) ((X) > (Y) ? (X) : (Y))
91
91
92
- #ifdef _MSC_VER
92
+ #if (defined( _MSC_VER ) || defined( __MINGW32__ ))
93
93
# define log1p (x ) THLog1p(x)
94
94
#define snprintf _snprintf
95
95
#define popen _popen
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ extern "C" {
18
18
# endif
19
19
#endif
20
20
21
- #ifdef _MSC_VER
21
+ #if (defined( _MSC_VER ) || defined( __MINGW32__ ))
22
22
# define DLL_EXPORT __declspec(dllexport)
23
23
# define DLL_IMPORT __declspec(dllimport)
24
24
# ifdef luaT_EXPORTS
@@ -108,7 +108,7 @@ LUAT_API int luaT_lua_pushudata(lua_State *L);
108
108
/* comments show what function (that you should use) they call now */
109
109
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1 ))
110
110
#define LUAT_DEPRECATED __attribute__((__deprecated__))
111
- #elif defined(_MSC_VER )
111
+ #elif ( defined(_MSC_VER ) || defined( __MINGW32__ ) )
112
112
#define LUAT_DEPRECATED __declspec(deprecated)
113
113
#else
114
114
#define LUAT_DEPRECATED
You can’t perform that action at this time.
0 commit comments