projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replaced with <unistd.h>.
[gnulib.git]
/
lib
/
inttypes_.h
diff --git
a/lib/inttypes_.h
b/lib/inttypes_.h
index
6500118
..
97ab3ad
100644
(file)
--- a/
lib/inttypes_.h
+++ b/
lib/inttypes_.h
@@
-1,4
+1,4
@@
-/* Copyright (C) 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2006
-2007
Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Derek Price.
This file is part of gnulib.
Written by Paul Eggert, Bruno Haible, Derek Price.
This file is part of gnulib.
@@
-42,13
+42,13
@@
# error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to <bug-gnulib@gnu.org>."
#endif
# error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to <bug-gnulib@gnu.org>."
#endif
+/* The definition of GL_LINK_WARNING is copied here. */
+
/* 7.8.1 Macros for format specifiers */
#if ! defined __cplusplus || defined __STDC_FORMAT_MACROS
/* 7.8.1 Macros for format specifiers */
#if ! defined __cplusplus || defined __STDC_FORMAT_MACROS
-# if defined _MSC_VER || defined __MINGW32__
-# define _LONG_LONG_FORMAT_PREFIX "I64"
-# elif defined _TNS_R_TARGET
+# if defined _TNS_R_TARGET
/* Tandem NonStop R series and compatible platforms released before
July 2005 support %Ld but not %lld. */
# define _LONG_LONG_FORMAT_PREFIX "L"
/* Tandem NonStop R series and compatible platforms released before
July 2005 support %Ld but not %lld. */
# define _LONG_LONG_FORMAT_PREFIX "L"
@@
-167,6
+167,8
@@
# ifdef INT64_MAX
# if INT64_MAX == LONG_MAX
# define _PRI64_PREFIX "l"
# ifdef INT64_MAX
# if INT64_MAX == LONG_MAX
# define _PRI64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+# define _PRI64_PREFIX "I64"
# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
# define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
# endif
# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
# define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
# endif
@@
-182,6
+184,8
@@
# ifdef UINT64_MAX
# if UINT64_MAX == ULONG_MAX
# define _PRIu64_PREFIX "l"
# ifdef UINT64_MAX
# if UINT64_MAX == ULONG_MAX
# define _PRIu64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+# define _PRIu64_PREFIX "I64"
# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
# define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX
# endif
# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
# define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX
# endif
@@
-656,6
+660,8
@@
# ifdef INT64_MAX
# if INT64_MAX == LONG_MAX
# define _SCN64_PREFIX "l"
# ifdef INT64_MAX
# if INT64_MAX == LONG_MAX
# define _SCN64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+# define _SCN64_PREFIX "I64"
# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
# define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX
# endif
# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
# define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX
# endif
@@
-671,6
+677,8
@@
# ifdef UINT64_MAX
# if UINT64_MAX == ULONG_MAX
# define _SCNu64_PREFIX "l"
# ifdef UINT64_MAX
# if UINT64_MAX == ULONG_MAX
# define _SCNu64_PREFIX "l"
+# elif defined _MSC_VER || defined __MINGW32__
+# define _SCNu64_PREFIX "I64"
# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
# define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX
# endif
# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
# define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX
# endif
@@
-1028,20
+1036,53
@@
extern "C" {
#endif
extern "C" {
#endif
-#if !@HAVE_DECL_IMAXABS@
+#if @GNULIB_IMAXABS@
+# if !@HAVE_DECL_IMAXABS@
extern intmax_t imaxabs (intmax_t);
extern intmax_t imaxabs (intmax_t);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef imaxabs
+# define imaxabs(a) \
+ (GL_LINK_WARNING ("imaxabs is unportable - "\
+ "use gnulib module imaxabs for portability"), \
+ imaxabs (a))
#endif
#endif
-#if !@HAVE_DECL_IMAXDIV@
+#if @GNULIB_IMAXDIV@
+# if !@HAVE_DECL_IMAXDIV@
typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef imaxdiv
+# define imaxdiv(a,b) \
+ (GL_LINK_WARNING ("imaxdiv is unportable - "\
+ "use gnulib module imaxdiv for portability"), \
+ imaxdiv (a, b))
#endif
#endif
-#if !@HAVE_DECL_STRTOIMAX@
+#if @GNULIB_STRTOIMAX@
+# if !@HAVE_DECL_STRTOIMAX@
extern intmax_t strtoimax (const char *, char **, int);
extern intmax_t strtoimax (const char *, char **, int);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtoimax
+# define strtoimax(p,e,b) \
+ (GL_LINK_WARNING ("strtoimax is unportable - "\
+ "use gnulib module strtoimax for portability"), \
+ strtoimax (p, e, b))
#endif
#endif
-#if !@HAVE_DECL_STRTOUMAX@
+
+#if @GNULIB_STRTOUMAX@
+# if !@HAVE_DECL_STRTOUMAX@
extern uintmax_t strtoumax (const char *, char **, int);
extern uintmax_t strtoumax (const char *, char **, int);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strtoumax
+# define strtoumax(p,e,b) \
+ (GL_LINK_WARNING ("strtoumax is unportable - "\
+ "use gnulib module strtoumax for portability"), \
+ strtoumax (p, e, b))
#endif
/* Don't bother defining or declaring wcstoimax and wcstoumax, since
#endif
/* Don't bother defining or declaring wcstoimax and wcstoumax, since