[ovs-dev] Windows port status

Alin Serdean aserdean at cloudbasesolutions.com
Fri Nov 22 19:25:14 UTC 2013


> PRI_ZU is a bad name because it doesn't follow the existing pattern.
> The name PRIuSIZE fits the pattern, so that is what I would suggest.

> The existing PRI* macros only include a type modifier, not the format
> specifier, so PRIuSIZE should not include the format specifier either.

Is this what you mean?

#ifdef _WIN32
#define _PFX_SIZE "I"
#else
#define _PFX_SIZE "z"
#endif

#ifdef _WIN32
#define PRIuSIZE _PFX_SIZE "u"
#else
#define PRIuSIZE _PFX_SIZE "u"
#endif

> The Autoconf philosophy is to test for features, not for system type.

> This does not appear to include anything to enforce use of the macro.  I
> will not apply a change that lacks such enforcement.

I do not want to step on any toes with this, but the way I see it is:
1. Use autoconf to generate the macro(and use the fact <config.h> is included in every file)
2. We define a header that is included in every source file 
3. We define a wrapper over the <inttypes.h> (like the ./lib/string.h) and whenever they want to use the PRIuSIZE macro they have to include in <inttypes.h> .

Kind Regards,
Alin.
________________________________________
From: Ben Pfaff [blp at nicira.com]
Sent: Friday, November 22, 2013 4:33 AM
To: Alin Serdean
Cc: Alessandro Pilotti; dev at openvswitch.org
Subject: Re: [ovs-dev] Windows port status

On Fri, Nov 22, 2013 at 02:23:11AM +0000, Alin Serdean wrote:
> Bellow the whole patch required for the PRI_ZU macro:

PRI_ZU is a bad name because it doesn't follow the existing pattern.
The name PRIuSIZE fits the pattern, so that is what I would suggest.

The existing PRI* macros only include a type modifier, not the format
specifier, so PRIuSIZE should not include the format specifier either.

The Autoconf philosophy is to test for features, not for system type.

This does not appear to include anything to enforce use of the macro.  I
will not apply a change that lacks such enforcement.



More information about the dev mailing list