Skip to content

Commit

Permalink
issue #1: fix isnan compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
voidseg committed Jul 6, 2020
1 parent 7eb4e21 commit 41cbd4b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
24 changes: 10 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CXXFLAGS = -Ofast -std=c++11 -Wall -Wno-unused-function
LIBS = `pkg-config --libs jack` `pkg-config --libs libpulse` -pthread
INCLUDE = -I/usr/local/include/ -I/usr/include `pkg-config --cflags jack` `pkg-config --cflags libpulse`

GCC = g++
CXX = c++

JV_SOURCES = jack_volume.cpp
JV_OBJS = $(JV_SOURCES:.cpp=.o) /usr/local/lib/libOSC++.a
Expand All @@ -12,24 +12,20 @@ PAV_OBJS = $(PAV_SOURCES:.cpp=.o) /usr/local/lib/libOSC++.a
PAV_TARGET = pa-volume

all: $(JV_OBJS) $(PAV_OBJS)
$(GCC) -o $(JV_TARGET) $(JV_OBJS) $(LIBS)
$(GCC) -o $(PAV_TARGET) $(PAV_OBJS) $(LIBS)
$(CXX) -o $(JV_TARGET) $(JV_OBJS) $(LIBS)
$(CXX) -o $(PAV_TARGET) $(PAV_OBJS) $(LIBS)

install: $(JV_TARGET) $(PAV_TARGET)
cp -f $(JV_TARGET) /usr/local/bin/
cp -f $(PAV_TARGET) /usr/local/bin/
cp -f jvctl.py /usr/local/bin/jvctl
cp -f udp_dispatcher.py /usr/local/bin/udp_dispatcher
cp -f generic_connector.py /usr/local/bin/generic_connector
chmod a+rx /usr/local/bin/$(JV_TARGET)
chmod a+rx /usr/local/bin/$(PAV_TARGET)
chmod a+rx /usr/local/bin/jvctl
chmod a+rx /usr/local/bin/udp_dispatcher
chmod a+rx /usr/local/bin/generic_connector
install -d $(DESTDIR)/usr/local/bin
install $(JV_TARGET) $(DESTDIR)/usr/local/bin/
install $(PAV_TARGET) $(DESTDIR)/usr/local/bin/
install jvctl.py $(DESTDIR)/usr/local/bin/jvctl
install udp_dispatcher.py $(DESTDIR)/usr/local/bin/udp_dispatcher
install generic_connector.py $(DESTDIR)/usr/local/bin/generic_connector

clean:
rm -f $(JV_SOURCES:.cpp=.o) $(JV_TARGET)
rm -f $(PAV_SOURCES:.cpp=.o) $(PAV_TARGET)

%.o:%.cpp
$(GCC) $(CXXFLAGS) $(INCLUDE) -c $< -o $@
$(CXX) $(CXXFLAGS) $(INCLUDE) -c $< -o $@
4 changes: 3 additions & 1 deletion jack_volume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <cerrno>
#include <cstring>
#include <csignal>
#include <cmath>
#include <cfloat>
#include <string>
#include <stdexcept>
#include <iostream>
Expand Down Expand Up @@ -160,7 +162,7 @@ class jack_volume : public jack_client {
if (index < 0) {
return;
}
JV_ASSERT(!isnan(new_gain_lin), "new_gain_lin is not a number");
JV_ASSERT(!std::isnan(new_gain_lin), "new_gain_lin is not a number");
JV_ASSERT(index < (int32_t)channels_gain.size(), "channels_gain: index out of bounds: size=" + std::to_string(channels_gain.size()) + " index=" + std::to_string(index));
new_gain_lin = MIN(new_gain_lin, 10.0);
new_gain_lin = MAX(new_gain_lin, 0.0);
Expand Down

0 comments on commit 41cbd4b

Please sign in to comment.