Skip to content

Commit

Permalink
Add MSVC-compatible complex types
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-frbg authored Dec 12, 2023
1 parent dcf6999 commit dcdc351
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lapack-netlib/LAPACKE/include/lapacke_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ extern "C" {
#endif

#ifndef LAPACK_COMPLEX_CUSTOM
#if defined(_MSC_VER)
#define _CRT_USE_C_COMPLEX_H
#include <complex.h>
#define LAPACK_COMPLEX_CUSTOM
#define lapack_complex_float _Fcomplex
#define lapack_complex_double _Dcomplex
#define lapack_complex_float_real(z) (creal(z))
#define lapack_complex_float_imag(z) (cimag(z))
#define lapack_complex_double_real(z) (creal(z))
#define lapack_complex_double_imag(z) (cimag(z))
#else

#if defined(LAPACK_COMPLEX_STRUCTURE)

Expand Down Expand Up @@ -109,6 +120,7 @@ typedef struct { double real, imag; } _lapack_complex_double;
#define lapack_complex_double_real(z) (creal(z))
#define lapack_complex_double_imag(z) (cimag(z))

#endif
#endif

lapack_complex_float lapack_make_complex_float( float re, float im );
Expand Down

0 comments on commit dcdc351

Please sign in to comment.