asn1: Include <errno.h> before using/checking bits from it
authorPino Toscano <toscano.pino@tiscali.it>
Sat, 6 Jun 2026 20:25:09 +0000 (22:25 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 30 Jun 2026 19:37:50 +0000 (22:37 +0300)
Origin: upstream, https://github.com/heimdal/heimdal/commit/2194be6c9259f79b97131cec8ae44e1180b4f309
Forwarded: not-needed

Commit 232c936ea3eabfd702aaaa106ddf9474f231d776 added a fallback ENOTSUP
definition. The check itself and the fallback definition rely on
<errno.h> to be included already, so in case it was not (depending on
the platform) then there will be a wrong definition of ENOTSUP.

Instead of rely on <errno.h> to be included before including a
generated header from this tool, include it manually. This way both
the ENOTSUP check and its fallback definition (if ever) will always
work.

Gbp-Pq: Name heimdal-errno-include.patch

third_party/heimdal/lib/asn1/gen.c
third_party/heimdal/lib/asn1/template.c

index 55ec5f647d752bce18532f373f177e3271656b7c..bdacaa7a34a1c0665bffb42679ffc86a0c844152 100644 (file)
@@ -191,6 +191,7 @@ init_generate (const char *filename, const char *base)
     fprintf (headerfile,
             "#include <stddef.h>\n"
             "#include <stdint.h>\n"
+            "#include <errno.h>\n"
             "#include <time.h>\n\n");
     fprintf (headerfile,
             "#ifndef __asn1_common_definitions__\n"
index ed215d88874aa0b80adf225920dc6eb829026ca2..96438876ee9eb331f695a927b5c2cb57d79fed64 100644 (file)
@@ -38,6 +38,7 @@
 #include <vis.h>
 #include <vis-extras.h>
 #include <heimbase.h>
+#include <errno.h>
 
 #ifndef ENOTSUP
 /* Very old MSVC CRTs don't have ENOTSUP */