bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH gnulib 3/4] select, poll, isatty: Avoid warnings on x86_64 mingw6


From: Marc-André Lureau
Subject: [PATCH gnulib 3/4] select, poll, isatty: Avoid warnings on x86_64 mingw64.
Date: Wed, 25 Jan 2012 19:35:08 +0100

* lib/select.c (IsConsoleHandle): Use intptr_t to convert handle
pointer to an integer. Fix warnings with MinGW64 x64.
* lib/poll.c (IsConsoleHandle): Likewise.
* lib/isatty.c (IsConsoleHandle): Likewise.
* modules/select (Depends-on): Add stdint.
* modules/poll (Depends-on): Likewise.
* modules/isatty (Depends-on): Likewise.
---
 ChangeLog      |   11 +++++++++++
 lib/isatty.c   |    4 +++-
 lib/poll.c     |    3 ++-
 lib/select.c   |    3 ++-
 modules/isatty |    1 +
 modules/poll   |    1 +
 modules/select |    1 +
 7 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index eb08519..dc7cdc1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-01-25  Marc-André Lureau  <address@hidden>
+
+       select, poll, isatty: Avoid warnings on x86_64 mingw64.
+       * lib/select.c (IsConsoleHandle): Use intptr_t to convert handle
+       pointer to an integer. Fix warnings with MinGW64 x64.
+       * lib/poll.c (IsConsoleHandle): Likewise.
+       * lib/isatty.c (IsConsoleHandle): Likewise.
+       * modules/select (Depends-on): Add stdint.
+       * modules/poll (Depends-on): Likewise.
+       * modules/isatty (Depends-on): Likewise.
+
 2012-01-24  Marc-André Lureau  <address@hidden>
 
        accept4, fcntl, w32sock: Avoid warnings on x86_64 mingw64.
diff --git a/lib/isatty.c b/lib/isatty.c
index fa70001..b0f04ce 100644
--- a/lib/isatty.c
+++ b/lib/isatty.c
@@ -27,6 +27,8 @@
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
+#include <stdint.h>
+
 #include "msvc-inval.h"
 
 /* Get _get_osfhandle().  */
@@ -34,7 +36,7 @@
 
 /* Optimized test whether a HANDLE refers to a console.
    See <http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00065.html>.  
*/
-#define IsConsoleHandle(h) (((long) (h) & 3) == 3)
+#define IsConsoleHandle(h) (((intptr_t) (h) & 3) == 3)
 
 #if HAVE_MSVC_INVALID_PARAMETER_HANDLER
 static inline int
diff --git a/lib/poll.c b/lib/poll.c
index 780a6d6..1556813 100644
--- a/lib/poll.c
+++ b/lib/poll.c
@@ -35,6 +35,7 @@
 #include <errno.h>
 #include <limits.h>
 #include <assert.h>
+#include <stdint.h>
 
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 # define WINDOWS_NATIVE
@@ -73,7 +74,7 @@
 
 /* Optimized test whether a HANDLE refers to a console.
    See <http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00065.html>.  
*/
-#define IsConsoleHandle(h) (((long) (h) & 3) == 3)
+#define IsConsoleHandle(h) (((intptr_t) (h) & 3) == 3)
 
 static BOOL
 IsSocketHandle (HANDLE h)
diff --git a/lib/select.c b/lib/select.c
index c5522a0..b0eb171 100644
--- a/lib/select.c
+++ b/lib/select.c
@@ -22,6 +22,7 @@
 #include <config.h>
 #include <alloca.h>
 #include <assert.h>
+#include <stdint.h>
 
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 /* Native Windows.  */
@@ -80,7 +81,7 @@ typedef DWORD (WINAPI *PNtQueryInformationFile)
 
 /* Optimized test whether a HANDLE refers to a console.
    See <http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00065.html>.  
*/
-#define IsConsoleHandle(h) (((long) (h) & 3) == 3)
+#define IsConsoleHandle(h) (((intptr_t) (h) & 3) == 3)
 
 static BOOL
 IsSocketHandle (HANDLE h)
diff --git a/modules/isatty b/modules/isatty
index e9aa037..e1b0c57a 100644
--- a/modules/isatty
+++ b/modules/isatty
@@ -9,6 +9,7 @@ Depends-on:
 unistd
 msvc-inval      [test $REPLACE_ISATTY = 1]
 msvc-nothrow    [test $REPLACE_ISATTY = 1]
+stdint
 
 configure.ac:
 gl_FUNC_ISATTY
diff --git a/modules/poll b/modules/poll
index 8fa88fd..7d5e43b 100644
--- a/modules/poll
+++ b/modules/poll
@@ -14,6 +14,7 @@ sys_select      [test $HAVE_POLL = 0 || test $REPLACE_POLL = 
1]
 sys_time        [test $HAVE_POLL = 0 || test $REPLACE_POLL = 1]
 errno           [test $HAVE_POLL = 0 || test $REPLACE_POLL = 1]
 msvc-nothrow    [test $HAVE_POLL = 0 || test $REPLACE_POLL = 1]
+stdint
 
 configure.ac:
 gl_FUNC_POLL
diff --git a/modules/select b/modules/select
index 7b25a8b..c40f4a9 100644
--- a/modules/select
+++ b/modules/select
@@ -10,6 +10,7 @@ sys_select
 alloca          [test $REPLACE_SELECT = 1]
 sockets         [test $REPLACE_SELECT = 1]
 msvc-nothrow    [test $REPLACE_SELECT = 1]
+stdint
 
 configure.ac:
 gl_FUNC_SELECT
-- 
1.7.7.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]