Hello,

When building Postgres using MSVC with Kerberos Version 4.1 and OpenSSL
1.1.1l (both of them, using only one will raise no errors), I see errors
like:

"C:\postgres\pgsql.sln" (default target) (1) ->
"C:\postgres\postgres.vcxproj" (default target) (2) ->
(ClCompile target) ->
  C:\postgres\src\backend\libpq\be-secure-openssl.c(583,43): warning C4047:
'function': 'X509_NAME *' differs in levels of indirection from 'int'
[C:\postgres\pos
tgres.vcxproj]

"C:\postgres\pgsql.sln" (default target) (1) ->
"C:\postgres\postgres.vcxproj" (default target) (2) ->
(ClCompile target) ->
  C:\postgres\src\backend\libpq\be-secure-openssl.c(74,35): error C2143:
syntax error: missing ')' before '(' [C:\postgres\postgres.vcxproj]

There is a comment in 'src/backend/libpq/be-secure-openssl.c' addressing
this issue, but I have to explicitly undefine X509_NAME. Please find
attached a patch for so.

Regards,

Juan José Santamaría Flecha
diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c
index 3d0168a..649bdc3 100644
--- a/src/backend/libpq/be-secure-openssl.c
+++ b/src/backend/libpq/be-secure-openssl.c
@@ -49,6 +49,9 @@
 #ifndef OPENSSL_NO_ECDH
 #include <openssl/ec.h>
 #endif
+#ifdef WIN32
+#undef X509_NAME
+#endif
 #include <openssl/x509v3.h>
 
 

Reply via email to