aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-11-16 13:16:45 -0500
committerDavid Robillard <d@drobilla.net>2024-11-24 19:02:59 -0500
commiteac84848484e314858d331fe707559453e0abe26 (patch)
treeed61b88e1a69fc9434af1cb315bf3e5807ec7da4
parent245c93daa3b902a1a9267069df9e632cede6a018 (diff)
downloadjalv-eac84848484e314858d331fe707559453e0abe26.tar.gz
jalv-eac84848484e314858d331fe707559453e0abe26.tar.bz2
jalv-eac84848484e314858d331fe707559453e0abe26.zip
Move utility macros to a separate file
-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