diff --git a/Makefile b/Makefile index 41caa048..0aa516a9 100644 --- a/Makefile +++ b/Makefile @@ -10,11 +10,12 @@ include arch.mk ifeq ($(ARCH), lin) SOURCES += ext/osdialog/osdialog_gtk2.c - CFLAGS += $(shell pkg-config --cflags gtk+-2.0) + CFLAGS += $(shell pkg-config --cflags gtk+-2.0 gl glew glfw3 jansson libzip portaudio-2.0 samplerate) + CXXFLAGS += $(shell pkg-config --cflags gl glew glfw3 jansson libzip portaudio-2.0 samplerate) LDFLAGS += -rdynamic \ - -lpthread -lGL -ldl \ - $(shell pkg-config --libs gtk+-2.0) \ - -Ldep/lib -lGLEW -lglfw -ljansson -lsamplerate -lcurl -lzip -lportaudio -lportmidi + -lpthread -ldl \ + $(shell pkg-config --libs gtk+-2.0 gl glew glfw3 jansson libzip portaudio-2.0 samplerate) \ + -Ldep/lib -lcurl -lportmidi TARGET = Rack endif diff --git a/include/math.hpp b/include/math.hpp index 134546d3..3b50e5e0 100644 --- a/include/math.hpp +++ b/include/math.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include namespace rack { @@ -182,7 +182,7 @@ struct Vec { return Vec(roundf(x), roundf(y)); } bool isFinite() { - return isfinite(x) && isfinite(y); + return std::isfinite(x) && std::isfinite(y); } bool isZero() { return x == 0.0 && y == 0.0; diff --git a/src/gui.cpp b/src/gui.cpp index e7d9e3b0..07b72432 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -22,6 +22,10 @@ #include #endif +#if GLFW_VERSION_MINOR == 0 && GLFW_VERSION_REVISION <= 4 +#define OLD_GLFW_VERSION +#endif + namespace rack { static GLFWwindow *window = NULL; @@ -235,7 +239,9 @@ void guiInit() { // glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); // glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); +#ifndef OLD_GLFW_VERSION glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE); +#endif std::string title = gApplicationName + " " + gApplicationVersion; window = glfwCreateWindow(1000, 750, title.c_str(), NULL, NULL); assert(window); @@ -262,7 +268,9 @@ void guiInit() { // GLEW generates GL error because it calls glGetString(GL_EXTENSIONS), we'll consume it here. glGetError(); +#ifndef OLD_GLFW_VERSION glfwSetWindowSizeLimits(window, 640, 480, GLFW_DONT_CARE, GLFW_DONT_CARE); +#endif // Set up NanoVG gVg = nvgCreateGL2(NVG_ANTIALIAS); diff --git a/src/plugin.cpp b/src/plugin.cpp index 5da33e38..46f61f99 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -23,6 +23,11 @@ #include "plugin.hpp" #include "util/request.hpp" +#if LIBZIP_VERSION_MAJOR == 0 && LIBZIP_VERSION_MINOR <= 10 +typedef zip zip_t; +typedef zip_file zip_file_t; +typedef struct zip_stat zip_stat_t; +#endif namespace rack { @@ -131,7 +136,7 @@ static void extractZip(const char *filename, const char *dir) { if (!za) return; if (err) goto cleanup; - for (int i = 0; i < zip_get_num_entries(za, 0); i++) { + for (zip_uint64_t i = 0; i < zip_get_num_entries(za, 0); i++) { zip_stat_t zs; err = zip_stat_index(za, i, 0, &zs); if (err) goto cleanup;