Skip to content

Commit

Permalink
Simplify prototype definition for taglib_read
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Nov 13, 2021
1 parent 91b470c commit 48a6278
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
6 changes: 1 addition & 5 deletions scanner/metadata/taglib/taglib_wrapper.cpp
Expand Up @@ -17,11 +17,7 @@

char has_cover(const TagLib::FileRef f);

#ifdef WIN32
int taglib_read(const wchar_t *filename, unsigned long id) {
#else
int taglib_read(const char *filename, unsigned long id) {
#endif
int taglib_read(const FILENAME_CHAR_T *filename, unsigned long id) {
TagLib::FileRef f(filename, true, TagLib::AudioProperties::Fast);

if (f.isNull()) {
Expand Down
13 changes: 7 additions & 6 deletions scanner/metadata/taglib/taglib_wrapper.h
Expand Up @@ -5,15 +5,16 @@
extern "C" {
#endif

extern void go_map_put_str(unsigned long id, char *key, char *val);
extern void go_map_put_int(unsigned long id, char *key, int val);

#ifdef WIN32
int taglib_read(const wchar_t *filename, unsigned long id);
#define FILENAME_CHAR_T wchar_t
#else
int taglib_read(const char *filename, unsigned long id);
#define FILENAME_CHAR_T char
#endif

extern void go_map_put_str(unsigned long id, char *key, char *val);
extern void go_map_put_int(unsigned long id, char *key, int val);
int taglib_read(const FILENAME_CHAR_T *filename, unsigned long id);

#ifdef __cplusplus
}
#endif
#endif

0 comments on commit 48a6278

Please sign in to comment.