From 2f20a8f44fce9d579de2a9a79fe37e438162b01d Mon Sep 17 00:00:00 2001 From: Miller Puckette Date: Sat, 11 Dec 2021 09:12:21 -0800 Subject: [PATCH] add patches to pd --- ...-m_local.h-include-if-PD-not-defined.patch | 28 ++++++++++++++++++ ...02-fix-expr-to-default-to-Pd-not-Max.patch | 29 +++++++++++++++++++ patches/0003-add-m_local.h.patch | 26 +++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 patches/0001-add-m_local.h-include-if-PD-not-defined.patch create mode 100644 patches/0002-fix-expr-to-default-to-Pd-not-Max.patch create mode 100644 patches/0003-add-m_local.h.patch diff --git a/patches/0001-add-m_local.h-include-if-PD-not-defined.patch b/patches/0001-add-m_local.h-include-if-PD-not-defined.patch new file mode 100644 index 0000000..12afca6 --- /dev/null +++ b/patches/0001-add-m_local.h-include-if-PD-not-defined.patch @@ -0,0 +1,28 @@ +From 84634c46b1764e0f97d6ef4685cf7e46a9c521d1 Mon Sep 17 00:00:00 2001 +From: Miller Puckette +Date: Tue, 24 Aug 2021 22:02:38 -0700 +Subject: [PATCH 1/3] add m_local.h include if PD not defined + +--- + src/m_pd.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/m_pd.h b/src/m_pd.h +index 18110cb1..6a18a3a2 100644 +--- a/src/m_pd.h ++++ b/src/m_pd.h +@@ -6,6 +6,11 @@ + + #if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) + extern "C" { ++#endif ++ ++ /* if you can't get the build system to add defs, you can do it this way */ ++#ifndef PD ++#include "m_local.h" + #endif + + #define PD_MAJOR_VERSION 0 +-- +2.33.1 + diff --git a/patches/0002-fix-expr-to-default-to-Pd-not-Max.patch b/patches/0002-fix-expr-to-default-to-Pd-not-Max.patch new file mode 100644 index 0000000..f831a28 --- /dev/null +++ b/patches/0002-fix-expr-to-default-to-Pd-not-Max.patch @@ -0,0 +1,29 @@ +From 3f588704ada99d43f639f5b6f1af05edf9c29794 Mon Sep 17 00:00:00 2001 +From: Miller Puckette +Date: Tue, 24 Aug 2021 22:04:54 -0700 +Subject: [PATCH 2/3] fix expr to default to Pd, not Max + +--- + src/x_vexp.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/x_vexp.h b/src/x_vexp.h +index a41e9d8c..5e17a03c 100644 +--- a/src/x_vexp.h ++++ b/src/x_vexp.h +@@ -5,9 +5,9 @@ + /* "expr" was written by Shahrokh Yadegari c. 1989. -msp */ + /* "expr~" and "fexpr~" conversion by Shahrokh Yadegari c. 1999,2000 */ + +-#define MSP +-#ifdef PD +-#undef MSP ++#define PD ++#ifdef MSP ++#undef PD + #endif + + #ifdef PD +-- +2.33.1 + diff --git a/patches/0003-add-m_local.h.patch b/patches/0003-add-m_local.h.patch new file mode 100644 index 0000000..96d3315 --- /dev/null +++ b/patches/0003-add-m_local.h.patch @@ -0,0 +1,26 @@ +From bbd91ed103574b92de99a0d04ef23b22a2cec27f Mon Sep 17 00:00:00 2001 +From: Miller Puckette +Date: Fri, 10 Dec 2021 21:17:37 -0800 +Subject: [PATCH 3/3] add m_local.h + +--- + src/m_local.h | 7 +++++++ + 1 file changed, 7 insertions(+) + create mode 100644 src/m_local.h + +diff --git a/src/m_local.h b/src/m_local.h +new file mode 100644 +index 00000000..e2bb0a54 +--- /dev/null ++++ b/src/m_local.h +@@ -0,0 +1,7 @@ ++#define PD ++#define HAVE_UNISTD_H ++#define HAVE_ALLOCA_H ++#define PD_HEADLESS ++#define SYMTABHASHSIZE 512 ++#define STUPID_SORT ++#define SSIZE_MAX INT_MAX +-- +2.33.1 +