Macro redefinition in boost/cstdint.hpp (1.42 beta1)

I've tested my code with the 1.42 beta, and get a lot of macro redefinition warnings on my system (msvc-9.0) The problem is redefinition of INT64_C and UINT64_C in boost/cstdint.hpp. My code also includes the ICU library, and these two macros are already defined in the ICU headers. The problem then comes down to header include order... I see that the updated boost/cstdint.hpp only test !defined(INT8_C) before defining all INT#_C and UNIT#_C macros The solution to my problem is to test for existence on every macro before definition: #ifndef INT#_C #define INT#_C( value ) ... #endif Is this appropriate fix, and should I add a ticket for this? -Vemund

On Tue, Feb 2, 2010 at 4:04 AM, Vemund Handeland <hvemha@gmail.com> wrote:
I've tested my code with the 1.42 beta, and get a lot of macro redefinition warnings on my system (msvc-9.0) The problem is redefinition of INT64_C and UINT64_C in boost/cstdint.hpp. My code also includes the ICU library, and these two macros are already defined in the ICU headers. The problem then comes down to header include order...
I see that the updated boost/cstdint.hpp only test !defined(INT8_C) before defining all INT#_C and UNIT#_C macros
The solution to my problem is to test for existence on every macro before definition:
#ifndef INT#_C #define INT#_C( value ) ... #endif
Is this appropriate fix
Yes, unless someone else can come up with a better idea. One alternative might be to test for the particular ICU header involved, and skip the whole block of code when found, but your fix is more general.
, and should I add a ticket for this?
Yes. A patch would be much appreciated. --Beman

I've tested my code with the 1.42 beta, and get a lot of macro redefinition warnings on my system (msvc-9.0) The problem is redefinition of INT64_C and UINT64_C in boost/cstdint.hpp. My code also includes the ICU library, and these two macros are already defined in the ICU headers. The problem then comes down to header include order...
I see that the updated boost/cstdint.hpp only test !defined(INT8_C) before defining all INT#_C and UNIT#_C macros
The solution to my problem is to test for existence on every macro before definition:
#ifndef INT#_C #define INT#_C( value ) ... #endif
Is this appropriate fix
Yes, unless someone else can come up with a better idea. One alternative might be to test for the particular ICU header involved, and skip the whole block of code when found, but your fix is more general.
, and should I add a ticket for this?
Yes. A patch would be much appreciated.
No need (I hope!), I'm testing a fix now, John.
participants (3)
-
Beman Dawes
-
John Maddock
-
Vemund Handeland