inttypes, stdint: add C++11 support
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 13 Dec 2011 23:27:41 +0000 (15:27 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 13 Dec 2011 23:30:25 +0000 (15:30 -0800)
commit443bc5ffcf7429e557f4a371b0661abe98ddbc13
tree910db7e19dbd3b9177f0fe709628a5f20d355601
parent91cc546b14935ac246f177ea62f945b86d9c4760
inttypes, stdint: add C++11 support

C++11 says there's no need to define __STDC_CONSTANT_MACROS etc.
when including inttypes.h and stdint.h.  Support this change to
the standard.
* doc/posix-headers/inttypes.texi (inttypes.h):
* doc/posix-headers/stdint.texi (stdint.h): Document this.
* lib/inttypes.in.h (__STDC_FORMAT_MACROS) [! __cplusplus]:
Define if not defined already, for the benefit of pre-C++11 hosts.
Define the standard format macros (e.g., PRId8) always.
* lib/stdint.in.h (__STDC_CONSTANT_MACROS, __STDC_LIMIT_MACROS):
Likewise, if __cpluspus.  Define the standard constant and limit
macros (e.g., INT8_C, INT8_MAX) always.
* m4/inttypes.m4 (gl_INTTYPES_INCOMPLETE): Do not define
GL_TRIGGER_STDC_LIMIT_MACROS or __STDC_LIMIT_MACROS; no longer needed.
* m4/stdint.m4 (gl_STDINT_H): Update comments about these macros.
* tests/test-inttypes.c (__STDC_LIMIT_MACROS, __STDC_CONSTANT_MACROS)
(__STDC_FORMAT_MACROS): Do not define, since we assume C++11 API now.
* tests/test-stdint.c (__STDC_LIMIT_MACROS, __STDC_CONSTANT_MACROS):
Likewise.
ChangeLog
doc/posix-headers/inttypes.texi
doc/posix-headers/stdint.texi
lib/inttypes.in.h
lib/stdint.in.h
m4/inttypes.m4
m4/stdint.m4
tests/test-inttypes.c
tests/test-stdint.c