From efd5fa2f17d343da4d6acacc88b3795868969c34 Mon Sep 17 00:00:00 2001 From: Urs Fleisch Date: Sat, 1 Feb 2025 15:39:24 +0100 Subject: [PATCH] Do not use config.h in public header files (#1262) Clients do not have this file and they do not have HAVE_CONFIG_H set, so the header files must be independent of the compile time configuration of supported formats. --- taglib/mpeg/mpegfile.cpp | 10 ++++++++-- taglib/mpeg/mpegfile.h | 6 ------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/taglib/mpeg/mpegfile.cpp b/taglib/mpeg/mpegfile.cpp index c7567ed3..fd10e91f 100644 --- a/taglib/mpeg/mpegfile.cpp +++ b/taglib/mpeg/mpegfile.cpp @@ -25,6 +25,10 @@ #include "mpegfile.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "id3v2framefactory.h" #include "tdebug.h" #include "tpropertymap.h" @@ -323,12 +327,14 @@ ID3v1::Tag *MPEG::File::ID3v1Tag(bool create) return d->tag.access(ID3v1Index, create); } -#ifdef WITH_APE APE::Tag *MPEG::File::APETag(bool create) { +#ifdef WITH_APE return d->tag.access(APEIndex, create); -} +#else + return nullptr; #endif +} bool MPEG::File::strip(int tags, bool freeMemory) { diff --git a/taglib/mpeg/mpegfile.h b/taglib/mpeg/mpegfile.h index c3547cee..bff35b4d 100644 --- a/taglib/mpeg/mpegfile.h +++ b/taglib/mpeg/mpegfile.h @@ -26,10 +26,6 @@ #ifndef TAGLIB_MPEGFILE_H #define TAGLIB_MPEGFILE_H -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "tfile.h" #include "taglib_export.h" #include "tag.h" @@ -270,7 +266,6 @@ namespace TagLib { */ ID3v1::Tag *ID3v1Tag(bool create = false); -#ifdef WITH_APE /*! * Returns a pointer to the APE tag of the file. * @@ -289,7 +284,6 @@ namespace TagLib { * \see hasAPETag() */ APE::Tag *APETag(bool create = false); -#endif /*! * This will strip the tags that match the OR-ed together TagTypes from the