From 9cf8342f53b6c3071da88916189a1e655b63a160 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 5 Aug 2014 16:25:46 +0000
Subject: haiku patch


diff --git a/src/mkerrcodes2.awk b/src/mkerrcodes2.awk
index ea58503..93cfef2 100644
--- a/src/mkerrcodes2.awk
+++ b/src/mkerrcodes2.awk
@@ -81,7 +81,7 @@ BEGIN {
 /^#/ { next; }
 
 header {
-  if ($1 ~ /^[0123456789]+$/)
+  if ($1 ~ /^-?[0123456789]+$/)
     {
       print "static const int err_code_from_index[] = {";
       header = 0;
-- 
2.19.1


From f72c66f6b2acd2e4208407d0f0e2cce6bc1d0930 Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Wed, 17 Jan 2018 22:03:45 +0000
Subject: Do not use __GNUC_PATCHLEVEL__ if it's not defined.


diff --git a/doc/yat2m.c b/doc/yat2m.c
index 3c7b363..8aaf4c5 100644
--- a/doc/yat2m.c
+++ b/doc/yat2m.c
@@ -105,9 +105,14 @@
 
 
 #if __GNUC__
+# ifdef __GNUC_PATCHLEVEL__
 # define MY_GCC_VERSION (__GNUC__ * 10000 \
                          + __GNUC_MINOR__ * 100         \
                          + __GNUC_PATCHLEVEL__)
+# else
+# define MY_GCC_VERSION (__GNUC__ * 10000 \
+                         + __GNUC_MINOR__ * 100)
+# endif
 #else
 # define MY_GCC_VERSION 0
 #endif
diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in
index 1b9be09..75f949f 100644
--- a/src/gpg-error.h.in
+++ b/src/gpg-error.h.in
@@ -153,9 +153,14 @@ typedef unsigned int gpg_error_t;
  * GCC feature test.
  */
 #if __GNUC__
+# ifdef __GNUC_PATCHLEVEL__
 # define _GPG_ERR_GCC_VERSION (__GNUC__ * 10000 \
                                + __GNUC_MINOR__ * 100 \
                                + __GNUC_PATCHLEVEL__)
+# else
+# define _GPG_ERR_GCC_VERSION (__GNUC__ * 10000 \
+                               + __GNUC_MINOR__ * 100)
+# endif
 #else
 # define _GPG_ERR_GCC_VERSION 0
 #endif
-- 
2.19.1


From ffb1db9f6ef947eab0412c3304d3960485cb4fef Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 21 Mar 2019 23:22:43 +0100
Subject: gpg-error.c: remove preprocessing in macro for gcc2.


diff --git a/src/gpg-error.c b/src/gpg-error.c
index 2eb5e7b..44ceac4 100644
--- a/src/gpg-error.c
+++ b/src/gpg-error.c
@@ -494,11 +494,7 @@ main (int argc, char *argv[])
     ARGPARSE_c (CMD_DEFINES, "defines",
                 "Print all error codes as #define lines"),
     ARGPARSE_c (CMD_LOCALE, "locale",
-#if HAVE_W32_SYSTEM
-                "Return the locale used for gettext"
-#else
                 "@"
-#endif
                 ),
     ARGPARSE_s_n (OPT_DESC, "desc",
                   "Print with error description"),
-- 
2.19.1

