<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">&lt;<a href="mailto:kili@outback.escape.de">kili@outback.escape.de</a>&gt;</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>
&gt;     I&#39;m using the LDAP lib for one of my projects and I found a problem<br>
&gt; while building it on an OpenBSD system. It wouldn&#39;t compile because there is<br>
&gt; a macro named differently in the ldap.h include file. Under linux, this<br>
&gt; macro is named LDAP_X_PROXY_AUTHZ_FAILURE but on OpenBSD (and probably other<br>
&gt; BSD flavours), it&#39;s named LDAP_PROXY_AUTHZ_FAILURE.<br>
&gt;<br>
&gt;     I attached the diff I wrote in order to compile the lib on OpenBSD, but<br>
&gt; it&#39;s not a patch I can submit cause it now won&#39;t compile on Linux. How can I<br>
&gt; amend this in order to have a code that would compile on both systems? How<br>
&gt; is it possible to specify such conditional system dependent stuff for a C<br>
&gt; 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>