Skip to content

Commit

Permalink
Merge pull request #2180 from cjee21/inform-define
Browse files Browse the repository at this point in the history
MediaInfo_Inform: Improve define guards
  • Loading branch information
JeromeMartinez authored Jan 29, 2025
2 parents d3214da + d31dfdd commit 04880aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 7 additions & 9 deletions Source/MediaInfo/MediaInfo_Inform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@
#include "MediaInfo/MediaInfo_Internal.h"
#include "MediaInfo/File__Analyze.h"
#include "ThirdParty/base64/base64.h"
# if defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES)
#include "MediaInfo/OutputHelpers.h"
#endif //MEDIAINFO_XML_YES || MEDIAINFO_JSON_YES

//---------------------------------------------------------------------------
#include <ctime>
Expand All @@ -63,7 +61,6 @@ namespace MediaInfoLib
{

//---------------------------------------------------------------------------
#if defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES)
Ztring Xml_Name_Escape_0_7_78 (const Ztring &Name)
{
Ztring ToReturn(Name);
Expand Down Expand Up @@ -97,7 +94,6 @@ Ztring Xml_Name_Escape_0_7_78 (const Ztring &Name)

return ToReturn;
}
#endif //defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES)

//---------------------------------------------------------------------------
std::string URL_Encoded_Encode(const std::string& URL);
Expand Down Expand Up @@ -636,7 +632,7 @@ Ztring MediaInfo_Internal::Inform()
}

//---------------------------------------------------------------------------
#if defined(MEDIAINFO_TEXT_YES) || defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES) || defined(MEDIAINFO_CUSTOM_YES)
#if defined(MEDIAINFO_TEXT_YES) || defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES) || defined(MEDIAINFO_CSV_YES) || defined(MEDIAINFO_CUSTOM_YES)
#if defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES)
namespace
{
Expand Down Expand Up @@ -685,7 +681,7 @@ Ztring MediaInfo_Internal::Inform (stream_t StreamKind, size_t StreamPos, bool I
#if defined(MEDIAINFO_CSV_YES)
bool CSV=MediaInfoLib::Config.Inform_Get()==__T("CSV")?true:false;
#endif //defined(MEDIAINFO_CSV_YES)
#if defined(MEDIAINFO_TEXT_YES) && (defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES))
#if defined(MEDIAINFO_TEXT_YES) && (defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES) || defined(MEDIAINFO_CSV_YES))
bool Text=true;
#if defined(MEDIAINFO_HTML_YES)
if (HTML)
Expand Down Expand Up @@ -856,12 +852,13 @@ Ztring MediaInfo_Internal::Inform (stream_t StreamKind, size_t StreamPos, bool I
}

//Handling ISO-6709 location data for Text and HTML display
#if defined(MEDIAINFO_TEXT_YES) || defined(MEDIAINFO_HTML_YES)
bool TextOrHTML = false;
#if defined(MEDIAINFO_TEXT_YES) && (defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES))
#if defined(MEDIAINFO_TEXT_YES) && (defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES) || defined(MEDIAINFO_CSV_YES))
if (Text) TextOrHTML = true;
#else
#elif !(defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES) || defined(MEDIAINFO_CSV_YES))
TextOrHTML = true;
#endif // defined(MEDIAINFO_TEXT_YES) && (defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES))
#endif // defined(MEDIAINFO_TEXT_YES) && (defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES) || defined(MEDIAINFO_CSV_YES))
#if defined(MEDIAINFO_HTML_YES)
if (HTML) TextOrHTML = true;
#endif // defined(MEDIAINFO_HTML_YES)
Expand All @@ -872,6 +869,7 @@ Ztring MediaInfo_Internal::Inform (stream_t StreamKind, size_t StreamPos, bool I
if (std::regex_match(ISO6709, match, pattern))
Valeur.From_UTF8(match[1].str() + " " + match[2].str() + " " + match[3].str() + " " + match[4].str());
}
#endif // defined(MEDIAINFO_TEXT_YES) || defined(MEDIAINFO_HTML_YES)

#if defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES)
if ((XML_0_7_78 || JSON) && MediaInfoLib::Config.Info_Get(StreamKind).Read(Champ_Pos, Info_Measure)==__T(" ms"))
Expand Down
2 changes: 1 addition & 1 deletion Source/MediaInfo/MediaInfo_Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public :

//General information
Ztring Inform ();
#if defined(MEDIAINFO_TEXT_YES) || defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES) || defined(MEDIAINFO_CUSTOM_YES)
#if defined(MEDIAINFO_TEXT_YES) || defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_JSON_YES) || defined(MEDIAINFO_CSV_YES) || defined(MEDIAINFO_CUSTOM_YES)
Ztring Inform (stream_t StreamKind, size_t StreamNumber, bool IsDirect); //All about only a specific stream
#endif

Expand Down

0 comments on commit 04880aa

Please sign in to comment.