aboutsummaryrefslogtreecommitdiffstats
path: root/src/replay_gain_info.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/replay_gain_info.h')
-rw-r--r--src/replay_gain_info.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/replay_gain_info.h b/src/replay_gain_info.h
index 9097c3e02..b06dc6cf0 100644
--- a/src/replay_gain_info.h
+++ b/src/replay_gain_info.h
@@ -22,8 +22,12 @@
#include "check.h"
+#ifdef __cplusplus
+#include <cmath>
+#else
#include <stdbool.h>
#include <math.h>
+#endif
enum replay_gain_mode {
REPLAY_GAIN_AUTO = -2,
@@ -58,9 +62,17 @@ replay_gain_info_init(struct replay_gain_info *info)
static inline bool
replay_gain_tuple_defined(const struct replay_gain_tuple *tuple)
{
+#ifdef __cplusplus
+ return !std::isinf(tuple->gain);
+#else
return !isinf(tuple->gain);
+#endif
}
+#ifdef __cplusplus
+extern "C" {
+#endif
+
float
replay_gain_tuple_scale(const struct replay_gain_tuple *tuple, float preamp, float missing_preamp, bool peak_limit);
@@ -71,4 +83,8 @@ replay_gain_tuple_scale(const struct replay_gain_tuple *tuple, float preamp, flo
void
replay_gain_info_complete(struct replay_gain_info *info);
+#ifdef __cplusplus
+}
+#endif
+
#endif