aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2017-10-11 17:16:16 -0700
committerAndres Freund <andres@anarazel.de>2017-10-11 17:23:23 -0700
commit060b069984a69ff0255ce318f10681c553613bef (patch)
tree0b08d43b5e911ceaefa6995d1917c09ab617ff66 /src
parent4c119fbcd49ba882791c7b99a1e934b985468e9f (diff)
downloadpostgresql-060b069984a69ff0255ce318f10681c553613bef.tar.gz
postgresql-060b069984a69ff0255ce318f10681c553613bef.zip
Work around overly strict restrict checks by MSVC.
Apparently MSVC requires a * before a restrict in a variable declaration, even if the adorned type already is a pointer, just via typedef. As reported by buildfarm animal woodlouse. Author: Andres Freund Discussion: https://postgr.es/m/20171012001320.4putagiruuehtvb6@alap3.anarazel.de
Diffstat (limited to 'src')
-rw-r--r--src/include/libpq/pqformat.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/include/libpq/pqformat.h b/src/include/libpq/pqformat.h
index 9a546b48915..2329669b085 100644
--- a/src/include/libpq/pqformat.h
+++ b/src/include/libpq/pqformat.h
@@ -42,9 +42,12 @@ extern void pq_sendfloat8(StringInfo buf, float8 f);
* assumption that buf, buf->len, buf->data and *buf->data don't
* overlap. Without the annotation buf->len etc cannot be kept in a register
* over subsequent pq_writeint* calls.
+ *
+ * The use of StringInfoData * rather than StringInfo is due to MSVC being
+ * overly picky and demanding a * before a restrict.
*/
static inline void
-pq_writeint8(StringInfo restrict buf, int8 i)
+pq_writeint8(StringInfoData * restrict buf, int8 i)
{
int8 ni = i;
@@ -58,7 +61,7 @@ pq_writeint8(StringInfo restrict buf, int8 i)
* preallocated.
*/
static inline void
-pq_writeint16(StringInfo restrict buf, int16 i)
+pq_writeint16(StringInfoData * restrict buf, int16 i)
{
int16 ni = pg_hton16(i);
@@ -72,7 +75,7 @@ pq_writeint16(StringInfo restrict buf, int16 i)
* preallocated.
*/
static inline void
-pq_writeint32(StringInfo restrict buf, int32 i)
+pq_writeint32(StringInfoData * restrict buf, int32 i)
{
int32 ni = pg_hton32(i);
@@ -86,7 +89,7 @@ pq_writeint32(StringInfo restrict buf, int32 i)
* preallocated.
*/
static inline void
-pq_writeint64(StringInfo restrict buf, int64 i)
+pq_writeint64(StringInfoData * restrict buf, int64 i)
{
int64 ni = pg_hton64(i);
@@ -106,7 +109,7 @@ pq_writeint64(StringInfo restrict buf, int64 i)
* sent to the frontend.
*/
static inline void
-pq_writestring(StringInfo restrict buf, const char *restrict str)
+pq_writestring(StringInfoData * restrict buf, const char *restrict str)
{
int slen = strlen(str);
char *p;