Skip to content

Commit

Permalink
try to fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
supermihi committed Jan 24, 2024
1 parent b56a970 commit b59cf5c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/ctypes.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,23 @@ cdef extern from 'taglib/tfile.h' namespace 'TagLib':

cdef extern from 'taglib/fileref.h' namespace 'TagLib':
cdef cppclass FileRef:
FileRef(const char*, boolean, ReadStyle) except +
FileRef(FileName, boolean, ReadStyle) except +
File* file()

AudioProperties *audioProperties()
bint save() except +
PropertyMap properties()
PropertyMap setProperties(PropertyMap&)
void removeUnsupportedProperties(StringList&)
cdef inline FileRef* create_wrapper(unicode path) except +:
cdef FileName fn = path.encode('utf-8')
return new FileRef(fn, True, ReadStyle.Average)
IF UNAME_SYSNAME != "Windows":
cdef inline FileRef* create_wrapper(unicode path) except +:
cdef FileName fn = path.encode('utf-8')
return new FileRef(fn, True, ReadStyle.Average)
ELSE:
cdef inline FileRef* create_wrapper(unicode path) except +:
cdef char* fn_bytes = path.encode('utf-8')
cdef FileName fn = FileName(fn_bytes)
return new FileRef(fn, True, ReadStyle.Average)

cdef extern from 'taglib/taglib.h':
int TAGLIB_MAJOR_VERSION
Expand Down

0 comments on commit b59cf5c

Please sign in to comment.