diff options
Diffstat (limited to 'src/interfaces')
| -rw-r--r-- | src/interfaces/libpq-oauth/meson.build | 2 | ||||
| -rw-r--r-- | src/interfaces/libpq/libpq-fe.h | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/interfaces/libpq-oauth/meson.build b/src/interfaces/libpq-oauth/meson.build index 505e1671b86..881e3f24f10 100644 --- a/src/interfaces/libpq-oauth/meson.build +++ b/src/interfaces/libpq-oauth/meson.build @@ -40,7 +40,7 @@ libpq_oauth_name = 'libpq-oauth-@0@'.format(pg_version_major) libpq_oauth_so = shared_module(libpq_oauth_name, libpq_oauth_sources + libpq_oauth_so_sources, include_directories: [libpq_oauth_inc, postgres_inc], - c_args: libpq_so_c_args, + c_args: libpq_oauth_so_c_args, c_pch: pch_postgres_fe_h, dependencies: [frontend_shlib_code, libpq, libpq_oauth_deps], link_depends: export_file, diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h index 0852584edae..877a6483b34 100644 --- a/src/interfaces/libpq/libpq-fe.h +++ b/src/interfaces/libpq/libpq-fe.h @@ -738,11 +738,15 @@ typedef struct _PGpromptOAuthDevice int expires_in; /* seconds until user code expires */ } PGpromptOAuthDevice; -/* for PGoauthBearerRequest.async() */ +/* + * For PGoauthBearerRequest.async(). This macro just allows clients to avoid + * depending on libpq-int.h or Winsock for the "socket" type; it's undefined + * immediately below. + */ #ifdef _WIN32 -#define SOCKTYPE uintptr_t /* avoids depending on winsock2.h for SOCKET */ +#define PQ_SOCKTYPE uintptr_t /* avoids depending on winsock2.h for SOCKET */ #else -#define SOCKTYPE int +#define PQ_SOCKTYPE int #endif typedef struct PGoauthBearerRequest @@ -768,10 +772,13 @@ typedef struct PGoauthBearerRequest * blocking during the original call to the PQAUTHDATA_OAUTH_BEARER_TOKEN * hook, it may be returned directly, but one of request->async or * request->token must be set by the hook. + * + * The (PQ_SOCKTYPE *) in the signature is a placeholder for the platform's + * native socket type: (SOCKET *) on Windows, and (int *) everywhere else. */ PostgresPollingStatusType (*async) (PGconn *conn, struct PGoauthBearerRequest *request, - SOCKTYPE * altsock); + PQ_SOCKTYPE * altsock); /* * Callback to clean up custom allocations. A hook implementation may use @@ -798,7 +805,7 @@ typedef struct PGoauthBearerRequest void *user; } PGoauthBearerRequest; -#undef SOCKTYPE +#undef PQ_SOCKTYPE extern char *PQencryptPassword(const char *passwd, const char *user); extern char *PQencryptPasswordConn(PGconn *conn, const char *passwd, const char *user, const char *algorithm); |
