aboutsummaryrefslogtreecommitdiffstats
path: root/include/internal/nelem.h
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2017-08-18 09:50:25 +1000
committerPauli <paul.dale@oracle.com>2017-08-18 09:50:25 +1000
commitb99fe5f4927b305bae88daac2484c284fe749329 (patch)
tree0497ffa8a2d0e0ea72ecca5d32d6878888835fd4 /include/internal/nelem.h
parent524fdd515569e12047ddb29ba4c7f19706aacc98 (diff)
downloadopenssl-b99fe5f4927b305bae88daac2484c284fe749329.tar.gz
Remove tests dependence on e_os.h
Apart from ssltest_old.c, the test suite relied on e_os.h for the OSSL_NELEM macro and nothing else. The ssltest_old.c also requires EXIT and some socket macros. Create a new header to define the OSSL_NELEM macro and use that instead. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4186)
Diffstat (limited to 'include/internal/nelem.h')
-rw-r--r--include/internal/nelem.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/internal/nelem.h b/include/internal/nelem.h
new file mode 100644
index 0000000000..d65a21a9fb
--- /dev/null
+++ b/include/internal/nelem.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef HEADER_NELEM_H
+# define HEADER_NELEM_H
+
+# define OSSL_NELEM(x) (sizeof(x)/sizeof((x)[0]))
+#endif