[haiku-development] Re: patch to stdint.h and issues

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 14 Mar 2008 12:02:09 +0100

On 2008-03-14 at 02:53:47 [+0100], Curtis Wanner <katisu@xxxxxxxxxxx> wrote:
> 
> Alright, I updated stdint.h as much as possible to the C99 standard.
> Added some additional limit macros and the constant macros.
> 
> According to the standard, the limit macros should not be defined for C
> ++ unless __STDC_LIMIT_MACROS is defined.  Since Mediadefs.cpp and
> STXTTranslator.cpp use these, I added #define __STDC_LIMIT_MACROS to
> these files (otherwise it breaks build).

This doesn't sound right. Not that I'm an expert on this matter, but AFAIK 
this macro should be defined by the compiler or maybe something like 
glibc's features.h. It definitely shouldn't be defined (even 
unconditionally) in BeOS headers. If the respective limit macros were 
defined before, they probably should remain available regardless of 
__STDC_LIMIT_MACROS. Or maybe this macro should only be checked when 
compiling with ISO C99 compatiblity enabled.

> Attached are diffs to stdint.h, Mediadefs.cpp, and STXTTranslator.cpp.

BTW, it's generally preferred to have a single diff for a changes to 
different files, if they belong together ("svn diff" can have multiple 
arguments).

CU, Ingo

Other related posts: