File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 3131#include "cs_export.h"
3232
3333#ifndef NCOMPLEX
34+ /*
35+ * A workaround for Visual Studio 2022 which does not define _Dcomplex if the
36+ * consumer enabled the /std:c++17 flag. In this case, <complex.h> includes
37+ * <ccomplex> which in turn includes <complex> that omits the necessary type
38+ * definition.
39+ */
40+ #if defined(__cplusplus ) && defined(_MSC_VER )
41+ /* Adjust the definition of _CRT_USE_C_COMPLEX_H unless it is already defined
42+ * and at the same time is non zero */
43+ # if !(defined(_CRT_USE_C_COMPLEX_H ) && !_CRT_USE_C_COMPLEX_H )
44+ # if defined(_CRT_USE_C_COMPLEX_H )
45+ # undef _CRT_USE_C_COMPLEX_H
46+ # endif
47+ # define _CRT_USE_C_COMPLEX_H 1
48+ # endif
49+ #endif
3450#include <complex.h>
3551#endif /* !defined(NCOMPLEX) */
3652
You can’t perform that action at this time.
0 commit comments