From 29d67ac456f1013bdf621b473232e67f141e8ac6 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Sun, 30 Jul 2023 10:33:00 +0200 Subject: [PATCH] Speedups: ignore warning C4551 for pyximport+MSVC (#2054) The cython-generated code triggers C4551 on MSVC, which does not get silenced by pyximport's build flags. So we silence it on source code level instead. --- _speedups.pyx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/_speedups.pyx b/_speedups.pyx index fc2413ce..9bf25cce 100644 --- a/_speedups.pyx +++ b/_speedups.pyx @@ -16,6 +16,14 @@ from libc.stdint cimport int64_t, uint32_t from libcpp.set cimport set as std_set from collections import defaultdict +cdef extern from *: + """ + // avoid warning from cython-generated code with MSVC + pyximport + #ifdef _MSC_VER + #pragma warning( disable: 4551 ) + #endif + """ + ctypedef uint32_t ap_player_t # on AMD64 this is faster (and smaller) than 64bit ints ctypedef uint32_t ap_flags_t ctypedef int64_t ap_id_t