[git] Scute - branch, master, updated. scute-1.5.0-20-ga3dc060

by Werner Koch cvs at cvs.gnupg.org
Wed Feb 20 13:17:08 CET 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PKCS#11 token on top of gpg-agent".

The branch, master has been updated
       via  a3dc060e32a52e3a094c3af84e432c832b511da9 (commit)
      from  6f61c173cf2b71b43f41f163d590ef127b68509e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a3dc060e32a52e3a094c3af84e432c832b511da9
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Feb 20 13:14:46 2019 +0100

    Fix gcc warnings when building for Windows.
    
    * m4/estream.m4: Remove file.
    * configure.ac (estream_PRINTF_INIT): Remove.  Estream is part of
    libgpg-error.
    (AC_CHECK_FUNCS): Move to a later place.
    * src/agent.c [W32]: Explictly include winsock2.h to avoid a warning.
    (gnupg_allow_set_foregound_window): Fix printf warning.
    * src/support.h (ttyname): Mark unsused arg.
    (stpcpy): Move to ...
    * src/get-path.c (my_stpcpy): here.  Use macros to get around warning
    pertaining to the gcc built-in.
    (dlopen): Mark unused arg.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/configure.ac b/configure.ac
index 9b0f4fd..e36f56d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -262,13 +262,6 @@ AC_SUBST(BUILD_REVISION_DEC)
 AC_SUBST(BUILD_TIMESTAMP)
 AC_SUBST(BUILD_FILEVERSION)
 
-# Checks for libraries.
-
-AC_CHECK_FUNCS([ttyname localtime_r timegm stpcpy])
-
-# Run the checks needed for estream-printf.c
-estream_PRINTF_INIT
-
 # The error code library.  Error codes are sent over the IPC layer and
 # have to be interpreted.
 AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
@@ -416,6 +409,7 @@ AC_HEADER_STDBOOL
 AC_C_INLINE
 
 # Checks for library functions.
+AC_CHECK_FUNCS([ttyname localtime_r timegm stpcpy])
 
 # Check for programs needed for the manual.
 AC_CHECK_PROG(CONVERT, convert, convert)
diff --git a/m4/Makefile.am b/m4/Makefile.am
index bff7b15..cbcd9a8 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -1,2 +1,2 @@
-EXTRA_DIST = estream.m4 autobuild.m4 gpg-error.m4 libassuan.m4 libtool.m4 \
+EXTRA_DIST = autobuild.m4 gpg-error.m4 libassuan.m4 libtool.m4 \
              ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4
diff --git a/m4/estream.m4 b/m4/estream.m4
deleted file mode 100644
index 4b6c745..0000000
--- a/m4/estream.m4
+++ /dev/null
@@ -1,48 +0,0 @@
-dnl Autoconf macros for libestream
-dnl       Copyright (C) 2007 g10 Code GmbH
-dnl
-dnl This file is free software; as a special exception the author gives
-dnl unlimited permission to copy and/or distribute it, with or without
-dnl modifications, as long as this notice is preserved.
-dnl
-dnl This file is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
-dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-
-dnl estream_PRINTF_INIT
-dnl Prepare build of source included estream-printf.c
-dnl
-AC_DEFUN([estream_PRINTF_INIT],
-[ 
-  AC_MSG_NOTICE([checking system features for estream-printf])
-  AC_TYPE_LONG_LONG_INT  
-  AC_TYPE_LONG_DOUBLE  
-  AC_TYPE_INTMAX_T
-  AC_TYPE_UINTMAX_T
-  AC_CHECK_TYPES([ptrdiff_t])
-  AC_CHECK_SIZEOF([unsigned long])
-  AC_CHECK_SIZEOF([void *])
-  AC_CACHE_CHECK([for nl_langinfo and THOUSANDS_SEP],
-                  estream_cv_langinfo_thousands_sep,
-      [AC_TRY_LINK([#include <langinfo.h>],
-        [char* cs = nl_langinfo(THOUSANDS_SEP); return !cs;],
-        estream_cv_langinfo_thousands_sep=yes,
-        estream_cv_langinfo_thousands_sep=no)
-      ])
-  if test $estream_cv_langinfo_thousands_sep = yes; then
-    AC_DEFINE(HAVE_LANGINFO_THOUSANDS_SEP, 1,
-      [Define if you have <langinfo.h> and nl_langinfo(THOUSANDS_SEP).])
-  fi
-])
-
-
-dnl estream_INIT
-dnl Prepare build of source included estream.c
-dnl
-AC_DEFUN([estream_INIT],
-[ 
-  AC_REQUIRE([estream_PRINTF_INIT])
-  AC_MSG_NOTICE([checking system features for estream])
-
-])
diff --git a/src/agent.c b/src/agent.c
index df9cdc1..6228af9 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -30,11 +30,12 @@
 #include <stdarg.h>
 
 #ifdef HAVE_W32_SYSTEM
-#define PATHSEP_C ';'
-#define WINVER 0x0500  /* Required for AllowSetForegroundWindow.  */
-#include <windows.h>
+# define PATHSEP_C ';'
+# define WINVER 0x0500  /* Required for AllowSetForegroundWindow.  */
+# include <winsock2.h>
+# include <windows.h>
 #else
-#define PATHSEP_C ':'
+# define PATHSEP_C ':'
 #endif
 
 #include <assuan.h>
@@ -64,8 +65,8 @@ gnupg_allow_set_foregound_window (pid_t pid)
     return;
 #ifdef HAVE_W32_SYSTEM
   else if (!AllowSetForegroundWindow (pid))
-    DEBUG (DBG_CRIT, "AllowSetForegroundWindow(%lu) failed: %i\n",
-	   (unsigned long)pid, GetLastError ());
+    DEBUG (DBG_CRIT, "AllowSetForegroundWindow(%lu) failed: %u\n",
+	   (unsigned long)pid, (unsigned int)GetLastError ());
 #endif
 }
 
