> On 19 Jun 2017, at 21:22, David Sommerseth 
> <open...@sf.lists.topphemmelig.net> wrote:
> 
> On 19/06/17 15:16, Gert Doering wrote:
>> 
>> Somewhat ugly (is there no existing #ifdef ENABLE_CRYPTO block nearby
>> that we could hide this in?) but I need a clean tree tonight, and this
>> will fix things.  So, will to go with it.
> 
> There are no other ENABLE_CRYPTO blocks in
> initialization_sequence_completed() [init.c:1375].  The alternative
> could be to put this #ifdef inside the delayed_auth_pass_purge() and
> make that function be "empty" without ENABLE_CRYPTO.  But as init.c is
> the only place this is called outside the ENABLE_CRYPTO scope, this is
> where my dice rolled.

Something I have been doing in the kernel code was to put this kind of blocks 
in the .h file where the function is declared: in case of CONSTANT not-defined 
the function would be defined inline within the .h file with an empty body. The 
assumption is that the corresponding .c file is not compiled in this case.
This is usually quite clean and avoids having more and more ifdefs inside the 
code. For example in this case it would result in:

#ifdef ENABLE_CRYPTO
void delayed_auth_pass_purge(void);
#else
void delayed_auth_pass_purge(void)
{
}
#endif

Obviously you’ll want to group multiple functions in the same ifdef.

This might be helpful to beautify (->make easy to read) several parts of the 
openvpn code.

my 2 cents.

Cheers,


--
Antonio Quartulli




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to