asn1: Work around missing ENOTSUP (WIN32)
Sufficiently old CRTs on Windows lack ENOTSUP. Use EINVAL instead then.
This commit is contained in:
@@ -273,6 +273,11 @@ init_generate (const char *filename, const char *base)
|
||||
"#define ASN1CALL\n"
|
||||
"#endif\n",
|
||||
headerfile);
|
||||
fputs("#ifndef ENOTSUP\n"
|
||||
"/* Very old MSVC CRTs lack ENOTSUP */\n"
|
||||
"#define ENOTSUP EINVAL\n"
|
||||
"#endif\n",
|
||||
headerfile);
|
||||
fprintf (headerfile, "struct units;\n\n");
|
||||
fprintf (headerfile, "#endif\n\n");
|
||||
if (asprintf(&fn, "%s_files", base) < 0 || fn == NULL)
|
||||
|
@@ -38,6 +38,6 @@ generate_type_print_stub(const Symbol *s)
|
||||
{
|
||||
fprintf(codefile, "char * ASN1CALL\n"
|
||||
"print_%s(const %s *data, int flags)\n"
|
||||
"{ errno = ENOTSUP; return 0; }\n\n",
|
||||
"{ errno = EINVAL; return 0; }\n\n",
|
||||
s->gen_name, s->gen_name);
|
||||
}
|
||||
|
@@ -38,6 +38,11 @@
|
||||
#include <vis.h>
|
||||
#include <vis-extras.h>
|
||||
|
||||
#ifndef ENOTSUP
|
||||
/* Very old MSVC CRTs don't have ENOTSUP */
|
||||
#define ENOTSUP EINVAL
|
||||
#endif
|
||||
|
||||
struct asn1_type_func asn1_template_prim[A1T_NUM_ENTRY] = {
|
||||
#define el(name, type) { \
|
||||
(asn1_type_encode)der_put_##name, \
|
||||
|
Reference in New Issue
Block a user