Skip to content

Commit

Permalink
Add #include <algorithm> to fix building with gcc 14
Browse files Browse the repository at this point in the history
With gcc 14 some C++ Standard Library headers have been changed to no
longer include other headers that were used internally by the library.
In gerbera's case it is the <algorithm> header.

Downstream Gentoo bug: https://bugs.gentoo.org/917136

GCC 14 porting guide: https://gcc.gnu.org/gcc-14/porting_to.html#header-dep-changes

Closes: #2897

Signed-off-by: Kostadin Shishmanov <kocelfc@tutanota.com>
  • Loading branch information
kostadinsh authored and KarlStraussberger committed Nov 16, 2023
1 parent c5c56df commit 5664ad1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cds/cds_objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#ifndef __CDS_OBJECTS_H__
#define __CDS_OBJECTS_H__

#include <algorithm>
#include <map>
#include <memory>
#include <vector>
Expand Down
2 changes: 2 additions & 0 deletions src/iohandler/io_handler_buffer_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

#include "config/config_manager.h"

#include <algorithm>

IOHandlerBufferHelper::IOHandlerBufferHelper(std::shared_ptr<Config> config, std::size_t bufSize, std::size_t initialFillSize)
: config(std::move(config))
, bufSize(bufSize)
Expand Down
2 changes: 2 additions & 0 deletions src/iohandler/mem_io_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

#include "mem_io_handler.h" // API

#include <algorithm>

MemIOHandler::MemIOHandler(const void* buffer, int length)
: buffer(new char[length])
, length(length)
Expand Down
1 change: 1 addition & 0 deletions src/util/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#ifndef __TOOLS_H__
#define __TOOLS_H__

#include <algorithm>
#include <map>
#include <optional>
#include <vector>
Expand Down
2 changes: 2 additions & 0 deletions src/util/upnp_clients.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

#include <upnp.h>

#include <algorithm>

std::shared_ptr<ClientStatusDetail> ClientStatusDetail::clone() const
{
return std::make_shared<ClientStatusDetail>(group, itemId, playCount, lastPlayed.count(), lastPlayedPosition.count(), bookMarkPos.count());
Expand Down

0 comments on commit 5664ad1

Please sign in to comment.