Skip to content

Commit 0617776

Browse files
committed
Disable zlib warnings in cmake instead of source files.
1 parent 3b635bd commit 0617776

File tree

13 files changed

+6
-57
lines changed

13 files changed

+6
-57
lines changed

src/mono/cmake/config.h.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@
1818
#pragma warning(disable:4706) // W4: assignment within conditional expression
1919

2020
// promote warnings to errors
21+
#pragma warning(error:4005) // W1: 'identifier' : macro redefinition
2122
#pragma warning(error:4013) // W3: function undefined; assuming extern returning int
2223
#pragma warning(error:4022) // W1: call and prototype disagree
2324
#pragma warning(error:4047) // W1: differs in level of indirection
2425
#pragma warning(error:4065) // W?: switch with default but no case
2526
#pragma warning(error:4098) // W1: void return returns a value
2627
#pragma warning(error:4113) // W1: call and prototype disagree
2728
#pragma warning(error:4127) // W4: conditional expression is constant
29+
#pragma warning(error:4131) // W4: 'function' : uses old-style declarator
2830
#pragma warning(error:4146) // W2: unary minus operator applied to unsigned type, result still unsigned
2931
#pragma warning(error:4172) // W1: returning address of local variable or temporary
3032
#pragma warning(error:4189) // W4: local variable is initialized but not referenced

src/mono/mono/mini/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,10 @@ elseif(NOT HOST_BROWSER)
305305
set(mini_sources "${mini_sources};${VERSION_FILE_PATH}") # this is generated by GenerateNativeVersionFile in Arcade
306306
endif()
307307

308+
if(HOST_WIN32)
309+
set_source_files_properties(${ZLIB_SOURCES} PROPERTIES COMPILE_OPTIONS "/wd4005;/wd4127;/wd4131;/wd4244")
310+
endif()
311+
308312
set(monosgen-sources "${metadata_sources};${utils_sources};${sgen_sources};${icu_shim_sources};${mini_sources};${ZLIB_SOURCES}")
309313

310314
add_library(monosgen-objects OBJECT "${monosgen-sources}")

src/native/external/zlib/adler32.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55

66
/* @(#) $Id$ */
77

8-
#ifdef _MSC_VER
9-
__pragma(warning (disable:4005)) /* macro redefinition */
10-
__pragma(warning (disable:4131)) /* uses old-style declarator */
11-
#endif
12-
138
#include "zutil.h"
149

1510
local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));

src/native/external/zlib/compress.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55

66
/* @(#) $Id$ */
77

8-
#ifdef _MSC_VER
9-
__pragma(warning (disable:4131)) /* uses old-style declarator */
10-
#endif
11-
128
#define ZLIB_INTERNAL
139
#include "zlib.h"
1410

src/native/external/zlib/crc32.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111

1212
/* @(#) $Id$ */
1313

14-
#ifdef _MSC_VER
15-
__pragma(warning (disable:4005)) /* macro redefinition */
16-
__pragma(warning (disable:4127)) /* conditional expression is constant */
17-
__pragma(warning (disable:4131)) /* uses old-style declarator */
18-
#endif
19-
2014
/*
2115
Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
2216
protection on the static variables used to control the first-use generation

src/native/external/zlib/deflate.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@
4949

5050
/* @(#) $Id$ */
5151

52-
#ifdef _MSC_VER
53-
__pragma(warning (disable:4005)) /* macro redefinition */
54-
__pragma(warning (disable:4127)) /* conditional expression is constant */
55-
__pragma(warning (disable:4131)) /* uses old-style declarator */
56-
__pragma(warning (disable:4244)) /* conversion from 'unsigned int' to 'Bytef', possible loss of data */
57-
#endif
58-
5952
#include "deflate.h"
6053

6154
const char deflate_copyright[] =

src/native/external/zlib/infback.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
inflate_fast() can be used with either inflate.c or infback.c.
1111
*/
1212

13-
#ifdef _MSC_VER
14-
__pragma(warning (disable:4005)) /* macro redefinition */
15-
__pragma(warning (disable:4131)) /* uses old-style declarator */
16-
#endif
17-
1813
#include "zutil.h"
1914
#include "inftrees.h"
2015
#include "inflate.h"

src/native/external/zlib/inffast.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
* For conditions of distribution and use, see copyright notice in zlib.h
44
*/
55

6-
#ifdef _MSC_VER
7-
__pragma(warning (disable:4005)) /* macro redefinition */
8-
__pragma(warning (disable:4131)) /* uses old-style declarator */
9-
#endif
10-
116
#include "zutil.h"
127
#include "inftrees.h"
138
#include "inflate.h"

src/native/external/zlib/inflate.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
* For conditions of distribution and use, see copyright notice in zlib.h
44
*/
55

6-
#ifdef _MSC_VER
7-
__pragma(warning (disable:4005)) /* macro redefinition */
8-
__pragma(warning (disable:4131)) /* uses old-style declarator */
9-
#endif
10-
116
/*
127
* Change history:
138
*

src/native/external/zlib/inftrees.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
* For conditions of distribution and use, see copyright notice in zlib.h
44
*/
55

6-
#ifdef _MSC_VER
7-
__pragma(warning (disable:4005)) /* macro redefinition */
8-
__pragma(warning (disable:4131)) /* uses old-style declarator */
9-
#endif
10-
116
#include "zutil.h"
127
#include "inftrees.h"
138

src/native/external/zlib/trees.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@
3232

3333
/* @(#) $Id$ */
3434

35-
#ifdef _MSC_VER
36-
__pragma(warning (disable:4005)) /* macro redefinition */
37-
__pragma(warning (disable:4131)) /* uses old-style declarator */
38-
__pragma(warning (disable:4244)) /* conversion from 'int' to 'ush', possible loss of data */
39-
#endif
40-
4135
/* #define GEN_TREES_H */
4236

4337
#include "deflate.h"

src/native/external/zlib/uncompr.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55

66
/* @(#) $Id$ */
77

8-
#ifdef _MSC_VER
9-
__pragma(warning (disable:4131)) /* uses old-style declarator */
10-
#endif
11-
128
#define ZLIB_INTERNAL
139
#include "zlib.h"
1410

src/native/external/zlib/zutil.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55

66
/* @(#) $Id$ */
77

8-
#ifdef _MSC_VER
9-
__pragma(warning (disable:4005)) /* macro redefinition */
10-
__pragma(warning (disable:4131)) /* uses old-style declarator */
11-
#endif
12-
138
#include "zutil.h"
149
#ifndef Z_SOLO
1510
# include "gzguts.h"

0 commit comments

Comments
 (0)