From 05fac2dac33e9cd3938618ec8bbb442bc4d8bd29 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Fri, 3 Feb 2017 14:38:31 +0100 Subject: [PATCH] fix compilation with msvc __attribute__ macro is not defined in msvc and it is not essential to the implementation. All it does is tell the compiler that this function is similar to printf, and expects a printf-like format string So for MSVC we define __attribute__ as a macro that do nothing --- bin/pgut/pgut.h | 4 ++++ lib/pgut/pgut-spi.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/bin/pgut/pgut.h b/bin/pgut/pgut.h index c33f389..e8816d3 100644 --- a/bin/pgut/pgut.h +++ b/bin/pgut/pgut.h @@ -24,6 +24,10 @@ #define INFINITE_STR "INFINITE" +#ifdef _MSC_VER +#define __attribute__(x) +#endif + typedef enum YesNo { DEFAULT, diff --git a/lib/pgut/pgut-spi.h b/lib/pgut/pgut-spi.h index 5406b36..c5ce52f 100644 --- a/lib/pgut/pgut-spi.h +++ b/lib/pgut/pgut-spi.h @@ -12,6 +12,10 @@ #include "executor/spi.h" +#ifdef _MSC_VER +#define __attribute__(x) +#endif + extern void execute(int expected, const char *sql); extern void execute_plan(int expected, SPIPlanPtr plan, Datum *values, const char *nulls); extern void execute_with_format(int expected, const char *format, ...)