From 48a627885cbda9f68b2617c257c95485d3f7b359 Mon Sep 17 00:00:00 2001 From: Deluan Date: Sat, 13 Nov 2021 12:18:42 -0500 Subject: [PATCH] Simplify prototype definition for taglib_read --- scanner/metadata/taglib/taglib_wrapper.cpp | 6 +----- scanner/metadata/taglib/taglib_wrapper.h | 15 ++++++++------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/scanner/metadata/taglib/taglib_wrapper.cpp b/scanner/metadata/taglib/taglib_wrapper.cpp index 978bd6bce..ea7f72eab 100644 --- a/scanner/metadata/taglib/taglib_wrapper.cpp +++ b/scanner/metadata/taglib/taglib_wrapper.cpp @@ -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()) { diff --git a/scanner/metadata/taglib/taglib_wrapper.h b/scanner/metadata/taglib/taglib_wrapper.h index 7be62e2cd..d80ac1f83 100644 --- a/scanner/metadata/taglib/taglib_wrapper.h +++ b/scanner/metadata/taglib/taglib_wrapper.h @@ -5,15 +5,16 @@ extern "C" { #endif +#ifdef WIN32 +#define FILENAME_CHAR_T wchar_t +#else +#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); - -#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); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif