File tree Expand file tree Collapse file tree 11 files changed +30
-17
lines changed Expand file tree Collapse file tree 11 files changed +30
-17
lines changed Original file line number Diff line number Diff line change @@ -64,23 +64,6 @@ if(MSVC)
6464 xcheck_add_c_compiler_flag(-Wno-reserved-identifier)
6565 xcheck_add_c_compiler_flag(-Wdeprecated-declarations)
6666 xcheck_add_c_compiler_flag(/experimental:c11atomics)
67- xcheck_add_c_compiler_flag(/wd4018) # -Wno-sign-conversion
68- xcheck_add_c_compiler_flag(/wd4061) # -Wno-implicit-fallthrough
69- xcheck_add_c_compiler_flag(/wd4100) # -Wno-unused-parameter
70- xcheck_add_c_compiler_flag(/wd4200) # -Wno-zero-length-array
71- xcheck_add_c_compiler_flag(/wd4242) # -Wno-shorten-64-to-32
72- xcheck_add_c_compiler_flag(/wd4244) # -Wno-shorten-64-to-32
73- xcheck_add_c_compiler_flag(/wd4245) # -Wno-sign-compare
74- xcheck_add_c_compiler_flag(/wd4267) # -Wno-shorten-64-to-32
75- xcheck_add_c_compiler_flag(/wd4388) # -Wno-sign-compare
76- xcheck_add_c_compiler_flag(/wd4389) # -Wno-sign-compare
77- xcheck_add_c_compiler_flag(/wd4456) # Hides previous local declaration
78- xcheck_add_c_compiler_flag(/wd4457) # Hides function parameter
79- xcheck_add_c_compiler_flag(/wd4710) # Function not inlined
80- xcheck_add_c_compiler_flag(/wd4711) # Function was inlined
81- xcheck_add_c_compiler_flag(/wd4820) # Padding added after construct
82- xcheck_add_c_compiler_flag(/wd4996) # -Wdeprecated-declarations
83- xcheck_add_c_compiler_flag(/wd5045) # Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
8467endif ()
8568
8669# Set a 8MB default stack size on Windows.
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ const libunicode_c = loadFile("libunicode.c")
99const libunicode_h = loadFile ( "libunicode.h" )
1010const libunicode_table_h = loadFile ( "libunicode-table.h" )
1111const list_h = loadFile ( "list.h" )
12+ const msvc_pragmas_h = loadFile ( "msvc-pragmas.h" )
1213const quickjs_atom_h = loadFile ( "quickjs-atom.h" )
1314const quickjs_c = loadFile ( "quickjs.c" )
1415const quickjs_c_atomics_h = loadFile ( "quickjs-c-atomics.h" )
@@ -23,6 +24,7 @@ const gen_builtin_array_fromasync_h = loadFile("builtin-array-fromasync.h")
2324let source = "#if defined(QJS_BUILD_LIBC) && defined(__linux__) && !defined(_GNU_SOURCE)\n"
2425 + "#define _GNU_SOURCE\n"
2526 + "#endif\n"
27+ + msvc_pragmas_h
2628 + quickjs_c_atomics_h
2729 + cutils_h
2830 + list_h
@@ -40,6 +42,7 @@ let source = "#if defined(QJS_BUILD_LIBC) && defined(__linux__) && !defined(_GNU
4042 + quickjs_libc_h
4143 + quickjs_libc_c
4244 + "#endif // QJS_BUILD_LIBC\n"
45+ source = source . replace ( / # i n c l u d e " m s v c - p r a g m a s .h " / g, "" )
4346source = source . replace ( / # i n c l u d e " q u i c k j s - a t o m .h " / g, quickjs_atom_h )
4447source = source . replace ( / # i n c l u d e " q u i c k j s - o p c o d e .h " / g, quickjs_opcode_h )
4548source = source . replace ( / # i n c l u d e " l i b r e g e x p - o p c o d e .h " / g, libregexp_opcode_h )
Original file line number Diff line number Diff line change 2222 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323 * THE SOFTWARE.
2424 */
25+ #include "msvc-pragmas.h"
2526#include <assert.h>
2627#include <stdlib.h>
2728#include <stdio.h>
Original file line number Diff line number Diff line change 2121 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222 * THE SOFTWARE.
2323 */
24+ #include "msvc-pragmas.h"
2425#include <stdlib.h>
2526#include <stdio.h>
2627#include <stdarg.h>
Original file line number Diff line number Diff line change 2121 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222 * THE SOFTWARE.
2323 */
24+ #include "msvc-pragmas.h"
2425#include <stdlib.h>
2526#include <stdio.h>
2627#include <stdarg.h>
Original file line number Diff line number Diff line change 1+ #ifdef _MSC_VER
2+ #pragma warning(disable: 4018) // -Wno-sign-conversion
3+ #pragma warning(disable: 4061) // -Wno-implicit-fallthrough
4+ #pragma warning(disable: 4100) // -Wno-unused-parameter
5+ #pragma warning(disable: 4200) // -Wno-zero-length-array
6+ #pragma warning(disable: 4242) // -Wno-shorten-64-to-32
7+ #pragma warning(disable: 4244) // -Wno-shorten-64-to-32
8+ #pragma warning(disable: 4245) // -Wno-sign-compare
9+ #pragma warning(disable: 4267) // -Wno-shorten-64-to-32
10+ #pragma warning(disable: 4388) // -Wno-sign-compare
11+ #pragma warning(disable: 4389) // -Wno-sign-compare
12+ #pragma warning(disable: 4456) // Hides previous local declaration
13+ #pragma warning(disable: 4457) // Hides function parameter
14+ #pragma warning(disable: 4710) // Function not inlined
15+ #pragma warning(disable: 4711) // Function was inlined
16+ #pragma warning(disable: 4820) // Padding added after construct
17+ #pragma warning(disable: 4996) // -Wdeprecated-declarations
18+ #pragma warning(disable: 5045) // Compiler will insert Spectre mitigation for memory load if /Qspectre switch specified
19+ #endif
Original file line number Diff line number Diff line change 2222 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323 * THE SOFTWARE.
2424 */
25+ #include "msvc-pragmas.h"
2526#include <stdlib.h>
2627#include <stdio.h>
2728#include <stdarg.h>
Original file line number Diff line number Diff line change 2323 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424 * THE SOFTWARE.
2525 */
26+ #include "msvc-pragmas.h"
2627#include <stdlib.h>
2728#include <stdio.h>
2829#include <stdarg.h>
Original file line number Diff line number Diff line change 2222 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323 * THE SOFTWARE.
2424 */
25+ #include "msvc-pragmas.h"
2526#include "quickjs.h"
2627#include <stdlib.h>
2728#include <stdio.h>
Original file line number Diff line number Diff line change 2424 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2525 * THE SOFTWARE.
2626 */
27+ #include "msvc-pragmas.h"
2728#include <stdlib.h>
2829#include <stdio.h>
2930#include <stdarg.h>
You can’t perform that action at this time.
0 commit comments