Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 May 2014 12:56:18 +0100
From:      David Chisnall <theraven@FreeBSD.org>
To:        Shane Ambler <FreeBSD@ShaneWare.Biz>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: updating standard headers to meet c++11 standard
Message-ID:  <26E76B72-1746-48A5-B6A2-335DEDF2026C@FreeBSD.org>
In-Reply-To: <537B2A57.5080801@ShaneWare.Biz>
References:  <537B2A57.5080801@ShaneWare.Biz>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

I thought I'd already fixed this a year or so ago.  Looking at my =
system, I see this in cdefs.h:

/* C++11 exposes a load of C99 stuff */
#if defined(__cplusplus) && __cplusplus >=3D 201103L
#define __LONG_LONG_SUPPORTED
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
#endif
#endif

So, if you're compiling C++ and the C++ standard is C++11 or later, we =
define the __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS macros.  If =
it's C++98, you can define them yourself.

Do you have a test case where this doesn't work?

David

On 20 May 2014, at 11:11, Shane Ambler <FreeBSD@ShaneWare.Biz> wrote:

> When including stdint.h in c++ we can #define __STDC_LIMIT_MACROS so
> that we get macros like INT32_MAX defined.
>=20
> Also related is __STDC_CONSTANT_MACROS
>=20
> I have recently found that the need for these has been removed within
> the c++11 standard.
>=20
> This year old bug report was to update glibc to this end -
> https://sourceware.org/bugzilla/show_bug.cgi?id=3D15366
>=20
> Also of note is that Apple removed the use of this macro from OSX with
> the release of 10.9 over a year ago
> =
http://www.opensource.apple.com/source/xnu/xnu-2422.1.72/EXTERNAL_HEADERS/=
stdint.h
>=20
> I believe as we push to use llvm's libc++ and support for c++11 we
> should also make sure the rest of our sources are kept up to date as
> well.
>=20
> Are there any other changes within c++11 or c++14 that we should be
> looking to update?
>=20
> Shane
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to =
"freebsd-current-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?26E76B72-1746-48A5-B6A2-335DEDF2026C>