Re: [reSIProcate] stdint include ordering (r11159)
On 30/05/14 22:16, Daniel Pocock wrote:
>
>
>
>
> Hi Scott,
>
> r11159 puts boost headers ahead of sipX headers
>
> Consequently, the build fails
>
> sipX spits out some warnings like this:
>
> /usr/include/sipxtapi/os/OsIntTypes.h:57:2: warning: #warning #include
> os/OsIntTypes.h before stdint.h/inttypes.h [-Wcpp]
> /usr/include/sipxtapi/os/OsIntTypes.h:58:0: warning: "_STDINT_H"
> redefined [enabled by default]
>
>
> and then later it fails like this:
>
> /usr/include/sipxtapi/mp/MpDspUtilsConvertVect.h: In static member
> function 'static OsStatus MpDspUtils::convert(const int32_t*, int16_t*,
> int)':
> /usr/include/sipxtapi/mp/MpDspUtilsConvertVect.h:31:17: error:
> 'INT16_MAX' was not declared in this scope
>
> for various cases where INT16_MIN, INT16_MAX, INT32_MIN and INT32_MAX
> appear.
>
>
> That is on a Debian wheezy system with boost 1.49 and the CPPFLAGS used
> for Debian packaging.
>
> It seems to build in travis though (Ubuntu with boost 1.54):
> https://s3.amazonaws.com/archive.travis-ci.org/jobs/26411952/log.txt
One workaround for this involves adding these to CPPFLAGS:
CPPFLAGS += -D__STDC_LIMIT_MACROS
CPPFLAGS += -D__STDC_CONSTANT_MACROS
CPPFLAGS += -D__STDC_FORMAT_MACROS
This could be done in the build system. At the moment, I am doing it
from the command line (in debian/rules for packaging)
It could also be done by adding
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
and friends in any file that includes any boost headers or maybe these
definitions belong in config.h