aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-02-10 12:33:21 -0500
committerDavid Robillard <d@drobilla.net>2023-02-10 12:33:21 -0500
commit929509da52da29ce4d211ad488e580761885bfb0 (patch)
treedaa8aff94020ac085882f104d8ddfcd714ac75f9
parented56e89f4c447b37e8a18127f499cd74610fc393 (diff)
downloadpugl-929509da52da29ce4d211ad488e580761885bfb0.tar.gz
pugl-929509da52da29ce4d211ad488e580761885bfb0.tar.bz2
pugl-929509da52da29ce4d211ad488e580761885bfb0.zip
Factor out macros
-rw-r--r--src/macros.h15
-rw-r--r--src/x11.c9
2 files changed, 16 insertions, 8 deletions
diff --git a/src/macros.h b/src/macros.h
new file mode 100644
index 0000000..bb21e1b
--- /dev/null
+++ b/src/macros.h
@@ -0,0 +1,15 @@
+// Copyright 2016-2023 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef PUGL_SRC_MACROS_H
+#define PUGL_SRC_MACROS_H
+
+#ifndef MIN
+# define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#endif
+
+#ifndef MAX
+# define MAX(a, b) (((a) > (b)) ? (a) : (b))
+#endif
+
+#endif // PUGL_SRC_MACROS_H
diff --git a/src/x11.c b/src/x11.c
index b4f68a7..6c39cce 100644
--- a/src/x11.c
+++ b/src/x11.c
@@ -7,6 +7,7 @@
#include "attributes.h"
#include "internal.h"
+#include "macros.h"
#include "platform.h"
#include "types.h"
@@ -43,14 +44,6 @@
#include <time.h>
#include <unistd.h>
-#ifndef MIN
-# define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#endif
-
-#ifndef MAX
-# define MAX(a, b) (((a) > (b)) ? (a) : (b))
-#endif
-
#ifdef __cplusplus
# define PUGL_INIT_STRUCT \
{}