aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2016-10-18 23:20:49 +0000
committerAlan Somers <asomers@FreeBSD.org>2016-10-18 23:20:49 +0000
commit8254c3c5d310873f9cb5a08089801f50ca5e04c0 (patch)
tree4d80ff05ed28ceb66321809f11a87e9b4e1b87be /lib
parent21e609c4aa5017765100f7b6c69ab4950737e951 (diff)
downloadsrc-8254c3c5d310873f9cb5a08089801f50ca5e04c0.tar.gz
src-8254c3c5d310873f9cb5a08089801f50ca5e04c0.zip
Fix C++ includability of crypto headers with static array sizes
C99 allows array function parameters to use the static keyword for their sizes. This tells the compiler that the parameter will have at least the specified size, and calling code will fail to compile if that guarantee is not met. However, this syntax is not legal in C++. This commit reverts r300824, which worked around the problem for sys/sys/md5.h only, and introduces a new macro: min_size(). min_size(x) can be used in headers as a static array size, but will still compile in C++ mode. Reviewed by: cem, ed MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8277
Notes
Notes: svn path=/head/; revision=307584
Diffstat (limited to 'lib')
-rw-r--r--lib/libmd/md5.h8
1 files changed, 0 insertions, 8 deletions
diff --git a/lib/libmd/md5.h b/lib/libmd/md5.h
index a109a7f952e9..631dec819e79 100644
--- a/lib/libmd/md5.h
+++ b/lib/libmd/md5.h
@@ -43,13 +43,5 @@
#endif
-#ifdef __cplusplus
-#define static
-#endif
-
#include <sys/md5.h>
-
-#ifdef __cplusplus
-#undef static
-#endif
#endif /* _MD5_H_ */