Skip to content

Commit

Permalink
rsgain: fix the build after legacysupport added
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 authored and reneeotten committed Dec 7, 2024
1 parent e84f95b commit d31a895
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions audio/rsgain/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ depends_lib-append port:ffmpeg \
port:libebur128 \
port:taglib

# https://github.com/complexlogic/rsgain/pull/140
patchfiles-append 0001-rsgain.cpp-use-C-cmath.patch

configure.args-append -DUSE_STD_FORMAT=ON

compiler.cxx_standard 2020
Expand Down
32 changes: 32 additions & 0 deletions audio/rsgain/files/0001-rsgain.cpp-use-C-cmath.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From b9611ea0679919cbc0ea241eb8b3de2d45a3b007 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Sat, 7 Dec 2024 06:48:57 +0800
Subject: [PATCH] rsgain.cpp: use C++ cmath

---
src/rsgain.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git src/rsgain.cpp src/rsgain.cpp
index 54f377f..b30ee6d 100644
--- src/rsgain.cpp
+++ src/rsgain.cpp
@@ -33,8 +33,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <math.h>
#include <getopt.h>
+#include <cmath>
#include <string>
#include <locale>

@@ -150,7 +150,7 @@ bool parse_max_peak_level(const char *value, double &peak)
{
char *rest = nullptr;
double max_peak = strtod(value, &rest);
- if (rest == value || !isfinite(max_peak)) {
+ if (rest == value || !std::isfinite(max_peak)) {
output_error("Invalid max peak level '{}'", value);
return false;
}

0 comments on commit d31a895

Please sign in to comment.