From d676a8e6d8daa29b943d21ffb8fd556a99a8f8bd Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.albe@wien.gv.at>
Date: Mon, 17 Oct 2016 16:42:33 +0200
Subject: [PATCH 1/2] Add PGDLLEXPORT to sample C function

This is needed for the sample to compile with MSVC.
---
 doc/src/sgml/xfunc.sgml |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml
index de6a466..cb527c0 100644
--- a/doc/src/sgml/xfunc.sgml
+++ b/doc/src/sgml/xfunc.sgml
@@ -2323,7 +2323,7 @@ PG_MODULE_MAGIC;
 
 /* by value */
 
-PG_FUNCTION_INFO_V1(add_one);
+PGDLLEXPORT PG_FUNCTION_INFO_V1(add_one);
 
 Datum
 add_one(PG_FUNCTION_ARGS)
@@ -2335,7 +2335,7 @@ add_one(PG_FUNCTION_ARGS)
 
 /* by reference, fixed length */
 
-PG_FUNCTION_INFO_V1(add_one_float8);
+PGDLLEXPORT PG_FUNCTION_INFO_V1(add_one_float8);
 
 Datum
 add_one_float8(PG_FUNCTION_ARGS)
@@ -2346,7 +2346,7 @@ add_one_float8(PG_FUNCTION_ARGS)
     PG_RETURN_FLOAT8(arg + 1.0);
 }
 
-PG_FUNCTION_INFO_V1(makepoint);
+PGDLLEXPORT PG_FUNCTION_INFO_V1(makepoint);
 
 Datum
 makepoint(PG_FUNCTION_ARGS)
@@ -2364,7 +2364,7 @@ makepoint(PG_FUNCTION_ARGS)
 
 /* by reference, variable length */
 
-PG_FUNCTION_INFO_V1(copytext);
+PGDLLEXPORT PG_FUNCTION_INFO_V1(copytext);
 
 Datum
 copytext(PG_FUNCTION_ARGS)
@@ -2384,7 +2384,7 @@ copytext(PG_FUNCTION_ARGS)
     PG_RETURN_TEXT_P(new_t);
 }
 
-PG_FUNCTION_INFO_V1(concat_text);
+PGDLLEXPORT PG_FUNCTION_INFO_V1(concat_text);
 
 Datum
 concat_text(PG_FUNCTION_ARGS)
@@ -2641,7 +2641,7 @@ c_overpaid(HeapTupleHeader t, /* the current row of emp */
 PG_MODULE_MAGIC;
 #endif
 
-PG_FUNCTION_INFO_V1(c_overpaid);
+PGDLLEXPORT PG_FUNCTION_INFO_V1(c_overpaid);
 
 Datum
 c_overpaid(PG_FUNCTION_ARGS)
@@ -3056,7 +3056,7 @@ my_set_returning_function(PG_FUNCTION_ARGS)
      A complete example of a simple <acronym>SRF</> returning a composite type
      looks like:
 <programlisting><![CDATA[
-PG_FUNCTION_INFO_V1(retcomposite);
+PGDLLEXPORT PG_FUNCTION_INFO_V1(retcomposite);
 
 Datum
 retcomposite(PG_FUNCTION_ARGS)
@@ -3210,7 +3210,7 @@ CREATE OR REPLACE FUNCTION retcomposite(IN integer, IN integer,
      element of any type, and return a one-dimensional array of that type:
 
 <programlisting>
-PG_FUNCTION_INFO_V1(make_array);
+PGDLLEXPORT PG_FUNCTION_INFO_V1(make_array);
 Datum
 make_array(PG_FUNCTION_ARGS)
 {
-- 
1.7.1

