aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/jalv.c13
-rw-r--r--src/macros.h19
2 files changed, 20 insertions, 12 deletions
diff --git a/src/jalv.c b/src/jalv.c
index eb6545a..a55d7a6 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -9,6 +9,7 @@
#include "jalv_internal.h"
#include "log.h"
#include "lv2_evbuf.h"
+#include "macros.h"
#include "nodes.h"
#include "port.h"
#include "state.h"
@@ -55,18 +56,6 @@
#include <stdlib.h>
#include <string.h>
-#ifndef MIN
-# define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#endif
-
-#ifndef MAX
-# define MAX(a, b) (((a) > (b)) ? (a) : (b))
-#endif
-
-#ifndef ARRAY_SIZE
-# define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
-#endif
-
/**
Size factor for UI ring buffers.
diff --git a/src/macros.h b/src/macros.h
new file mode 100644
index 0000000..509a75c
--- /dev/null
+++ b/src/macros.h
@@ -0,0 +1,19 @@
+// Copyright 2012-2024 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef JALV_MACROS_H
+#define JALV_MACROS_H
+
+#ifndef MIN
+# define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#endif
+
+#ifndef MAX
+# define MAX(a, b) (((a) > (b)) ? (a) : (b))
+#endif
+
+#ifndef ARRAY_SIZE
+# define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+#endif
+
+#endif // JALV_MACROS_H