summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/tr1/cinttypes
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2006-01-30 14:17:49 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2006-01-30 14:17:49 +0000
commit52a64bd38e2af65bef3c1c4f4d93e0477c56ec15 (patch)
tree8d7707f10409beae3b55bc76f1fd23c16f043bc4 /libstdc++-v3/include/tr1/cinttypes
parenteb73a69a1538e24fcf39f108d22d324ae8cd1d90 (diff)
cinttypes: New.
2006-01-30 Paolo Carlini <pcarlini@suse.de> * include/tr1/cinttypes: New. * include/Makefile.am: Add. * testsuite/tr1/8_c_compatibility/cinttypes/functions: New. * testsuite/tr1/8_c_compatibility/cinttypes/types: Likewise. * acinclude.m4 ([GLIBCXX_CHECK_C99_TR1]): Add <inttypes.h> checks. * docs/html/ext/tr1.html: Update. * include/Makefile.in: Regenerate. * config.h.in: Likewise. * configure: Likewise. * testsuite/tr1/8_c_compatibility/cfenv/functions.cc: Cosmetic tweak. * testsuite/tr1/8_c_compatibility/cfenv/types.cc: Likewise. * testsuite/tr1/8_c_compatibility/cstdint/types.cc: Fix, check in std::tr1. From-SVN: r110397
Diffstat (limited to 'libstdc++-v3/include/tr1/cinttypes')
-rw-r--r--libstdc++-v3/include/tr1/cinttypes83
1 files changed, 83 insertions, 0 deletions
diff --git a/libstdc++-v3/include/tr1/cinttypes b/libstdc++-v3/include/tr1/cinttypes
new file mode 100644
index 00000000000..2e0e9d83a4b
--- /dev/null
+++ b/libstdc++-v3/include/tr1/cinttypes
@@ -0,0 +1,83 @@
+// TR1 cinttypes -*- C++ -*-
+
+// Copyright (C) 2006 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+/** @file
+ * This is a TR1 C++ Library header.
+ */
+
+#ifndef _TR1_CINTTYPES
+#define _TR1_CINTTYPES 1
+
+#include <bits/c++config.h>
+
+#include <tr1/cstdint>
+
+#if _GLIBCXX_HAVE_INTTYPES_H
+// For 8.11.1/1 (see C99, Note 184)
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+#endif
+
+#if _GLIBCXX_USE_C99_INTTYPES_TR1
+
+// namespace std::tr1
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE(tr1)
+
+ // types
+ using ::imaxdiv_t;
+
+ // functions
+ using ::imaxabs;
+
+ inline intmax_t
+ abs(intmax_t __i)
+ { return imaxabs(__i); }
+
+ using ::imaxdiv;
+
+ inline imaxdiv_t
+ div(intmax_t __numer, intmax_t __denom)
+ { return imaxdiv(__numer, __denom); }
+
+ using ::strtoimax;
+ using ::strtoumax;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ using ::wcstoimax;
+ using ::wcstoumax;
+#endif
+
+_GLIBCXX_END_NAMESPACE
+}
+
+#endif
+
+#endif