Skip to content

Commit

Permalink
Add PGDLLEXPORT on exposed functions.
Browse files Browse the repository at this point in the history
The PG_FUNCTION_INFO_V1() marco also takes care of the extra annotation for the
generated info function but not the exposed function itself.

Similarly, the _PG_init() and _PG_fini() functions needs to be exported
(although the _PG_fini() is currently not called by postgres).

This should fix the runtime errors on Windows reported by github user suprimex.
  • Loading branch information
rjuju committed Jul 27, 2021
1 parent 5e1557a commit f21118f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Expand Up @@ -13,3 +13,4 @@
* github user seqizz
* github user akovac
* Romain DEP
* github user suprimex
20 changes: 10 additions & 10 deletions pg_qualstats.c
Expand Up @@ -106,18 +106,18 @@ typedef enum pgqsVersion

/*---- Function declarations ----*/

void _PG_init(void);
void _PG_fini(void);

extern Datum pg_qualstats_reset(PG_FUNCTION_ARGS);
extern Datum pg_qualstats(PG_FUNCTION_ARGS);
extern Datum pg_qualstats_2_0(PG_FUNCTION_ARGS);
extern Datum pg_qualstats_names(PG_FUNCTION_ARGS);
extern Datum pg_qualstats_names_2_0(PG_FUNCTION_ARGS);
extern PGDLLEXPORT void _PG_init(void);
extern PGDLLEXPORT void _PG_fini(void);

extern PGDLLEXPORT Datum pg_qualstats_reset(PG_FUNCTION_ARGS);
extern PGDLLEXPORT Datum pg_qualstats(PG_FUNCTION_ARGS);
extern PGDLLEXPORT Datum pg_qualstats_2_0(PG_FUNCTION_ARGS);
extern PGDLLEXPORT Datum pg_qualstats_names(PG_FUNCTION_ARGS);
extern PGDLLEXPORT Datum pg_qualstats_names_2_0(PG_FUNCTION_ARGS);
static Datum pg_qualstats_common(PG_FUNCTION_ARGS, pgqsVersion api_version,
bool include_names);
extern Datum pg_qualstats_example_query(PG_FUNCTION_ARGS);
extern Datum pg_qualstats_example_queries(PG_FUNCTION_ARGS);
extern PGDLLEXPORT Datum pg_qualstats_example_query(PG_FUNCTION_ARGS);
extern PGDLLEXPORT Datum pg_qualstats_example_queries(PG_FUNCTION_ARGS);

PG_FUNCTION_INFO_V1(pg_qualstats_reset);
PG_FUNCTION_INFO_V1(pg_qualstats);
Expand Down

0 comments on commit f21118f

Please sign in to comment.