summaryrefslogtreecommitdiff
path: root/crypt-port.h
diff options
context:
space:
mode:
authorBjörn Esser <besser82@fedoraproject.org>2018-10-25 21:30:34 +0200
committerBjörn Esser <besser82@fedoraproject.org>2018-10-25 22:10:45 +0200
commit85c40ce5a889a4d434c3dabc21b8e2538b9955b0 (patch)
tree2f0582ee1b63d92d5456f9b815514159b745ea04 /crypt-port.h
parent5815b3a3f47b298dea8f6f2173495675bbb150ca (diff)
downloadlibxcrypt-85c40ce5a889a4d434c3dabc21b8e2538b9955b0.tar.gz
libxcrypt-85c40ce5a889a4d434c3dabc21b8e2538b9955b0.tar.bz2
libxcrypt-85c40ce5a889a4d434c3dabc21b8e2538b9955b0.zip
Update sha512 implementation to recent revision.
Diffstat (limited to 'crypt-port.h')
-rw-r--r--crypt-port.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/crypt-port.h b/crypt-port.h
index fa30e8e..0093636 100644
--- a/crypt-port.h
+++ b/crypt-port.h
@@ -43,6 +43,12 @@
#define __THROW /* nothing */
#endif
+/* Version of __GNUC_PREREQ with trailing underscores for BSD
+ compatibility. */
+#ifndef __GNUC_PREREQ__
+# define __GNUC_PREREQ__(ma, mi) __GNUC_PREREQ(ma, mi)
+#endif
+
/* While actually compiling the library, suppress the __nonnull tags
on the functions in crypt.h, so that internal checks for NULL are
not deleted by the compiler. */
@@ -56,6 +62,18 @@
# define ARG_UNUSED(x) x
#endif
+/* C99 Static array indices in function parameter declarations. Syntax
+ such as: void bar(int myArray[static 10]); is allowed in C99, but
+ not all compiler support it properly. Define MIN_SIZE appropriately
+ so headers using it can be compiled using any compiler.
+ Use like this: void bar(int myArray[MIN_SIZE(10)]); */
+#if (defined(__clang__) || __GNUC_PREREQ__(4, 6)) && \
+ (!defined(__STDC_VERSION__) || (__STDC_VERSION__ >= 199901))
+#define MIN_SIZE(x) static (x)
+#else
+#define MIN_SIZE(x) (x)
+#endif
+
/* static_assert shim. */
#ifdef HAVE_STATIC_ASSERT_IN_ASSERT_H
/* nothing to do */