Re: [PATCH 27/27] Fix PTRDIFF_MIN/PTRDIFF_MIN and PTRDIFF_MIN for ILP32.

2016-06-21 Thread Joseph Myers
On Tue, 21 Jun 2016, Yury Norov wrote:

> +#  ifdef __WORDSIZE32_PTRDIFF_LONG
> +#define PTRDIFF_MIN  (-2147483647L-1)
> +#define PTRDIFF_MAX  (2147483647L)
> +#  else
> +#define PTRDIFF_MIN  (-2147483647-1)
> +#define PTRDIFF_MAX  (2147483647)

We now use typo-proof conventions, preferring #if to #ifdef.  That is, 
make other bits/wordsize.h files define the macro to 0, so you can use #if 
here.

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: [PATCH 27/27] Fix PTRDIFF_MIN/PTRDIFF_MIN and PTRDIFF_MIN for ILP32.

2016-06-21 Thread Joseph Myers
On Tue, 21 Jun 2016, Yury Norov wrote:

> +#  ifdef __WORDSIZE32_PTRDIFF_LONG
> +#define PTRDIFF_MIN  (-2147483647L-1)
> +#define PTRDIFF_MAX  (2147483647L)
> +#  else
> +#define PTRDIFF_MIN  (-2147483647-1)
> +#define PTRDIFF_MAX  (2147483647)

We now use typo-proof conventions, preferring #if to #ifdef.  That is, 
make other bits/wordsize.h files define the macro to 0, so you can use #if 
here.

-- 
Joseph S. Myers
jos...@codesourcery.com


[PATCH 27/27] Fix PTRDIFF_MIN/PTRDIFF_MIN and PTRDIFF_MIN for ILP32.

2016-06-20 Thread Yury Norov
From: Andrew Pinski 

Signed-off-by: Andrew Pinski 
Signed-off-by: Yury Norov 
---
 sysdeps/aarch64/bits/wordsize.h | 8 +++-
 sysdeps/generic/stdint.h| 9 +++--
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
index 3d5a79d..18697e2 100644
--- a/sysdeps/aarch64/bits/wordsize.h
+++ b/sysdeps/aarch64/bits/wordsize.h
@@ -19,12 +19,10 @@
 # define __WORDSIZE64
 #else
 # define __WORDSIZE32
+# define __WORDSIZE32_SIZE_ULONG   1
+# define __WORDSIZE32_PTRDIFF_LONG 1
 #endif
 
-/* LP64 and ILP32s ABI uses a 64bit time_t.
-   This allows aarch32 and AARCH64 applications
+/* This allows ILP32 and AARCH64 applications
both access utmp. */
 #define __WORDSIZE_TIME64_COMPAT32 1
-
-/* LP64 and ILP32 use the 64bit system call interface. */
-#define __SYSCALL_WORDSIZE 64
diff --git a/sysdeps/generic/stdint.h b/sysdeps/generic/stdint.h
index 4427627..05f895a 100644
--- a/sysdeps/generic/stdint.h
+++ b/sysdeps/generic/stdint.h
@@ -248,8 +248,13 @@ typedef unsigned long long int uintmax_t;
 #  define PTRDIFF_MIN  (-9223372036854775807L-1)
 #  define PTRDIFF_MAX  (9223372036854775807L)
 # else
-#  define PTRDIFF_MIN  (-2147483647-1)
-#  define PTRDIFF_MAX  (2147483647)
+#  ifdef __WORDSIZE32_PTRDIFF_LONG
+#define PTRDIFF_MIN(-2147483647L-1)
+#define PTRDIFF_MAX(2147483647L)
+#  else
+#define PTRDIFF_MIN(-2147483647-1)
+#define PTRDIFF_MAX(2147483647)
+#  endif
 # endif
 
 /* Limits of `sig_atomic_t'.  */
-- 
2.7.4



[PATCH 27/27] Fix PTRDIFF_MIN/PTRDIFF_MIN and PTRDIFF_MIN for ILP32.

2016-06-20 Thread Yury Norov
From: Andrew Pinski 

Signed-off-by: Andrew Pinski 
Signed-off-by: Yury Norov 
---
 sysdeps/aarch64/bits/wordsize.h | 8 +++-
 sysdeps/generic/stdint.h| 9 +++--
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
index 3d5a79d..18697e2 100644
--- a/sysdeps/aarch64/bits/wordsize.h
+++ b/sysdeps/aarch64/bits/wordsize.h
@@ -19,12 +19,10 @@
 # define __WORDSIZE64
 #else
 # define __WORDSIZE32
+# define __WORDSIZE32_SIZE_ULONG   1
+# define __WORDSIZE32_PTRDIFF_LONG 1
 #endif
 
-/* LP64 and ILP32s ABI uses a 64bit time_t.
-   This allows aarch32 and AARCH64 applications
+/* This allows ILP32 and AARCH64 applications
both access utmp. */
 #define __WORDSIZE_TIME64_COMPAT32 1
-
-/* LP64 and ILP32 use the 64bit system call interface. */
-#define __SYSCALL_WORDSIZE 64
diff --git a/sysdeps/generic/stdint.h b/sysdeps/generic/stdint.h
index 4427627..05f895a 100644
--- a/sysdeps/generic/stdint.h
+++ b/sysdeps/generic/stdint.h
@@ -248,8 +248,13 @@ typedef unsigned long long int uintmax_t;
 #  define PTRDIFF_MIN  (-9223372036854775807L-1)
 #  define PTRDIFF_MAX  (9223372036854775807L)
 # else
-#  define PTRDIFF_MIN  (-2147483647-1)
-#  define PTRDIFF_MAX  (2147483647)
+#  ifdef __WORDSIZE32_PTRDIFF_LONG
+#define PTRDIFF_MIN(-2147483647L-1)
+#define PTRDIFF_MAX(2147483647L)
+#  else
+#define PTRDIFF_MIN(-2147483647-1)
+#define PTRDIFF_MAX(2147483647)
+#  endif
 # endif
 
 /* Limits of `sig_atomic_t'.  */
-- 
2.7.4