HAVE__STATIC_ASSERT was really a test for GCC statement expressions, as needed for StaticAssertExpr() now that _Static_assert could be assumed to be available through our C11 requirement. This artificially prevented Visual Studio from being able to use static_assert() in other contexts. Instead, make a new test for HAVE_STATEMENT_EXPRESSIONS, and use that to control only whether StaticAssertExpr() uses fallback code, not the other variants. This improves the quality of failure messages in the (much more common) other variants under Visual Studio. Also get rid of the two separate implementations for C++, since the C implementation is also also valid as C++11. While it is a stretch to apply HAVE_STATEMENT_EXPRESSIONS tested with $CC to a C++ compiler, the previous C++ coding assumed that the C++ compiler had them unconditionally, so it isn't a new stretch. In practice, the C and C++ compilers are very likely to agree, and if a combination is ever reported that falsifies this assumption we can always reconsider that. Author: Thomas Munro <thomas.munro@gmail.com> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://postgr.es/m/CA%2BhUKGKvr0x_oGmQTUkx%3DODgSksT2EtgCA6LmGx_jQFG%3DsDUpg%40mail.gmail.com
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.