Re: [PATCH spice-server 1/2] Change ENABLE_EXTRA_CHECKS statements to #ifdef

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/15/2018 01:19 PM, Uri Lublin wrote:
On 03/13/2018 03:37 PM, Eduardo Lima (Etrunko) wrote:
On 13/03/18 04:21, Frediano Ziglio wrote:

This patch makes it clear that this is a configure switch and not a
variable defined somewhere else in the code.


The code is intended that way to make the compiler always parse
these parts. Note that that define is always defined so your code
is not doing what you are intending.

I have sent this patch by mistake, but anyway, the fact of it always
being defined is true with autotools, but it is not with meson.

So with meson it's either 1 or undefined ?

Note that in this case the current code would fail to build
when ENABLE_EXTRA_CHECKS is undefined.

Do you think it would make sense to have this patch or is it better to
keep as is? If the latter, I think it would be better to keep a static
variable and change its value according to the define.

This patch makes sense to me.

Perhaps replace the #ifdef with
#if defined(ENABLE_EXTRA_CHECKS) && ENABLE_EXTRA_CHECKS

Or add something like this (in an .h file all .c include)
#ifndef ENABLE_EXTRA_CHECKS
#define ENABLE_EXTRA_CHECKS 0
#endif

and replace the #ifdef with an #if


Uri.

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]