1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-02-13 18:33:03 +01:00

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.
This commit is contained in:
Werner Koch 2025-02-06 14:40:46 +01:00
parent 9dba5ab403
commit 0ec989ee3f
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -44,6 +44,16 @@
# endif # endif
#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' */ /* Used for documentation purposes, to signal functions in 'interface' */
#define INTERFACE #define INTERFACE
@ -169,7 +179,7 @@ type_to_string (enum scheme_types typ)
case T_SINK: return "sink"; case T_SINK: return "sink";
case T_FRAME: return "frame"; case T_FRAME: return "frame";
} }
#ifdef __GNUC__ #if MY_GCC_VERSION >= 40500 /* gcc >= 4.5.0 */
__builtin_unreachable (); __builtin_unreachable ();
#else #else
assert (! "not reached"); assert (! "not reached");