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

Re: [Minios-devel] [UNIKRAFT/LIBNEWLIB PATCH 1/2] patches: compile guard MIN/MAX



Hi Felipe,

The fact that we didn't need this before made me think if this is really
necessary. Now, all other libraries should depend on libc (in this case
newlib) declarations and definitions and not the other way around.

As we discussed offline, the problem comes from the way this file gets
indirectly included in one of micropython's glue files. A general best
practice that does the trick most of the time is including headers
starting with the most general ones (e.g. libc's headers) to the most
particular ones (e.g. micropython's headers).

So, we'll drop this patch.

Cheers,
Costin

On 9/3/19 10:20 AM, Felipe Huici wrote:
> Put guards around definitions of MIN/MAX macros to prevent double
> definition warnings.
> 
> Signed-off-by: Felipe Huici <felipe.huici@xxxxxxxxx>
> ---
>  patches/0009-guard-min-max-definitions.patch | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>  create mode 100644 patches/0009-guard-min-max-definitions.patch
> 
> diff --git a/patches/0009-guard-min-max-definitions.patch 
> b/patches/0009-guard-min-max-definitions.patch
> new file mode 100644
> index 0000000..6c86e71
> --- /dev/null
> +++ b/patches/0009-guard-min-max-definitions.patch
> @@ -0,0 +1,15 @@
> +--- a/newlib/libc/include/sys/param.h        2019-08-30 16:15:49.591775421 
> +0200
> ++++ b/newlib/libc/include/sys/param.h        2019-08-30 16:15:38.659888767 
> +0200
> +@@ -25,8 +25,12 @@
> + 
> + #define MAXPATHLEN PATH_MAX
> + 
> ++#ifndef MAX
> + #define MAX(a,b) ((a) > (b) ? (a) : (b))
> ++#endif
> ++#ifndef MIN
> + #define MIN(a,b) ((a) < (b) ? (a) : (b))
> ++#endif
> + 
> + #ifndef howmany
> + #define    howmany(x, y)   (((x)+((y)-1))/(y))
> 

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.