Opened 10 years ago

Last modified 10 years ago

#7389 closed Bugs

__STDC_LIMIT_MACROS can be redefined by boost when using mingw32 — at Version 2

Reported by: chfast@… Owned by: John Maddock
Milestone: To Be Determined Component: config
Version: Boost 1.51.0 Severity: Problem
Keywords: Cc:

Description (last modified by viboes)

On Windows, compiling with mingw32, STDC_LIMIT_MACROS macro is redefined if it was already defined.

This macro is defined in boost/config/platform/win32.hpp by

#if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0)))
#  define BOOST_HAS_STDINT_H
#  define __STDC_LIMIT_MACROS
#  define BOOST_HAS_DIRENT_H
#  define BOOST_HAS_UNISTD_H
#endif

Maybe it can be changed to:

#if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0)))
#  define BOOST_HAS_STDINT_H
#  if !defined(__STDC_LIMIT_MACROS)
#    define __STDC_LIMIT_MACROS
#  endif
#  define BOOST_HAS_DIRENT_H
#  define BOOST_HAS_UNISTD_H
#endif

Change History (3)

comment:1 by viboes, 10 years ago

Component: Noneconfig
Owner: set to John Maddock

by Paweł Bylica <chfast@…>, 10 years ago

Attachment: win32.hpp.patch added

A patch

comment:2 by viboes, 10 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.