Commit 07cb943d authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

ldap: Mark ldap_int_destroy_global_options() as a destructor when building with Clang.

Clang understands __attribute__ ((destructor)) syntax just like GCC. This avoids a link failure when atexit() used in the fallback path is not available. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53930
parent cd2e3d1f
......@@ -497,7 +497,7 @@ static void openldap_ldap_init_w_env(
}
}
#if defined(__GNUC__)
#if defined(__GNUC__) || defined(__clang__)
/* Declare this function as a destructor so that it will automatically be
* invoked either at program exit (if libldap is a static library) or
* at unload time (if libldap is a dynamic library).
......@@ -574,7 +574,7 @@ void ldap_int_initialize_global_options( struct ldapoptions *gopts, int *dbglvl
*/
ldap_url_parselist(&gopts->ldo_defludp, "ldap://localhost/");
gopts->ldo_defport = LDAP_PORT;
#if !defined(__GNUC__) && !defined(PIC)
#if !defined(__GNUC__) && !defined(__clang__) && !defined(PIC)
/* Do this only for a static library, and only if we can't
* arrange for it to be executed as a library destructor
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment