]> sourceware.org Git - newlib-cygwin.git/commit
Fix C++ includability of crypto headers with static array sizes
authorasomers <asomers@FreeBSD.org>
Tue, 4 Apr 2017 07:04:54 +0000 (09:04 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 4 Apr 2017 09:44:02 +0000 (11:44 +0200)
commit84a6dba57ed351a275889a3e8c87f566e3b3e508
tree621f7726ee2488fb7841206b28b018ef9e7a256f
parente0dabc0e8dd6d9e2a21ceef124a1e4bf9f3d8aa3
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/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

fix a typo in __STDC_VERSION__ in __min_size requirements

MFC after: 1 week
Sponsored by: Panzura
newlib/libc/include/sys/cdefs.h
This page took 0.02925 seconds and 5 git commands to generate.