Skip to content

Commit

Permalink
Safpy_build: switch typedef complex on win32
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-hld committed Feb 6, 2024
1 parent d91f656 commit ffff16a
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions safpy_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

# Sensible default, please adjust if needed.
# In case of doubt, you can also check numpy.show_config() for its BLAS
print("Detected platform: " + sys.platform)
if sys.platform == "darwin":
print("SAFPY using default Apple Accelerate")
extra_link_args.extend(['-Wl,-framework', '-Wl,Accelerate'])
Expand All @@ -32,17 +33,32 @@
ffibuilder.cdef("""
#define SAF_VERSION ...
""")

if sys.platform != "win32":
ffibuilder.cdef("""
typedef float _Complex float_complex;
typedef double _Complex double_complex;
""")
else:
ffibuilder.cdef("""
typedef _Fcomplex float_complex;
typedef _Dcomplex double_complex;
typedef float _Complex float_complex;
typedef double _Complex double_complex;
""")

ffibuilder.cdef("""
typedef enum _AFSTFT_FDDATA_FORMAT{
AFSTFT_BANDS_CH_TIME, /**< nBands x nChannels x nTimeHops */
AFSTFT_TIME_CH_BANDS /**< nTimeHops x nChannels x nBands */
}AFSTFT_FDDATA_FORMAT;
void *malloc(size_t size);
void free(void *ptr);
Expand Down

0 comments on commit ffff16a

Please sign in to comment.