<div>Hi,</div><div><br></div>Thank you very much, I managed to achieve the conditional compilation as you describe. Now I am investigating which macro named is most common.<div><br></div><div>In this matter it seems that the OpenLDAP folks have renamed the macro themselves from version 2.4. The OpenBSD folks are still in 2.3 (after the 4.8 upgrade), so I will go for OpenBSD being the exception.</div>
<div><br></div><div>Anyway thank you again for your help,</div><div>--</div><div>Julien Dessaux<br><div><br><br><div class="gmail_quote">On Tue, Nov 2, 2010 at 5:58 PM, Matthias Kilian <span dir="ltr"><<a href="mailto:kili@outback.escape.de">kili@outback.escape.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Sat, Oct 30, 2010 at 07:28:40PM +0200, Julien Dessaux wrote:<br>
> I'm using the LDAP lib for one of my projects and I found a problem<br>
> while building it on an OpenBSD system. It wouldn't compile because there is<br>
> a macro named differently in the ldap.h include file. Under linux, this<br>
> macro is named LDAP_X_PROXY_AUTHZ_FAILURE but on OpenBSD (and probably other<br>
> BSD flavours), it's named LDAP_PROXY_AUTHZ_FAILURE.<br>
><br>
> I attached the diff I wrote in order to compile the lib on OpenBSD, but<br>
> it's not a patch I can submit cause it now won't compile on Linux. How can I<br>
> amend this in order to have a code that would compile on both systems? How<br>
> is it possible to specify such conditional system dependent stuff for a C<br>
> binding?<br>
<br>
</div></div>You can use different CC-Options in LDAP.cabal depending on the OS.<br>
For example<br>
<br>
if os(openbsd)<br>
CC-Options: -DLDAP_X_PROXY_AUTHZ_FAILURE=LDAP_PROXY_AUTHZ_FAILURE<br>
else<br>
CC-Options: -DLDAP_DEPRECATED=1<br>
<br>
<br>
Or, if LDAP_X_PROXY_AUTHZ_FAILURE is only used on Linux, just do<br>
it reverse, i.e. patch the sources to use LDAP_PROXY_AUTHZ_FAILURE<br>
and conditionally define it as LDAP_X_PROXY_AUTHZ_FAILURE on Linux;<br>
<br>
whatever fits better.<br>
<br>
Ciao,<br>
Kili<br>
</blockquote></div><br></div></div>