widl: Updated to Wine version a4e77b33f6897d930261634c1b3ba5e4edc209f3. Signed-off-by: Jacek Caban <jacek@codeweavers.com>
diff --git a/mingw-w64-tools/widl/VERSION b/mingw-w64-tools/widl/VERSION index d50d9a8..0b3ea1e 100644 --- a/mingw-w64-tools/widl/VERSION +++ b/mingw-w64-tools/widl/VERSION
@@ -1 +1 @@ -WIDL version 9.17 +WIDL version 9.18
diff --git a/mingw-w64-tools/widl/configure b/mingw-w64-tools/widl/configure index 788729e..56c448f 100755 --- a/mingw-w64-tools/widl/configure +++ b/mingw-w64-tools/widl/configure
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for widl 9.17. +# Generated by GNU Autoconf 2.71 for widl 9.18. # # Report bugs to <mingw-w64-public@lists.sourceforge.net>. # @@ -610,8 +610,8 @@ # Identity of this package. PACKAGE_NAME='widl' PACKAGE_TARNAME='widl' -PACKAGE_VERSION='9.17' -PACKAGE_STRING='widl 9.17' +PACKAGE_VERSION='9.18' +PACKAGE_STRING='widl 9.18' PACKAGE_BUGREPORT='mingw-w64-public@lists.sourceforge.net' PACKAGE_URL='' @@ -1318,7 +1318,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures widl 9.17 to adapt to many kinds of systems. +\`configure' configures widl 9.18 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1390,7 +1390,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of widl 9.17:";; + short | recursive ) echo "Configuration of widl 9.18:";; esac cat <<\_ACEOF @@ -1492,7 +1492,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -widl configure 9.17 +widl configure 9.18 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1904,7 +1904,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by widl $as_me 9.17, which was +It was created by widl $as_me 9.18, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3294,7 +3294,7 @@ # Define the identity of the package. PACKAGE='widl' - VERSION='9.17' + VERSION='9.18' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5761,7 +5761,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by widl $as_me 9.17, which was +This file was extended by widl $as_me 9.18, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5829,7 +5829,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -widl config.status 9.17 +widl config.status 9.18 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\"
diff --git a/mingw-w64-tools/widl/include/basetsd.h b/mingw-w64-tools/widl/include/basetsd.h index c16d554..eb12478 100644 --- a/mingw-w64-tools/widl/include/basetsd.h +++ b/mingw-w64-tools/widl/include/basetsd.h
@@ -65,9 +65,17 @@ # endif #endif /* !defined(_MSC_VER) */ +#ifndef __has_declspec_attribute +# if defined(_MSC_VER) +# define __has_declspec_attribute(x) 1 +# else +# define __has_declspec_attribute(x) 0 +# endif +#endif + /* FIXME: DECLSPEC_ALIGN should be declared only in winnt.h, but we need it here too */ #ifndef DECLSPEC_ALIGN -# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) +# if __has_declspec_attribute(align) && !defined(MIDL_PASS) # define DECLSPEC_ALIGN(x) __declspec(align(x)) # elif defined(__GNUC__) # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
diff --git a/mingw-w64-tools/widl/include/windef.h b/mingw-w64-tools/widl/include/windef.h index 79a9679..f8438f8 100644 --- a/mingw-w64-tools/widl/include/windef.h +++ b/mingw-w64-tools/widl/include/windef.h
@@ -186,7 +186,11 @@ #undef NULL #ifdef __cplusplus -#define NULL 0 +#ifndef _WIN64 +#define NULL 0 +#else +#define NULL 0LL +#endif #else #define NULL ((void*)0) #endif
diff --git a/mingw-w64-tools/widl/include/winnt.h b/mingw-w64-tools/widl/include/winnt.h index de12c1c..4830ca4 100644 --- a/mingw-w64-tools/widl/include/winnt.h +++ b/mingw-w64-tools/widl/include/winnt.h
@@ -52,7 +52,7 @@ #define FASTCALL __fastcall #ifndef DECLSPEC_IMPORT -# if defined(_MSC_VER) +# if __has_declspec_attribute(dllimport) # define DECLSPEC_IMPORT __declspec(dllimport) # elif defined(__MINGW32__) || defined(__CYGWIN__) # define DECLSPEC_IMPORT __attribute__((dllimport)) @@ -64,7 +64,7 @@ #endif #ifndef DECLSPEC_NORETURN -# if defined(_MSC_VER) && (_MSC_VER >= 1200) && !defined(MIDL_PASS) +# if __has_declspec_attribute(noreturn) && !defined(MIDL_PASS) # define DECLSPEC_NORETURN __declspec(noreturn) # elif defined(__GNUC__) # define DECLSPEC_NORETURN __attribute__((noreturn)) @@ -74,7 +74,7 @@ #endif #ifndef DECLSPEC_ALIGN -# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) +# if __has_declspec_attribute(align) && !defined(MIDL_PASS) # define DECLSPEC_ALIGN(x) __declspec(align(x)) # elif defined(__GNUC__) # define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) @@ -84,7 +84,7 @@ #endif #ifndef DECLSPEC_NOTHROW -# if defined(_MSC_VER) && (_MSC_VER >= 1200) && !defined(MIDL_PASS) +# if __has_declspec_attribute(nothrow) && !defined(MIDL_PASS) # define DECLSPEC_NOTHROW __declspec(nothrow) # elif defined(__GNUC__) # define DECLSPEC_NOTHROW __attribute__((nothrow)) @@ -98,7 +98,7 @@ #endif #ifndef DECLSPEC_UUID -# if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined (__cplusplus) +# if __has_declspec_attribute(uuid) && defined (__cplusplus) # define DECLSPEC_UUID(x) __declspec(uuid(x)) # else # define DECLSPEC_UUID(x) @@ -106,7 +106,7 @@ #endif #ifndef DECLSPEC_NOVTABLE -# if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined(__cplusplus) +# if __has_declspec_attribute(novtable) && defined(__cplusplus) # define DECLSPEC_NOVTABLE __declspec(novtable) # else # define DECLSPEC_NOVTABLE @@ -114,7 +114,7 @@ #endif #ifndef DECLSPEC_SELECTANY -#if defined(_MSC_VER) && (_MSC_VER >= 1100) +# if __has_declspec_attribute(selectany) #define DECLSPEC_SELECTANY __declspec(selectany) #elif defined(__MINGW32__) #define DECLSPEC_SELECTANY __attribute__((selectany)) @@ -138,7 +138,7 @@ #endif #ifndef DECLSPEC_ADDRSAFE -# if defined(_MSC_VER) && (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64)) +# if __has_declspec_attribute(address_safe) && (defined(_M_ALPHA) || defined(_M_AXP64)) # define DECLSPEC_ADDRSAFE __declspec(address_safe) # else # define DECLSPEC_ADDRSAFE @@ -156,7 +156,7 @@ #endif #ifndef DECLSPEC_NOINLINE -# if defined(_MSC_VER) && (_MSC_VER >= 1300) +# if __has_declspec_attribute(noinline) # define DECLSPEC_NOINLINE __declspec(noinline) # elif defined(__GNUC__) # define DECLSPEC_NOINLINE __attribute__((noinline)) @@ -166,7 +166,7 @@ #endif #ifndef DECLSPEC_DEPRECATED -# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) +# if __has_declspec_attribute(deprecated) && !defined(MIDL_PASS) # define DECLSPEC_DEPRECATED __declspec(deprecated) # define DEPRECATE_SUPPORTED # elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2))) @@ -183,7 +183,7 @@ #if defined(__WINESRC__) && !defined(WINE_UNIX_LIB) /* Wine uses .spec file for PE exports */ # define DECLSPEC_EXPORT -#elif defined(_MSC_VER) +#elif __has_declspec_attribute(dllexport) # define DECLSPEC_EXPORT __declspec(dllexport) #elif defined(__MINGW32__) # define DECLSPEC_EXPORT __attribute__((dllexport)) @@ -206,7 +206,7 @@ #ifndef DECLSPEC_CHPE_PATCHABLE # ifndef __arm64ec__ # define DECLSPEC_CHPE_PATCHABLE -# elif defined(_MSC_VER) +# elif __has_declspec_attribute(hybrid_patchable) # define DECLSPEC_CHPE_PATCHABLE __declspec(hybrid_patchable) # else # define DECLSPEC_CHPE_PATCHABLE __attribute__((hybrid_patchable))
diff --git a/mingw-w64-tools/widl/src/header.c b/mingw-w64-tools/widl/src/header.c index f0fa1b2..27ef8b5 100644 --- a/mingw-w64-tools/widl/src/header.c +++ b/mingw-w64-tools/widl/src/header.c
@@ -109,7 +109,7 @@ { static char buf[37]; - sprintf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + snprintf(buf, sizeof(buf), "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", uuid->Data1, uuid->Data2, uuid->Data3, uuid->Data4[0], uuid->Data4[1], uuid->Data4[2], uuid->Data4[3], uuid->Data4[4], uuid->Data4[5], uuid->Data4[6], uuid->Data4[7]); @@ -199,7 +199,7 @@ if(nameless_struct_cnt == 1) { name = "__C89_NAMELESSSTRUCTNAME"; }else if(nameless_struct_i < 5 /* # of supporting macros */) { - sprintf(buf, "__C89_NAMELESSSTRUCTNAME%d", ++nameless_struct_i); + snprintf(buf, sizeof(buf), "__C89_NAMELESSSTRUCTNAME%d", ++nameless_struct_i); name = buf; } } @@ -210,7 +210,7 @@ if(nameless_union_cnt == 1) { name = "__C89_NAMELESSUNIONNAME"; }else if(nameless_union_i < 8 /* # of supporting macros */ ) { - sprintf(buf, "__C89_NAMELESSUNIONNAME%d", ++nameless_union_i); + snprintf(buf, sizeof(buf), "__C89_NAMELESSUNIONNAME%d", ++nameless_union_i); name = buf; } } @@ -1049,9 +1049,9 @@ { static char buff[255]; if (is_inherited_method(iface, func)) - sprintf(buff, "%s_%s", iface->name, get_name(func)); + snprintf(buff, sizeof(buff), "%s_%s", iface->name, get_name(func)); else - sprintf(buff, "%s", get_name(func)); + snprintf(buff, sizeof(buff), "%s", get_name(func)); return buff; }
diff --git a/mingw-w64-tools/widl/src/ppl.l b/mingw-w64-tools/widl/src/ppl.l index 4748d73..947b344 100644 --- a/mingw-w64-tools/widl/src/ppl.l +++ b/mingw-w64-tools/widl/src/ppl.l
@@ -907,12 +907,12 @@ if(!strcmp(ppp->ident, "__LINE__")) { buf = xrealloc(buf, 32); - sprintf(buf, "%d", pp_status.line_number); + snprintf(buf, 32, "%d", pp_status.line_number); } else if(!strcmp(ppp->ident, "__FILE__")) { buf = xrealloc(buf, strlen(pp_status.input) + 3); - sprintf(buf, "\"%s\"", pp_status.input); + snprintf(buf, strlen(pp_status.input) + 3, "\"%s\"", pp_status.input); } if(pp_flex_debug)
diff --git a/mingw-w64-tools/widl/src/ppl.yy.c b/mingw-w64-tools/widl/src/ppl.yy.c index ec3ff83..a1ff081 100644 --- a/mingw-w64-tools/widl/src/ppl.yy.c +++ b/mingw-w64-tools/widl/src/ppl.yy.c
@@ -4115,12 +4115,12 @@ if(!strcmp(ppp->ident, "__LINE__")) { buf = xrealloc(buf, 32); - sprintf(buf, "%d", pp_status.line_number); + snprintf(buf, 32, "%d", pp_status.line_number); } else if(!strcmp(ppp->ident, "__FILE__")) { buf = xrealloc(buf, strlen(pp_status.input) + 3); - sprintf(buf, "\"%s\"", pp_status.input); + snprintf(buf, strlen(pp_status.input) + 3, "\"%s\"", pp_status.input); } if(pp_flex_debug)
diff --git a/mingw-w64-tools/widl/src/register.c b/mingw-w64-tools/widl/src/register.c index 02861f3..c5600c9 100644 --- a/mingw-w64-tools/widl/src/register.c +++ b/mingw-w64-tools/widl/src/register.c
@@ -37,10 +37,11 @@ static const char *format_uuid( const struct uuid *uuid ) { static char buffer[40]; - sprintf( buffer, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", - uuid->Data1, uuid->Data2, uuid->Data3, - uuid->Data4[0], uuid->Data4[1], uuid->Data4[2], uuid->Data4[3], - uuid->Data4[4], uuid->Data4[5], uuid->Data4[6], uuid->Data4[7] ); + snprintf( buffer, sizeof(buffer), + "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + uuid->Data1, uuid->Data2, uuid->Data3, + uuid->Data4[0], uuid->Data4[1], uuid->Data4[2], uuid->Data4[3], + uuid->Data4[4], uuid->Data4[5], uuid->Data4[6], uuid->Data4[7] ); return buffer; } @@ -358,7 +359,7 @@ expr = get_attrp( typelib->attrs, ATTR_ID ); if (expr) { - sprintf(id_part, "\\%d", expr->cval); + snprintf(id_part, sizeof(id_part), "\\%d", expr->cval); resname = strmake("%s\\%d", typelib_name, expr->cval); } put_str( indent, "'%x' { %s = s '%%MODULE%%%s' }\n",
diff --git a/mingw-w64-tools/widl/src/typegen.c b/mingw-w64-tools/widl/src/typegen.c index 921bdd8..c29bbba 100644 --- a/mingw-w64-tools/widl/src/typegen.c +++ b/mingw-w64-tools/widl/src/typegen.c
@@ -1270,7 +1270,7 @@ if (flags & IsBasetype) strcat( buffer, " base type," ); if (flags & IsByValue) strcat( buffer, " by value," ); if (flags & IsSimpleRef) strcat( buffer, " simple ref," ); - if (flags >> 13) sprintf( buffer + strlen(buffer), " srv size=%u,", (flags >> 13) * 8 ); + if (flags >> 13) snprintf( buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), " srv size=%u,", (flags >> 13) * 8 ); strcpy( buffer + strlen( buffer ) - 1, " */" ); print_file( file, indent, "NdrFcShort(0x%hx),\t%s\n", flags, buffer ); print_file( file, indent, "NdrFcShort(0x%x), /* stack offset = %u */\n", @@ -4896,7 +4896,7 @@ type_to_print = &var->declspec; else type_to_print = type_pointer_get_ref(var->declspec.type); - sprintf(name, "_W%u", i++); + snprintf(name, sizeof(name), "_W%u", i++); write_type_decl(file, type_to_print, name); fprintf(file, ";\n"); }
diff --git a/mingw-w64-tools/widl/src/widl.c b/mingw-w64-tools/widl/src/widl.c index ef9ced0..deff5b8 100644 --- a/mingw-w64-tools/widl/src/widl.c +++ b/mingw-w64-tools/widl/src/widl.c
@@ -243,7 +243,7 @@ if (p) version += atoi(p + 1); - sprintf(version_str, "__WIDL__=0x%x", version); + snprintf(version_str, sizeof(version_str), "__WIDL__=0x%x", version); wpp_add_cmdline_define(version_str); }
diff --git a/mingw-w64-tools/widl/src/write_msft.c b/mingw-w64-tools/widl/src/write_msft.c index 66401fd..b0401d8 100644 --- a/mingw-w64-tools/widl/src/write_msft.c +++ b/mingw-w64-tools/widl/src/write_msft.c
@@ -2741,7 +2741,7 @@ expr_t *expr = get_attrp( typelib->typelib->attrs, ATTR_ID ); if (expr) - sprintf( typelib_id, "#%d", expr->cval ); + snprintf( typelib_id, sizeof(typelib_id), "#%d", expr->cval ); add_output_to_resources( "TYPELIB", typelib_id ); if (strendswith( typelib_name, "_t.res" )) /* add typelib registration */ output_typelib_regscript( typelib->typelib ); @@ -2817,7 +2817,7 @@ * - a string representation of those */ cur_time = 2147483647; - sprintf(info_string, "Created by WIDL version %s at %s", PACKAGE_VERSION, asctime(gmtime(&cur_time))); + snprintf(info_string, sizeof(info_string), "Created by WIDL version %s at %s", PACKAGE_VERSION, asctime(gmtime(&cur_time))); set_custdata(msft, &midl_info_guid, VT_BSTR, info_string, &msft->typelib_header.CustomDataOffset); set_custdata(msft, &midl_time_guid, VT_UI4, &cur_time, &msft->typelib_header.CustomDataOffset); set_custdata(msft, &midl_version_guid, VT_UI4, &version, &msft->typelib_header.CustomDataOffset);
diff --git a/mingw-w64-tools/widl/src/write_sltg.c b/mingw-w64-tools/widl/src/write_sltg.c index 497cfb9..414a8ec 100644 --- a/mingw-w64-tools/widl/src/write_sltg.c +++ b/mingw-w64-tools/widl/src/write_sltg.c
@@ -544,7 +544,7 @@ for (i = 0; i < hrefmap->href_count; i++) { - sprintf(name, "*\\Rffff*#%x", hrefmap->href[i]); + snprintf(name, sizeof(name), "*\\Rffff*#%x", hrefmap->href[i]); hrefinfo_size += 8 + 2 + strlen(name); } @@ -581,7 +581,7 @@ { short len; - sprintf(name, "*\\Rffff*#%x", hrefmap->href[i]); + snprintf(name, sizeof(name), "*\\Rffff*#%x", hrefmap->href[i]); len = strlen(name); append_data(data, &len, sizeof(len)); @@ -1733,7 +1733,7 @@ expr_t *expr = get_attrp(typelib->typelib->attrs, ATTR_ID); if (expr) - sprintf(typelib_id, "#%d", expr->cval); + snprintf(typelib_id, sizeof(typelib_id), "#%d", expr->cval); add_output_to_resources("TYPELIB", typelib_id); if (strendswith(typelib_name, "_t.res")) /* add typelib registration */ output_typelib_regscript(typelib->typelib);