summaryrefslogtreecommitdiffstats
path: root/libc/upstream-openbsd/android/include/openbsd-compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/upstream-openbsd/android/include/openbsd-compat.h')
-rw-r--r--libc/upstream-openbsd/android/include/openbsd-compat.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/upstream-openbsd/android/include/openbsd-compat.h b/libc/upstream-openbsd/android/include/openbsd-compat.h
index 630094d..268b3b6 100644
--- a/libc/upstream-openbsd/android/include/openbsd-compat.h
+++ b/libc/upstream-openbsd/android/include/openbsd-compat.h
@@ -52,6 +52,10 @@
#define explicit_bzero(p, s) memset(p, 0, s)
+/* OpenBSD has these in <sys/param.h>, but "ALIGN" isn't something we want to reserve. */
+#define ALIGNBYTES (sizeof(uintptr_t) - 1)
+#define ALIGN(p) (((uintptr_t)(p) + ALIGNBYTES) &~ ALIGNBYTES)
+
/* We have OpenBSD's getentropy_linux.c, but we don't mention getentropy in any header. */
__LIBC_HIDDEN__ extern int getentropy(void*, size_t);