Skip to content

Commit

Permalink
Fix build on Windows with PostgreSQL < 10
Browse files Browse the repository at this point in the history
Windows doesn't allow undefined functions, so that declaration isn't enough,
but a dummy function has to be defined.
  • Loading branch information
larskanis committed Jan 3, 2018
1 parent 5d32344 commit 796475b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ext/gvl_wrappers.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

#include "pg.h"

#ifndef HAVE_PQENCRYPTPASSWORDCONN
char *PQencryptPasswordConn(PGconn *conn, const char *passwd, const char *user, const char *algorithm){return NULL;}
#endif

FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_WRAPPER_STRUCT );
FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_SKELETON );
FOR_EACH_BLOCKING_FUNCTION( DEFINE_GVL_STUB );
Expand Down
4 changes: 0 additions & 4 deletions ext/gvl_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ extern void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
rb_unblock_function_t *ubf, void *data2);
#endif

#ifndef HAVE_PQENCRYPTPASSWORDCONN
extern char *PQencryptPasswordConn(PGconn *conn, const char *passwd, const char *user, const char *algorithm);
#endif

#define DEFINE_PARAM_LIST1(type, name) \
name,

Expand Down

0 comments on commit 796475b

Please sign in to comment.