diff --git a/src/get-path.c b/src/get-path.c
index 521c727..58491fe 100644
--- a/src/get-path.c
+++ b/src/get-path.c
@@ -25,13 +25,30 @@
 #include <stdlib.h>
 #include <string.h>
 #ifdef HAVE_W32_SYSTEM
-#include <windows.h>
-#include <shlobj.h>
-#include <io.h>
+# include <windows.h>
+# include <shlobj.h>
+# include <io.h>
 #endif
 
 #include "support.h"
 
+#ifndef HAVE_STPCPY
+static char *
+my_stpcpy (char *a, const char *b)
+{
+    while( *b )
+	*a++ = *b++;
+    *a = 0;
+
+    return (char*)a;
+}
+# undef stpcpy
+# define stpcpy(a,b) my_stpcpy ((a), (b))
+#endif /* !HAVE_STPCPY */
+
+
+
+
 #ifdef HAVE_W32_SYSTEM
 #define RTLD_LAZY 0
 
@@ -39,6 +56,7 @@ static __inline__ void *
 dlopen (const char * name, int flag)
 {
   void * hd = LoadLibrary (name);
+  (void)flag;
   return hd;
 }
 
diff --git a/src/p11-finalize.c b/src/p11-finalize.c
index 7dbd00b..834046a 100644
--- a/src/p11-finalize.c
+++ b/src/p11-finalize.c
@@ -22,8 +22,8 @@
 #include <config.h>
 #endif
 #ifdef HAVE_W32_SYSTEM
-#define __USE_W32_SOCKETS 1
-#include <windows.h>
+# include <winsock2.h>
+# include <windows.h>
 #endif
 
 #include "cryptoki.h"
diff --git a/src/p11-initialize.c b/src/p11-initialize.c
index 386df0e..6202cb5 100644
--- a/src/p11-initialize.c
+++ b/src/p11-initialize.c
@@ -26,7 +26,8 @@
 
 #ifdef HAVE_W32_SYSTEM
 #define __USE_W32_SOCKETS 1
-#include <windows.h>
+# include <winsock2.h>
+# include <windows.h>
 #endif
 
 #include <assuan.h>
diff --git a/src/support.h b/src/support.h
index 34f67d2..b51f3ac 100644
--- a/src/support.h
+++ b/src/support.h
@@ -65,23 +65,11 @@ scute_copy_string (char *dest, const char *src, int max_len)
 static inline char *
 ttyname (int fd)
 {
+  (void)fd;
   return NULL;
 }
 #endif /* !HAVE_TTYNAME */
 
-#ifndef HAVE_STPCPY
-static inline char *
-stpcpy (char *a, const char *b)
-{
-    while( *b )
-	*a++ = *b++;
-    *a = 0;
-
-    return (char*)a;
-}
-#endif /* !HAVE_STPCPY */
-
-
 
 const char *get_gpgsm_path (void);
 const char *get_gpg_connect_agent_path (void);
diff --git a/tests/t-getslotinfo.c b/tests/t-getslotinfo.c
index 7633e82..caf02c7 100644
--- a/tests/t-getslotinfo.c
+++ b/tests/t-getslotinfo.c
@@ -146,7 +146,7 @@ main (int argc, char *argv[])
   if (loop)
     {
 #ifdef WIN32
-      _sleep (2);
+      Sleep (2*1000);
 #else
       sleep (2);  /* Why? */
 #endif

-----------------------------------------------------------------------

Summary of changes:
 configure.ac          |  8 +-------
 m4/Makefile.am        |  2 +-
 m4/estream.m4         | 48 ------------------------------------------------
 src/agent.c           | 13 +++++++------
 src/get-path.c        | 24 +++++++++++++++++++++---
 src/p11-finalize.c    |  4 ++--
 src/p11-initialize.c  |  3 ++-
 src/support.h         | 14 +-------------
 tests/t-getslotinfo.c |  2 +-
 9 files changed, 36 insertions(+), 82 deletions(-)
 delete mode 100644 m4/estream.m4


hooks/post-receive
-- 
PKCS#11 token on top of gpg-agent
http://git.gnupg.org




More information about the Gnupg-commits mailing list