32 bit compilation has been broken by 8db1662d749991a77b8945c752ab024d2d6b1244 (failing on C_ASSERT)
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/wldap32/libldap.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/dlls/wldap32/libldap.c b/dlls/wldap32/libldap.c index 8872421dabc..03b71f3db87 100644 --- a/dlls/wldap32/libldap.c +++ b/dlls/wldap32/libldap.c @@ -53,7 +53,14 @@ C_ASSERT( sizeof(LDAPSortKeyU) == sizeof(LDAPSortKey) ); C_ASSERT( sizeof(LDAPVLVInfoU) == sizeof(LDAPVLVInfo) ); C_ASSERT( sizeof(LDAPAPIInfoU) == sizeof(LDAPAPIInfo) ); C_ASSERT( sizeof(LDAPAPIFeatureInfoU) == sizeof(LDAPAPIFeatureInfo) ); -C_ASSERT( sizeof(struct timevalU) == sizeof(struct timeval) ); + +static struct timeval *cconvert_timeval(const struct timevalU *tvu, struct timeval *tv) +{ + if (!tvu) return NULL; + tv->tv_sec = tvu->tv_sec; + tv->tv_usec = tvu->tv_usec; + return tv; +}
#define WLDAP32_LBER_ERROR (~0l)
@@ -488,8 +495,9 @@ static NTSTATUS wrap_ldap_rename_s( void *args ) static NTSTATUS wrap_ldap_result( void *args ) { struct ldap_result_params *params = args; + struct timeval tv; return ldap_result( params->ld, params->msgid, params->all, - (struct timeval *)params->timeout, (LDAPMessage **)params->result ); + convert_timeval(params->timeout, &tv), (LDAPMessage **)params->result ); }
static NTSTATUS wrap_ldap_sasl_bind( void *args ) @@ -555,18 +563,20 @@ static NTSTATUS wrap_ldap_sasl_interactive_bind_s( void *args ) static NTSTATUS wrap_ldap_search_ext( void *args ) { struct ldap_search_ext_params *params = args; + struct timeval tv; return ldap_search_ext( params->ld, params->base, params->scope, params->filter, params->attrs, params->attrsonly, (LDAPControl **)params->serverctrls, - (LDAPControl **)params->clientctrls, (struct timeval *)params->timeout, + (LDAPControl **)params->clientctrls, convert_timeval(params->timeout, &tv), params->sizelimit, (int *)params->msg ); }
static NTSTATUS wrap_ldap_search_ext_s( void *args ) { struct ldap_search_ext_s_params *params = args; + struct timeval tv; return ldap_search_ext_s( params->ld, params->base, params->scope, params->filter, params->attrs, params->attrsonly, (LDAPControl **)params->serverctrls, - (LDAPControl **)params->clientctrls, (struct timeval *)params->timeout, + (LDAPControl **)params->clientctrls, convert_timeval(params->timeout, &tv), params->sizelimit, (LDAPMessage **)params->result ); }
32 bit compilation has been broken by 8db1662d749991a77b8945c752ab024d2d6b1244 (failing on C_ASSERT)
v1 -> v2: fix typo
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/wldap32/libldap.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/dlls/wldap32/libldap.c b/dlls/wldap32/libldap.c index 8872421dabc..592e526ecdc 100644 --- a/dlls/wldap32/libldap.c +++ b/dlls/wldap32/libldap.c @@ -53,7 +53,14 @@ C_ASSERT( sizeof(LDAPSortKeyU) == sizeof(LDAPSortKey) ); C_ASSERT( sizeof(LDAPVLVInfoU) == sizeof(LDAPVLVInfo) ); C_ASSERT( sizeof(LDAPAPIInfoU) == sizeof(LDAPAPIInfo) ); C_ASSERT( sizeof(LDAPAPIFeatureInfoU) == sizeof(LDAPAPIFeatureInfo) ); -C_ASSERT( sizeof(struct timevalU) == sizeof(struct timeval) ); + +static struct timeval *convert_timeval(const struct timevalU *tvu, struct timeval *tv) +{ + if (!tvu) return NULL; + tv->tv_sec = tvu->tv_sec; + tv->tv_usec = tvu->tv_usec; + return tv; +}
#define WLDAP32_LBER_ERROR (~0l)
@@ -488,8 +495,9 @@ static NTSTATUS wrap_ldap_rename_s( void *args ) static NTSTATUS wrap_ldap_result( void *args ) { struct ldap_result_params *params = args; + struct timeval tv; return ldap_result( params->ld, params->msgid, params->all, - (struct timeval *)params->timeout, (LDAPMessage **)params->result ); + convert_timeval(params->timeout, &tv), (LDAPMessage **)params->result ); }
static NTSTATUS wrap_ldap_sasl_bind( void *args ) @@ -555,18 +563,20 @@ static NTSTATUS wrap_ldap_sasl_interactive_bind_s( void *args ) static NTSTATUS wrap_ldap_search_ext( void *args ) { struct ldap_search_ext_params *params = args; + struct timeval tv; return ldap_search_ext( params->ld, params->base, params->scope, params->filter, params->attrs, params->attrsonly, (LDAPControl **)params->serverctrls, - (LDAPControl **)params->clientctrls, (struct timeval *)params->timeout, + (LDAPControl **)params->clientctrls, convert_timeval(params->timeout, &tv), params->sizelimit, (int *)params->msg ); }
static NTSTATUS wrap_ldap_search_ext_s( void *args ) { struct ldap_search_ext_s_params *params = args; + struct timeval tv; return ldap_search_ext_s( params->ld, params->base, params->scope, params->filter, params->attrs, params->attrsonly, (LDAPControl **)params->serverctrls, - (LDAPControl **)params->clientctrls, (struct timeval *)params->timeout, + (LDAPControl **)params->clientctrls, convert_timeval(params->timeout, &tv), params->sizelimit, (LDAPMessage **)params->result ); }
Eric Pouech eric.pouech@gmail.com writes:
32 bit compilation has been broken by 8db1662d749991a77b8945c752ab024d2d6b1244 (failing on C_ASSERT)
v1 -> v2: fix typo
Signed-off-by: Eric Pouech eric.pouech@gmail.com
dlls/wldap32/libldap.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
Note that this is correct only if libldap was also built with _TIME_BITS=64. Though looking at the OpenLDAP implementation we may be able to get away with it.
Signed-off-by: Hans Leidekker hans@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=106994
Your paranoid android.
=== debian11 (build log) ===
/home/winetest/tools/testbot/var/wine-win32/../wine/dlls/wldap32/libldap.c:579: undefined reference to `convert_timeval' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/wldap32/libldap.c:569: undefined reference to `convert_timeval' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/wldap32/libldap.c:500: undefined reference to `convert_timeval' collect2: error: ld returned 1 exit status Task: The win32 Wine build failed
=== debian11 (build log) ===
/home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/wldap32/libldap.c:579: undefined reference to `convert_timeval' /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/wldap32/libldap.c:569: undefined reference to `convert_timeval' /home/winetest/tools/testbot/var/wine-wow64/../wine/dlls/wldap32/libldap.c:500: undefined reference to `convert_timeval' collect2: error: ld returned 1 exit status Task: The wow64 Wine build failed