aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-11-25 15:57:31 +0100
committerMattias Andrée <maandree@kth.se>2018-11-25 15:57:35 +0100
commit077163f69b79d0055014afb1b4aaeb20c701d76e (patch)
treece91299028400d2c87acca90a3f36a5d195d6e50
parentAdd array.h (diff)
downloadlibsimple-077163f69b79d0055014afb1b4aaeb20c701d76e.tar.gz
libsimple-077163f69b79d0055014afb1b4aaeb20c701d76e.tar.bz2
libsimple-077163f69b79d0055014afb1b4aaeb20c701d76e.tar.xz
Add arraydup macros1.1
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libsimple/array.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/libsimple/array.h b/libsimple/array.h
index b31088c..3e8eab1 100644
--- a/libsimple/array.h
+++ b/libsimple/array.h
@@ -3,6 +3,54 @@
/* TODO test, doc, man */
+#define libsimple_arraydupa(array, alignment, n) libsimple_aligned_memdupa(array, _Alignof(*(array)), n)
+#ifndef aligned_arraydupa
+# define aligned_arraydupa(...) libsimple_aligned_arraydupa(__VA_ARGS__)
+#endif
+
+
+#define libsimple_arraydup(array, n) libsimple_aligned_memdup(array, _Alignof(*(array)), n)
+#ifndef arraydup
+# define arraydup(...) libsimple_arraydup(__VA_ARGS__)
+#endif
+
+
+#define libsimple_earraydup(array, n) libsimple_ealigned_memdup(array, _Alignof(*(array)), n)
+#ifndef earraydup
+# define earraydup(...) libsimple_earraydup(__VA_ARGS__)
+#endif
+
+
+#define libsimple_enarraydup(status, array, n) libsimple_enaligned_memdup(status, array, _Alignof(*(array)), n)
+#ifndef enarraydup
+# define enarraydup(...) libsimple_enarraydup(__VA_ARGS__)
+#endif
+
+
+#define libsimple_aligned_arraydupa(array, alignment, n) libsimple_aligned_memdupa(array, alignment, n)
+#ifndef aligned_arraydupa
+# define aligned_arraydupa(...) libsimple_aligned_arraydupa(__VA_ARGS__)
+#endif
+
+
+#define libsimple_aligned_arraydup(array, alignment, n) libsimple_aligned_memdup(array, alignment, n)
+#ifndef aligned_arraydup
+# define aligned_arraydup(...) libsimple_aligned_arraydup(__VA_ARGS__)
+#endif
+
+
+#define libsimple_ealigned_arraydup(array, alignment, n) libsimple_ealigned_memdup(array, alignment, n)
+#ifndef ealigned_arraydup
+# define ealigned_arraydup(...) libsimple_ealigned_arraydup(__VA_ARGS__)
+#endif
+
+
+#define libsimple_enaligned_arraydup(status, array, alignment, n) libsimple_enaligned_memdup(status, array, alignment, n)
+#ifndef enaligned_arraydup
+# define enaligned_arraydup(...) libsimple_enaligned_arraydup(__VA_ARGS__)
+#endif
+
+
#define libsimple_arrayelem(haystack, needle, n) libsimple_memelem(haystack, needle, sizeof *(haystack), n)
#ifndef arrayelem
# define arrayelem(...) libsimple_arrayelem(__VA_ARGS__)