aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2025-02-06 13:40:46 +0000
committerWerner Koch <[email protected]>2025-02-06 13:40:46 +0000
commit0ec989ee3fde534d841d43a0527871a41aefaa5f (patch)
tree3dd87b66620ec69aed3e6bb074a534ba31f3b951 /tests
parentgpg: Fix --quick-add-key for Weierstrass ECC with usage given. (diff)
downloadgnupg-0ec989ee3fde534d841d43a0527871a41aefaa5f.tar.gz
gnupg-0ec989ee3fde534d841d43a0527871a41aefaa5f.zip
gpgscm: Fix for gcc < 4.5
* tests/gpgscm/scheme.c (MY_GCC_VERSION): New. (type_to_string): Use gcc build in only when supported. -- Note that we do not wnat to use the GPGRT macro to keep this file as close to upstream as possible.
Diffstat (limited to 'tests')
-rw-r--r--tests/gpgscm/scheme.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 003e85037..952cf63b0 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -44,6 +44,16 @@
# endif
#endif
+#if __GNUC__
+# define MY_GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+#else
+# define MY_GCC_VERSION 0
+#endif
+
+
+
/* Used for documentation purposes, to signal functions in 'interface' */
#define INTERFACE
@@ -169,7 +179,7 @@ type_to_string (enum scheme_types typ)
case T_SINK: return "sink";
case T_FRAME: return "frame";
}
-#ifdef __GNUC__
+#if MY_GCC_VERSION >= 40500 /* gcc >= 4.5.0 */
__builtin_unreachable ();
#else
assert (! "not reached");