Skip to content

Commit

Permalink
Fix compilation with newer gccs
Browse files Browse the repository at this point in the history
  • Loading branch information
aroffringa committed Oct 24, 2023
1 parent 15edd89 commit bb52056
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions aartfaacms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <casacore/measures/Measures/MEpoch.h>

#include <array>
#include <stdexcept>
#include <sstream>

Expand Down
8 changes: 5 additions & 3 deletions aligned_ptr.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#ifndef ALIGNED_PTR_H
#define ALIGNED_PTR_H

#include <cstdlib>
#include <memory>
#include <stdexcept>

template<typename T>
using aligned_ptr = std::unique_ptr<T[], decltype(&free)>;
using aligned_ptr = std::unique_ptr<T[], decltype(&std::free)>;

template<typename T>
static aligned_ptr<T> empty_aligned()
{
return aligned_ptr<T>(nullptr, &free);
return aligned_ptr<T>(nullptr, &std::free);
}

template<typename T>
Expand All @@ -18,7 +20,7 @@ static aligned_ptr<T> make_aligned(size_t size, size_t align)
T* data = nullptr;
if(0 != posix_memalign((void**) &data, align, size*sizeof(T)))
throw std::runtime_error("Failed to allocate aligned memory");
return aligned_ptr<T>(data, &free);
return aligned_ptr<T>(data, &std::free);
}

#endif
3 changes: 2 additions & 1 deletion antennaconfig.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef ANTENNA_CONFIG_H
#define ANTENNA_CONFIG_H

#include <algorithm>
#include <algorithm>
#include <array>
#include <cctype>
#include <fstream>
#include <locale>
Expand Down

0 comments on commit bb52056

Please sign in to comment.