aboutsummaryrefslogtreecommitdiffstats
path: root/src/macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h19
1 files changed, 19 insertions, 0 deletions
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