[git] GPG-ERROR - branch, master, updated. gpgrt-1.28-2-gc36a606

by Werner Koch cvs at cvs.gnupg.org
Wed Mar 14 10:14:45 CET 2018


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 "Error codes used by GnuPG et al.".

The branch, master has been updated
       via  c36a60687976d98b54dac17f699dfca4918a737c (commit)
      from  c0c5fb51c5e87954af0b60fea7f543352998e1cc (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 c36a60687976d98b54dac17f699dfca4918a737c
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Mar 14 10:07:42 2018 +0100

    core: Fix building on W64
    
    * src/w32-add.h: Remove hack to define pid_t.
    * src/gpg-error.h.in: Eval macro to define pid_t.
    * src/mkheader.c (have_sys_types_h, sys_types_h_included): New.
    (parse_config_h): Test for sys/types.h.
    (write_special): Protect inclusion of sys/types.h.  Define new macro
    'define:pid_t'.
    --
    
    Regression-due-to: 1865c0ba1769b407a3c504f1ab0a4278704a9fc1
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in
index f942098..cc2e361 100644
--- a/src/gpg-error.h.in
+++ b/src/gpg-error.h.in
@@ -405,6 +405,7 @@ const char *gpgrt_check_version (const char *req_version);
 const char *gpg_error_check_version (const char *req_version);
 
 /* System specific type definitions.  */
+ at define:pid_t@
 @define:gpgrt_ssize_t@
 @define:gpgrt_off_t@
 
diff --git a/src/mkheader.c b/src/mkheader.c
index 997cab5..2fc5fad 100644
--- a/src/mkheader.c
+++ b/src/mkheader.c
@@ -30,6 +30,7 @@ static const char *hdr_version_number;
 
 /* Values take from the supplied config.h.  */
 static int have_stdint_h;
+static int have_sys_types_h;
 static int have_w32_system;
 static int have_w64_system;
 static char *replacement_for_off_type;
@@ -37,6 +38,7 @@ static int use_posix_threads;
 
 /* Various state flags.  */
 static int stdint_h_included;
+static int sys_types_h_included;
 
 
 /* The usual free wrapper.  */
@@ -151,6 +153,8 @@ parse_config_h (const char *fname)
         continue; /* oops */
       if (!strcmp (p1, "HAVE_STDINT_H"))
         have_stdint_h = 1;
+      else if (!strcmp (p1, "HAVE_SYS_TYPES_H"))
+        have_sys_types_h = 1;
       else if (!strcmp (p1, "HAVE_W32_SYSTEM"))
         have_w32_system = 1;
       else if (!strcmp (p1, "HAVE_W64_SYSTEM"))
@@ -474,8 +478,12 @@ write_special (const char *fname, int lnr, const char *tag)
         }
       else
         {
-          fputs ("#include <sys/types.h>\n"
-                 "typedef ssize_t gpgrt_ssize_t;\n", stdout);
+          if (!sys_types_h_included)
+            {
+              fputs ("#include <sys/types.h>\n", stdout);
+              sys_types_h_included = 1;
+            }
+          fputs ("typedef ssize_t gpgrt_ssize_t;\n", stdout);
         }
     }
   else if (!strcmp (tag, "api_ssize_t"))
@@ -485,6 +493,30 @@ write_special (const char *fname, int lnr, const char *tag)
       else
         fputs ("ssize_t", stdout);
     }
+  else if (!strcmp (tag, "define:pid_t"))
+    {
+      if (have_sys_types_h)
+        {
+          if (!sys_types_h_included)
+            {
+              fputs ("#include <sys/types.h>\n", stdout);
+              sys_types_h_included = 1;
+            }
+        }
+      else if (have_w64_system)
+        {
+          if (!stdint_h_included && have_stdint_h)
+            {
+              fputs ("#include <stdint.h>\n", stdout);
+              stdint_h_included = 1;
+            }
+          fputs ("typedef int64_t pid_t\n", stdout);
+        }
+      else
+        {
+          fputs ("typedef int     pid_t\n", stdout);
+        }
+    }
   else if (!strcmp (tag, "include:err-sources"))
     {
       write_sources_or_codes (NULL);
diff --git a/src/w32-add.h b/src/w32-add.h
index 6f9f12a..07e3c7d 100644
--- a/src/w32-add.h
+++ b/src/w32-add.h
@@ -3,10 +3,6 @@
 ## peculiarity of the script the first used line must not
 ## start with a hash mark.
 
-/* Fixme: This is a quick hack.  We need to check whether the compiler
- * actually in use already knows that type.  */
-typedef int pid_t;
-
 /* Decide whether to use the format_arg attribute.  */
 #if _GPG_ERR_GCC_VERSION > 20800
 # define _GPG_ERR_ATTR_FORMAT_ARG(a)  __attribute__ ((__format_arg__ (a)))

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

Summary of changes:
 src/gpg-error.h.in |  1 +
 src/mkheader.c     | 36 ++++++++++++++++++++++++++++++++++--
 src/w32-add.h      |  4 ----
 3 files changed, 35 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Error codes used by GnuPG et al.
http://git.gnupg.org




More information about the Gnupg-commits mailing list