widl: Import Wine version 10.8 Signed-off-by: Jacek Caban <jacek@codeweavers.com>
diff --git a/mingw-w64-tools/widl/VERSION b/mingw-w64-tools/widl/VERSION index 0636f42..c8b6a6e 100644 --- a/mingw-w64-tools/widl/VERSION +++ b/mingw-w64-tools/widl/VERSION
@@ -1 +1 @@ -WIDL version 10.4 +WIDL version 10.8
diff --git a/mingw-w64-tools/widl/configure b/mingw-w64-tools/widl/configure index df93cae..d6d92f2 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.72 for widl 10.4. +# Generated by GNU Autoconf 2.72 for widl 10.8. # # Report bugs to <mingw-w64-public@lists.sourceforge.net>. # @@ -603,8 +603,8 @@ # Identity of this package. PACKAGE_NAME='widl' PACKAGE_TARNAME='widl' -PACKAGE_VERSION='10.4' -PACKAGE_STRING='widl 10.4' +PACKAGE_VERSION='10.8' +PACKAGE_STRING='widl 10.8' PACKAGE_BUGREPORT='mingw-w64-public@lists.sourceforge.net' PACKAGE_URL='' @@ -1311,7 +1311,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 10.4 to adapt to many kinds of systems. +'configure' configures widl 10.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1383,7 +1383,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of widl 10.4:";; + short | recursive ) echo "Configuration of widl 10.8:";; esac cat <<\_ACEOF @@ -1485,7 +1485,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -widl configure 10.4 +widl configure 10.8 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. @@ -1910,7 +1910,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 10.4, which was +It was created by widl $as_me 10.8, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -3327,7 +3327,7 @@ # Define the identity of the package. PACKAGE='widl' - VERSION='10.4' + VERSION='10.8' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5797,7 +5797,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 10.4, which was +This file was extended by widl $as_me 10.8, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5865,7 +5865,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -widl config.status 10.4 +widl config.status 10.8 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\"
diff --git a/mingw-w64-tools/widl/include/basetsd.h b/mingw-w64-tools/widl/include/basetsd.h index 3f1f855..6eb7656 100644 --- a/mingw-w64-tools/widl/include/basetsd.h +++ b/mingw-w64-tools/widl/include/basetsd.h
@@ -160,7 +160,7 @@ #if !defined(__midl) && !defined(__WIDL__) -#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) +#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) && !defined(WINE_UNIX_LIB) static inline unsigned long HandleToULong(const void *h) { @@ -206,7 +206,7 @@ } -#endif /* !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) */ +#endif /* !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) && !defined(WINE_UNIX_LIB) */ static inline void *ULongToHandle(ULONG32 ul) {
diff --git a/mingw-w64-tools/widl/include/guiddef.h b/mingw-w64-tools/widl/include/guiddef.h index b9ae4de..d447388 100644 --- a/mingw-w64-tools/widl/include/guiddef.h +++ b/mingw-w64-tools/widl/include/guiddef.h
@@ -30,7 +30,7 @@ #else typedef struct _GUID { -#ifndef __LP64__ +#if !defined(__LP64__) && !defined(WINE_UNIX_LIB) unsigned long Data1; #else unsigned int Data1;
diff --git a/mingw-w64-tools/widl/include/memoryapi.h b/mingw-w64-tools/widl/include/memoryapi.h index 6728b83..2cfcdd5 100644 --- a/mingw-w64-tools/widl/include/memoryapi.h +++ b/mingw-w64-tools/widl/include/memoryapi.h
@@ -41,6 +41,6 @@ SIZE_T CommitSize; } WIN32_MEMORY_REGION_INFORMATION; -DWORD WINAPI DiscardVirtualMemory(void *addr, SIZE_T size); -BOOL WINAPI QueryVirtualMemoryInformation(HANDLE process,const void *addr, - WIN32_MEMORY_INFORMATION_CLASS info_class, void *info, SIZE_T size, SIZE_T *ret_size); +WINBASEAPI HANDLE WINAPI CreateFileMapping2(HANDLE,LPSECURITY_ATTRIBUTES,ULONG,ULONG,ULONG,ULONG64,const WCHAR*,MEM_EXTENDED_PARAMETER*,ULONG); +WINBASEAPI DWORD WINAPI DiscardVirtualMemory(void *addr, SIZE_T size); +WINBASEAPI BOOL WINAPI QueryVirtualMemoryInformation(HANDLE process,const void *addr, WIN32_MEMORY_INFORMATION_CLASS info_class, void *info, SIZE_T size, SIZE_T *ret_size);
diff --git a/mingw-w64-tools/widl/include/minwindef.h b/mingw-w64-tools/widl/include/minwindef.h index 17da5d9..0e386ad 100644 --- a/mingw-w64-tools/widl/include/minwindef.h +++ b/mingw-w64-tools/widl/include/minwindef.h
@@ -21,8 +21,6 @@ #ifndef _MINWINDEF_ #define _MINWINDEF_ -#include <minwindef.h> - #ifndef NO_STRICT # ifndef STRICT # define STRICT @@ -208,7 +206,7 @@ #define BASETYPES typedef unsigned char UCHAR, *PUCHAR; typedef unsigned short USHORT, *PUSHORT; -#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) +#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) && !defined(WINE_UNIX_LIB) typedef unsigned long ULONG, *PULONG; #else typedef unsigned int ULONG, *PULONG; @@ -224,7 +222,7 @@ typedef unsigned int UINT, *PUINT; typedef float FLOAT, *PFLOAT; typedef char *PSZ; -#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) +#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) && !defined(WINE_UNIX_LIB) typedef long *LPLONG; typedef unsigned long DWORD, *PDWORD, *LPDWORD; #else
diff --git a/mingw-w64-tools/widl/include/sysinfoapi.h b/mingw-w64-tools/widl/include/sysinfoapi.h index 188ad07..cf40a18 100644 --- a/mingw-w64-tools/widl/include/sysinfoapi.h +++ b/mingw-w64-tools/widl/include/sysinfoapi.h
@@ -46,7 +46,7 @@ WORD wProcessorRevision; } SYSTEM_INFO, *LPSYSTEM_INFO; -#include <pshpack8.h> +#pragma pack(push,8) typedef struct tagMEMORYSTATUSEX { DWORD dwLength; DWORD dwMemoryLoad; @@ -58,7 +58,7 @@ DWORDLONG DECLSPEC_ALIGN(8) ullAvailVirtual; DWORDLONG DECLSPEC_ALIGN(8) ullAvailExtendedVirtual; } MEMORYSTATUSEX, *LPMEMORYSTATUSEX; -#include <poppack.h> +#pragma pack(pop) typedef enum _COMPUTER_NAME_FORMAT {
diff --git a/mingw-w64-tools/widl/include/winbase.h b/mingw-w64-tools/widl/include/winbase.h index e4eec95..f75b750 100644 --- a/mingw-w64-tools/widl/include/winbase.h +++ b/mingw-w64-tools/widl/include/winbase.h
@@ -1273,7 +1273,7 @@ #define STREAM_CONTAINS_PROPERTIES 4 #define STREAM_SPARSE_ATTRIBUTE 8 -#include <pshpack8.h> +#pragma pack(push,8) typedef struct _WIN32_STREAM_ID { DWORD dwStreamId; DWORD dwStreamAttributes; @@ -1281,7 +1281,7 @@ DWORD dwStreamNameSize; WCHAR cStreamName[ANYSIZE_ARRAY]; } WIN32_STREAM_ID, *LPWIN32_STREAM_ID; -#include <poppack.h> +#pragma pack(pop) /* GetBinaryType return values. @@ -1498,6 +1498,8 @@ WINADVAPI BOOL WINAPI AdjustTokenPrivileges(HANDLE,BOOL,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD); WINADVAPI BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *); WINADVAPI BOOL WINAPI AllocateLocallyUniqueId(PLUID); +WINBASEAPI HRESULT WINAPI ApplicationRecoveryInProgress(PBOOL); +WINBASEAPI VOID WINAPI ApplicationRecoveryFinished(BOOL); WINADVAPI BOOL WINAPI AreAllAccessesGranted(DWORD,DWORD); WINADVAPI BOOL WINAPI AreAnyAccessesGranted(DWORD,DWORD); WINBASEAPI BOOL WINAPI AreFileApisANSI(void); @@ -2295,6 +2297,8 @@ WINBASEAPI BOOL WINAPI ReadFileEx(HANDLE,LPVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE); WINBASEAPI BOOL WINAPI ReadFileScatter(HANDLE,FILE_SEGMENT_ELEMENT*,DWORD,LPDWORD,LPOVERLAPPED); WINBASEAPI BOOL WINAPI ReadProcessMemory(HANDLE,LPCVOID,LPVOID,SIZE_T,SIZE_T*); +WINBASEAPI HRESULT WINAPI RegisterApplicationRecoveryCallback(APPLICATION_RECOVERY_CALLBACK,PVOID,DWORD,DWORD); +WINBASEAPI HRESULT WINAPI RegisterApplicationRestart(PCWSTR,DWORD); WINADVAPI HANDLE WINAPI RegisterEventSourceA(LPCSTR,LPCSTR); WINADVAPI HANDLE WINAPI RegisterEventSourceW(LPCWSTR,LPCWSTR); #define RegisterEventSource WINELIB_NAME_AW(RegisterEventSource) @@ -2445,6 +2449,7 @@ WINBASEAPI BOOL WINAPI UnmapViewOfFile2(HANDLE,PVOID,ULONG); WINBASEAPI BOOL WINAPI UnmapViewOfFileEx(PVOID,ULONG); WINBASEAPI BOOL WINAPI UmsThreadYield(void *); +WINBASEAPI HRESULT WINAPI UnregisterApplicationRecoveryCallback(void); WINBASEAPI HRESULT WINAPI UnregisterApplicationRestart(void); WINBASEAPI BOOL WINAPI UnregisterWait(HANDLE); WINBASEAPI BOOL WINAPI UnregisterWaitEx(HANDLE,HANDLE);
diff --git a/mingw-w64-tools/widl/include/winerror.h b/mingw-w64-tools/widl/include/winerror.h index 8ef582d..57fede1 100644 --- a/mingw-w64-tools/widl/include/winerror.h +++ b/mingw-w64-tools/widl/include/winerror.h
@@ -199,7 +199,7 @@ #define __HRESULT_FROM_WIN32(x) ((HRESULT)(x) > 0 ? ((HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000)) : (HRESULT)(x) ) #ifndef _HRESULT_DEFINED #define _HRESULT_DEFINED -#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) +#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) && !defined(WINE_UNIX_LIB) typedef long HRESULT; #else typedef int HRESULT;
diff --git a/mingw-w64-tools/widl/include/winnt.h b/mingw-w64-tools/widl/include/winnt.h index 8e85f4e..c5bd89d 100644 --- a/mingw-w64-tools/widl/include/winnt.h +++ b/mingw-w64-tools/widl/include/winnt.h
@@ -469,7 +469,7 @@ typedef BYTE BOOLEAN, *PBOOLEAN; typedef char CHAR, *PCHAR; typedef short SHORT, *PSHORT; -#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) +#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) && !defined(WINE_UNIX_LIB) typedef long LONG, *PLONG; #else typedef int LONG, *PLONG; @@ -607,7 +607,7 @@ /* Macro to deal with LP64 <=> LLP64 differences in numeric constants with 'l' modifier */ #ifndef __MSABI_LONG -#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) +#if !defined(__LP64__) && !defined(WINE_NO_LONG_TYPES) && !defined(WINE_UNIX_LIB) # define __MSABI_LONG(x) x ## l # else # define __MSABI_LONG(x) x @@ -1144,7 +1144,7 @@ #define I386_MAXIMUM_SUPPORTED_EXTENSION 512 -#include "pshpack4.h" +#pragma pack(push,4) typedef struct _I386_CONTEXT { DWORD ContextFlags; /* 000 */ @@ -1184,7 +1184,7 @@ BYTE ExtendedRegisters[I386_MAXIMUM_SUPPORTED_EXTENSION]; /* 0xcc */ } I386_CONTEXT, WOW64_CONTEXT, *PWOW64_CONTEXT; -#include "poppack.h" +#pragma pack(pop) #define CONTEXT_i386 0x00010000 #define CONTEXT_i486 0x00010000 @@ -1486,15 +1486,25 @@ ULONG64 EnabledFeatures; ULONG64 EnabledVolatileFeatures; ULONG Size; - ULONG OptimizedSave:1; - ULONG CompactionEnabled:1; + union + { + ULONG ControlFlags; + struct + { + ULONG OptimizedSave : 1; + ULONG CompactionEnabled : 1; + ULONG ExtendedFeatureDisable : 1; + }; + }; XSTATE_FEATURE Features[MAXIMUM_XSTATE_FEATURES]; - ULONG64 EnabledSupervisorFeatures; ULONG64 AlignedFeatures; ULONG AllFeatureSize; ULONG AllFeatures[MAXIMUM_XSTATE_FEATURES]; ULONG64 EnabledUserVisibleSupervisorFeatures; + ULONG64 ExtendedFeatureDisableFeatures; + ULONG AllNonLargeFeatureSize; + ULONG Spare; } XSTATE_CONFIGURATION, *PXSTATE_CONFIGURATION; typedef struct _XSAVE_AREA_HEADER @@ -2565,7 +2575,7 @@ * File formats definitions */ -#include <pshpack2.h> +#pragma pack(push,2) typedef struct _IMAGE_DOS_HEADER { WORD e_magic; /* 00: MZ Header signature */ WORD e_cblp; /* 02: Bytes on last page of file */ @@ -2587,7 +2597,7 @@ WORD e_res2[10]; /* 28: Reserved words */ DWORD e_lfanew; /* 3c: Offset to extended header */ } IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER; -#include <poppack.h> +#pragma pack(pop) #define IMAGE_DOS_SIGNATURE 0x5A4D /* MZ */ #define IMAGE_OS2_SIGNATURE 0x454E /* NE */ @@ -2600,7 +2610,7 @@ * This is the Windows executable (NE) header. * the name IMAGE_OS2_HEADER is misleading, but in the SDK this way. */ -#include <pshpack2.h> +#pragma pack(push,2) typedef struct { WORD ne_magic; /* 00 NE signature 'NE' */ @@ -2634,9 +2644,9 @@ WORD ne_swaparea; /* 3c Reserved by Microsoft */ WORD ne_expver; /* 3e Expected Windows version number */ } IMAGE_OS2_HEADER, *PIMAGE_OS2_HEADER; -#include <poppack.h> +#pragma pack(pop) -#include <pshpack2.h> +#pragma pack(push,2) typedef struct _IMAGE_VXD_HEADER { WORD e32_magic; BYTE e32_border; @@ -2690,7 +2700,7 @@ WORD e32_devid; WORD e32_ddkver; } IMAGE_VXD_HEADER, *PIMAGE_VXD_HEADER; -#include <poppack.h> +#pragma pack(pop) /* These defines describe the meanings of the bits in the Characteristics field */ @@ -3034,7 +3044,7 @@ #define IMAGE_SCN_MEM_READ 0x40000000 #define IMAGE_SCN_MEM_WRITE 0x80000000 -#include <pshpack2.h> +#pragma pack(push,2) typedef struct _IMAGE_SYMBOL { union { @@ -3103,7 +3113,7 @@ #define IMAGE_SIZEOF_AUX_SYMBOL 18 -#include <poppack.h> +#pragma pack(pop) #define IMAGE_SYM_UNDEFINED (SHORT)0 #define IMAGE_SYM_ABSOLUTE (SHORT)-1 @@ -3227,7 +3237,7 @@ char Name[1]; } IMAGE_IMPORT_BY_NAME,*PIMAGE_IMPORT_BY_NAME; -#include <pshpack8.h> +#pragma pack(push,8) /* Import thunk */ typedef struct _IMAGE_THUNK_DATA64 { union { @@ -3237,7 +3247,7 @@ ULONGLONG AddressOfData; } u1; } IMAGE_THUNK_DATA64,*PIMAGE_THUNK_DATA64; -#include <poppack.h> +#pragma pack(pop) typedef struct _IMAGE_THUNK_DATA32 { union { @@ -3311,7 +3321,7 @@ /* WORD TypeOffset[1]; */ } IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION; -#include <pshpack2.h> +#pragma pack(push,2) typedef struct _IMAGE_RELOCATION { @@ -3323,7 +3333,7 @@ WORD Type; } IMAGE_RELOCATION, *PIMAGE_RELOCATION; -#include <poppack.h> +#pragma pack(pop) #define IMAGE_SIZEOF_RELOCATION 10 @@ -3956,7 +3966,7 @@ DWORD Size; } IMAGE_DYNAMIC_RELOCATION_TABLE, *PIMAGE_DYNAMIC_RELOCATION_TABLE; -#include <pshpack1.h> +#pragma pack(push,1) typedef struct _IMAGE_DYNAMIC_RELOCATION32 { @@ -3988,7 +3998,7 @@ DWORD Flags; } IMAGE_DYNAMIC_RELOCATION64_V2, *PIMAGE_DYNAMIC_RELOCATION64_V2; -#include <poppack.h> +#pragma pack(pop) #ifdef _WIN64 typedef IMAGE_DYNAMIC_RELOCATION64 IMAGE_DYNAMIC_RELOCATION; @@ -4879,12 +4889,12 @@ LONG HighPart; } LUID, *PLUID; -#include <pshpack4.h> +#pragma pack(push,4) typedef struct _LUID_AND_ATTRIBUTES { LUID Luid; DWORD Attributes; } LUID_AND_ATTRIBUTES, *PLUID_AND_ATTRIBUTES; -#include <poppack.h> +#pragma pack(pop) /* * PRIVILEGE_SET @@ -4981,7 +4991,7 @@ * TOKEN_STATISTICS */ -#include <pshpack4.h> +#pragma pack(push,4) typedef struct _TOKEN_STATISTICS { LUID TokenId; LUID AuthenticationId; @@ -4994,7 +5004,7 @@ DWORD PrivilegeCount; LUID ModifiedId; } TOKEN_STATISTICS; -#include <poppack.h> +#pragma pack(pop) typedef struct _TOKEN_GROUPS_AND_PRIVILEGES { DWORD SidCount; @@ -6219,7 +6229,7 @@ NTSYSAPI DWORD WINAPI RtlRunOnceComplete(PRTL_RUN_ONCE, DWORD, PVOID); NTSYSAPI WORD WINAPI RtlCaptureStackBackTrace(DWORD,DWORD,void**,DWORD*); -#include <pshpack8.h> +#pragma pack(push,8) typedef struct _IO_COUNTERS { ULONGLONG DECLSPEC_ALIGN(8) ReadOperationCount; ULONGLONG DECLSPEC_ALIGN(8) WriteOperationCount; @@ -6228,7 +6238,7 @@ ULONGLONG DECLSPEC_ALIGN(8) WriteTransferCount; ULONGLONG DECLSPEC_ALIGN(8) OtherTransferCount; } IO_COUNTERS, *PIO_COUNTERS; -#include <poppack.h> +#pragma pack(pop) typedef struct { DWORD dwOSVersionInfoSize; @@ -7100,14 +7110,14 @@ static void __wine_memory_barrier_acq_rel(void) { -#if defined(__i386__) || defined(__x86_64__) +#if defined(__aarch64__) || defined(__arm64ec__) + __dmb(_ARM64_BARRIER_ISH); +#elif defined(__i386__) || defined(__x86_64__) #pragma warning(suppress:4996) _ReadWriteBarrier(); #elif defined(__arm__) __dmb(_ARM_BARRIER_ISH); -#elif defined(__aarch64__) - __dmb(_ARM64_BARRIER_ISH); -#endif /* defined(__i386__) || defined(__x86_64__) */ +#endif } static FORCEINLINE LONG ReadAcquire( LONG const volatile *src ) @@ -7117,6 +7127,22 @@ return value; } +static FORCEINLINE LONG64 ReadAcquire64( LONG64 const volatile *src ) +{ + LONG64 value; +#if defined(__i386__) && _MSC_VER < 1700 + __asm { + mov eax, src + fild qword ptr [eax] + fistp value + } +#else + value = __WINE_LOAD64_NO_FENCE( (__int64 const volatile *)src ); + __wine_memory_barrier_acq_rel(); +#endif + return value; +} + static FORCEINLINE LONG ReadNoFence( LONG const volatile *src ) { LONG value = __WINE_LOAD32_NO_FENCE( (int const volatile *)src ); @@ -7331,6 +7357,17 @@ return value; } +static FORCEINLINE LONG64 ReadAcquire64( LONG64 const volatile *src ) +{ + LONG64 value; +#ifdef __i386__ + __asm__ __volatile__( "fildq %1\n\tfistpq %0" : "=m" (value) : "m" (*src) : "memory", "st" ); +#else + __WINE_ATOMIC_LOAD_ACQUIRE( src, &value ); +#endif + return value; +} + static FORCEINLINE LONG ReadNoFence( LONG const volatile *src ) { LONG value;
diff --git a/mingw-w64-tools/widl/src/ppy.tab.c b/mingw-w64-tools/widl/src/ppy.tab.c index ab5743a..57b4bae 100644 --- a/mingw-w64-tools/widl/src/ppy.tab.c +++ b/mingw-w64-tools/widl/src/ppy.tab.c
@@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.7-dirty. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -45,11 +45,11 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Identify Bison output. */ -#define YYBISON 1 +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 -/* Bison version. */ -#define YYBISON_VERSION "3.7-dirty" +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -297,9 +297,11 @@ extern PPY_STYPE ppy_lval; + int ppy_parse (void); + /* Symbol kind. */ enum yysymbol_kind_t { @@ -422,6 +424,18 @@ typedef short yytype_int16; #endif +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ @@ -519,17 +533,23 @@ /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -748,7 +768,7 @@ }; #if PPY_DEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { 0, 176, 176, 177, 181, 182, 183, 184, 185, 205, @@ -796,21 +816,6 @@ } #endif -#ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_int16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 63, 58, - 293, 294, 124, 94, 38, 295, 296, 60, 297, 62, - 298, 299, 300, 43, 45, 42, 47, 126, 33, 44, - 40, 41 -}; -#endif - #define YYPACT_NINF (-27) #define yypact_value_is_default(Yyn) \ @@ -821,8 +826,8 @@ #define yytable_value_is_error(Yyn) \ 0 - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { -27, 124, -27, -26, -3, -12, -2, 30, -3, 41, @@ -843,9 +848,9 @@ -27, -27, 292, -27 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_int8 yydefact[] = { 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, @@ -866,23 +871,23 @@ 47, 19, 0, 20 }; - /* YYPGOTO[NTERM-NUM]. */ +/* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -27, -27, -27, -11, -27, -27, -27, -27, -27, -27, -27, 163, -8 }; - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_uint8 yydefgoto[] = { - -1, 1, 20, 50, 51, 56, 101, 102, 103, 140, + 0, 1, 20, 50, 51, 56, 101, 102, 103, 140, 141, 142, 36 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 40, 58, 21, 52, 53, 54, 47, 23, 57, 48, @@ -953,8 +958,8 @@ 61, 24, 11, 11, 141 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ static const yytype_int8 yystos[] = { 0, 63, 0, 3, 4, 5, 6, 7, 8, 9, @@ -975,7 +980,7 @@ 73, 11, 32, 11 }; - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int8 yyr1[] = { 0, 62, 63, 63, 64, 64, 64, 64, 64, 64, @@ -989,7 +994,7 @@ 74, 74, 74, 74, 74, 74 }; - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 0, 2, 3, 3, 3, 3, 3, 3, @@ -1012,6 +1017,7 @@ #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) @@ -1052,10 +1058,7 @@ YYFPRINTF Args; \ } while (0) -/* This macro is provided for backward compatibility. */ -# ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif + # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ @@ -1079,15 +1082,11 @@ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; - YYUSE (yyoutput); + YY_USE (yyoutput); if (!yyvaluep) return; -# ifdef YYPRINT - if (yykind < YYNTOKENS) - YYPRINT (yyo, yytoknum[yykind], *yyvaluep); -# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yykind); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1201,13 +1200,13 @@ yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { - YYUSE (yyvaluep); + YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yykind); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1270,6 +1269,7 @@ YYDPRINTF ((stderr, "Starting parse\n")); yychar = PPY_EMPTY; /* Cause a token to be read. */ + goto yysetstate; @@ -1295,7 +1295,7 @@ if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; + YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ @@ -1323,7 +1323,7 @@ # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; @@ -1334,7 +1334,7 @@ YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) - goto yyexhaustedlab; + YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE @@ -1356,6 +1356,7 @@ } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + if (yystate == YYFINAL) YYACCEPT; @@ -1470,25 +1471,25 @@ case 4: /* preprocessor: tINCLUDE tDQSTRING tNL */ #line 181 "tools/wrc/ppy.y" { pp_do_include((yyvsp[-1].cptr), 1); } -#line 1474 "tools/wrc/ppy.tab.c" +#line 1475 "tools/wrc/ppy.tab.c" break; case 5: /* preprocessor: tINCLUDE tIQSTRING tNL */ #line 182 "tools/wrc/ppy.y" { pp_do_include((yyvsp[-1].cptr), 0); } -#line 1480 "tools/wrc/ppy.tab.c" +#line 1481 "tools/wrc/ppy.tab.c" break; case 6: /* preprocessor: tIF pp_expr tNL */ #line 183 "tools/wrc/ppy.y" { pp_next_if_state(boolean(&(yyvsp[-1].cval))); } -#line 1486 "tools/wrc/ppy.tab.c" +#line 1487 "tools/wrc/ppy.tab.c" break; case 7: /* preprocessor: tIFDEF tIDENT tNL */ #line 184 "tools/wrc/ppy.y" { pp_next_if_state(pplookup((yyvsp[-1].cptr)) != NULL); free((yyvsp[-1].cptr)); } -#line 1492 "tools/wrc/ppy.tab.c" +#line 1493 "tools/wrc/ppy.tab.c" break; case 8: /* preprocessor: tIFNDEF tIDENT tNL */ @@ -1513,7 +1514,7 @@ fprintf(stderr, "tIFNDEF: %s:%d: include_state=%d, include_ppp='%s', include_ifdepth=%d\n", pp_status.input, pp_status.line_number, pp_incl_state.state, pp_incl_state.ppp, pp_incl_state.ifdepth); } -#line 1517 "tools/wrc/ppy.tab.c" +#line 1518 "tools/wrc/ppy.tab.c" break; case 9: /* preprocessor: tELIF pp_expr tNL */ @@ -1540,7 +1541,7 @@ break; } } -#line 1544 "tools/wrc/ppy.tab.c" +#line 1545 "tools/wrc/ppy.tab.c" break; case 10: /* preprocessor: tELSE tNL */ @@ -1569,7 +1570,7 @@ break; } } -#line 1573 "tools/wrc/ppy.tab.c" +#line 1574 "tools/wrc/ppy.tab.c" break; case 11: /* preprocessor: tENDIF tNL */ @@ -1591,19 +1592,19 @@ pp_status.input, pp_status.line_number, pp_incl_state.state, pp_incl_state.ppp, pp_incl_state.ifdepth); } } -#line 1595 "tools/wrc/ppy.tab.c" +#line 1596 "tools/wrc/ppy.tab.c" break; case 12: /* preprocessor: tUNDEF tIDENT tNL */ #line 268 "tools/wrc/ppy.y" { pp_del_define((yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1601 "tools/wrc/ppy.tab.c" +#line 1602 "tools/wrc/ppy.tab.c" break; case 13: /* preprocessor: tDEFINE opt_text tNL */ #line 269 "tools/wrc/ppy.y" { pp_add_define((yyvsp[-2].cptr), (yyvsp[-1].cptr)); free((yyvsp[-2].cptr)); free((yyvsp[-1].cptr)); } -#line 1607 "tools/wrc/ppy.tab.c" +#line 1608 "tools/wrc/ppy.tab.c" break; case 14: /* preprocessor: tMACRO res_arg allmargs tMACROEND opt_mtexts tNL */ @@ -1611,67 +1612,67 @@ { pp_add_macro((yyvsp[-5].cptr), macro_args, nmacro_args, macro_variadic, (yyvsp[-1].mtext)); } -#line 1615 "tools/wrc/ppy.tab.c" +#line 1616 "tools/wrc/ppy.tab.c" break; case 15: /* preprocessor: tLINE tSINT tDQSTRING tNL */ #line 273 "tools/wrc/ppy.y" { if((yyvsp[-1].cptr)) fprintf(ppy_out, "# %d %s\n", (yyvsp[-2].sint) , (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1621 "tools/wrc/ppy.tab.c" +#line 1622 "tools/wrc/ppy.tab.c" break; case 16: /* preprocessor: tGCCLINE tSINT tDQSTRING tNL */ #line 274 "tools/wrc/ppy.y" { if((yyvsp[-1].cptr)) fprintf(ppy_out, "# %d %s\n", (yyvsp[-2].sint) , (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1627 "tools/wrc/ppy.tab.c" +#line 1628 "tools/wrc/ppy.tab.c" break; case 17: /* preprocessor: tGCCLINE tSINT tDQSTRING tSINT tNL */ #line 276 "tools/wrc/ppy.y" { if((yyvsp[-2].cptr)) fprintf(ppy_out, "# %d %s %d\n", (yyvsp[-3].sint), (yyvsp[-2].cptr), (yyvsp[-1].sint)); free((yyvsp[-2].cptr)); } -#line 1633 "tools/wrc/ppy.tab.c" +#line 1634 "tools/wrc/ppy.tab.c" break; case 18: /* preprocessor: tGCCLINE tSINT tDQSTRING tSINT tSINT tNL */ #line 278 "tools/wrc/ppy.y" { if((yyvsp[-3].cptr)) fprintf(ppy_out, "# %d %s %d %d\n", (yyvsp[-4].sint) ,(yyvsp[-3].cptr), (yyvsp[-2].sint), (yyvsp[-1].sint)); free((yyvsp[-3].cptr)); } -#line 1639 "tools/wrc/ppy.tab.c" +#line 1640 "tools/wrc/ppy.tab.c" break; case 19: /* preprocessor: tGCCLINE tSINT tDQSTRING tSINT tSINT tSINT tNL */ #line 280 "tools/wrc/ppy.y" { if((yyvsp[-4].cptr)) fprintf(ppy_out, "# %d %s %d %d %d\n", (yyvsp[-5].sint) ,(yyvsp[-4].cptr) ,(yyvsp[-3].sint) ,(yyvsp[-2].sint), (yyvsp[-1].sint)); free((yyvsp[-4].cptr)); } -#line 1645 "tools/wrc/ppy.tab.c" +#line 1646 "tools/wrc/ppy.tab.c" break; case 20: /* preprocessor: tGCCLINE tSINT tDQSTRING tSINT tSINT tSINT tSINT tNL */ #line 282 "tools/wrc/ppy.y" { if((yyvsp[-5].cptr)) fprintf(ppy_out, "# %d %s %d %d %d %d\n", (yyvsp[-6].sint) ,(yyvsp[-5].cptr) ,(yyvsp[-4].sint) ,(yyvsp[-3].sint), (yyvsp[-2].sint), (yyvsp[-1].sint)); free((yyvsp[-5].cptr)); } -#line 1651 "tools/wrc/ppy.tab.c" +#line 1652 "tools/wrc/ppy.tab.c" break; case 22: /* preprocessor: tERROR opt_text tNL */ #line 284 "tools/wrc/ppy.y" { ppy_error("#error directive: '%s'", (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1657 "tools/wrc/ppy.tab.c" +#line 1658 "tools/wrc/ppy.tab.c" break; case 23: /* preprocessor: tWARNING opt_text tNL */ #line 285 "tools/wrc/ppy.y" { ppy_warning("#warning directive: '%s'", (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1663 "tools/wrc/ppy.tab.c" +#line 1664 "tools/wrc/ppy.tab.c" break; case 24: /* preprocessor: tPRAGMA opt_text tNL */ #line 286 "tools/wrc/ppy.y" { fprintf(ppy_out, "#pragma %s\n", (yyvsp[-1].cptr) ? (yyvsp[-1].cptr) : ""); free((yyvsp[-1].cptr)); } -#line 1669 "tools/wrc/ppy.tab.c" +#line 1670 "tools/wrc/ppy.tab.c" break; case 25: /* preprocessor: tPPIDENT opt_text tNL */ #line 287 "tools/wrc/ppy.y" { if(pedantic) ppy_warning("#ident ignored (arg: '%s')", (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1675 "tools/wrc/ppy.tab.c" +#line 1676 "tools/wrc/ppy.tab.c" break; case 26: /* preprocessor: tRCINCLUDE tRCINCLUDEPATH */ @@ -1679,7 +1680,7 @@ { pp_do_include(strmake( "\"%s\"", (yyvsp[0].cptr) ),1); } -#line 1683 "tools/wrc/ppy.tab.c" +#line 1684 "tools/wrc/ppy.tab.c" break; case 27: /* preprocessor: tRCINCLUDE tDQSTRING */ @@ -1687,109 +1688,109 @@ { pp_do_include((yyvsp[0].cptr),1); } -#line 1691 "tools/wrc/ppy.tab.c" +#line 1692 "tools/wrc/ppy.tab.c" break; case 28: /* opt_text: %empty */ #line 297 "tools/wrc/ppy.y" { (yyval.cptr) = NULL; } -#line 1697 "tools/wrc/ppy.tab.c" +#line 1698 "tools/wrc/ppy.tab.c" break; case 29: /* opt_text: text */ #line 298 "tools/wrc/ppy.y" { (yyval.cptr) = (yyvsp[0].cptr); } -#line 1703 "tools/wrc/ppy.tab.c" +#line 1704 "tools/wrc/ppy.tab.c" break; case 30: /* text: tLITERAL */ #line 301 "tools/wrc/ppy.y" { (yyval.cptr) = (yyvsp[0].cptr); } -#line 1709 "tools/wrc/ppy.tab.c" +#line 1710 "tools/wrc/ppy.tab.c" break; case 31: /* text: tDQSTRING */ #line 302 "tools/wrc/ppy.y" { (yyval.cptr) = (yyvsp[0].cptr); } -#line 1715 "tools/wrc/ppy.tab.c" +#line 1716 "tools/wrc/ppy.tab.c" break; case 32: /* text: tSQSTRING */ #line 303 "tools/wrc/ppy.y" { (yyval.cptr) = (yyvsp[0].cptr); } -#line 1721 "tools/wrc/ppy.tab.c" +#line 1722 "tools/wrc/ppy.tab.c" break; case 33: /* text: text tLITERAL */ #line 304 "tools/wrc/ppy.y" { (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); } -#line 1727 "tools/wrc/ppy.tab.c" +#line 1728 "tools/wrc/ppy.tab.c" break; case 34: /* text: text tDQSTRING */ #line 305 "tools/wrc/ppy.y" { (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); } -#line 1733 "tools/wrc/ppy.tab.c" +#line 1734 "tools/wrc/ppy.tab.c" break; case 35: /* text: text tSQSTRING */ #line 306 "tools/wrc/ppy.y" { (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); } -#line 1739 "tools/wrc/ppy.tab.c" +#line 1740 "tools/wrc/ppy.tab.c" break; case 36: /* res_arg: %empty */ #line 309 "tools/wrc/ppy.y" { macro_args = NULL; nmacro_args = 0; macro_variadic = 0; } -#line 1745 "tools/wrc/ppy.tab.c" +#line 1746 "tools/wrc/ppy.tab.c" break; case 37: /* allmargs: %empty */ #line 312 "tools/wrc/ppy.y" { (yyval.sint) = 0; macro_args = NULL; nmacro_args = 0; macro_variadic = 0; } -#line 1751 "tools/wrc/ppy.tab.c" +#line 1752 "tools/wrc/ppy.tab.c" break; case 38: /* allmargs: emargs */ #line 313 "tools/wrc/ppy.y" { (yyval.sint) = nmacro_args; } -#line 1757 "tools/wrc/ppy.tab.c" +#line 1758 "tools/wrc/ppy.tab.c" break; case 39: /* emargs: margs */ #line 316 "tools/wrc/ppy.y" { (yyval.marg) = (yyvsp[0].marg); } -#line 1763 "tools/wrc/ppy.tab.c" +#line 1764 "tools/wrc/ppy.tab.c" break; case 40: /* emargs: margs ',' tELLIPSIS */ #line 317 "tools/wrc/ppy.y" { macro_variadic = 1; } -#line 1769 "tools/wrc/ppy.tab.c" +#line 1770 "tools/wrc/ppy.tab.c" break; case 41: /* emargs: tELLIPSIS */ #line 318 "tools/wrc/ppy.y" { macro_args = NULL; nmacro_args = 0; macro_variadic = 1; } -#line 1775 "tools/wrc/ppy.tab.c" +#line 1776 "tools/wrc/ppy.tab.c" break; case 42: /* margs: margs ',' tIDENT */ #line 321 "tools/wrc/ppy.y" { (yyval.marg) = add_new_marg((yyvsp[0].cptr)); } -#line 1781 "tools/wrc/ppy.tab.c" +#line 1782 "tools/wrc/ppy.tab.c" break; case 43: /* margs: tIDENT */ #line 322 "tools/wrc/ppy.y" { (yyval.marg) = add_new_marg((yyvsp[0].cptr)); } -#line 1787 "tools/wrc/ppy.tab.c" +#line 1788 "tools/wrc/ppy.tab.c" break; case 44: /* opt_mtexts: %empty */ #line 326 "tools/wrc/ppy.y" { (yyval.mtext) = NULL; } -#line 1793 "tools/wrc/ppy.tab.c" +#line 1794 "tools/wrc/ppy.tab.c" break; case 45: /* opt_mtexts: mtexts */ @@ -1798,43 +1799,43 @@ for((yyval.mtext) = (yyvsp[0].mtext); (yyval.mtext) && (yyval.mtext)->prev; (yyval.mtext) = (yyval.mtext)->prev) ; } -#line 1802 "tools/wrc/ppy.tab.c" +#line 1803 "tools/wrc/ppy.tab.c" break; case 46: /* mtexts: mtext */ #line 333 "tools/wrc/ppy.y" { (yyval.mtext) = (yyvsp[0].mtext); } -#line 1808 "tools/wrc/ppy.tab.c" +#line 1809 "tools/wrc/ppy.tab.c" break; case 47: /* mtexts: mtexts mtext */ #line 334 "tools/wrc/ppy.y" { (yyval.mtext) = combine_mtext((yyvsp[-1].mtext), (yyvsp[0].mtext)); } -#line 1814 "tools/wrc/ppy.tab.c" +#line 1815 "tools/wrc/ppy.tab.c" break; case 48: /* mtext: tLITERAL */ #line 337 "tools/wrc/ppy.y" { (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); } -#line 1820 "tools/wrc/ppy.tab.c" +#line 1821 "tools/wrc/ppy.tab.c" break; case 49: /* mtext: tDQSTRING */ #line 338 "tools/wrc/ppy.y" { (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); } -#line 1826 "tools/wrc/ppy.tab.c" +#line 1827 "tools/wrc/ppy.tab.c" break; case 50: /* mtext: tSQSTRING */ #line 339 "tools/wrc/ppy.y" { (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); } -#line 1832 "tools/wrc/ppy.tab.c" +#line 1833 "tools/wrc/ppy.tab.c" break; case 51: /* mtext: tCONCAT */ #line 340 "tools/wrc/ppy.y" { (yyval.mtext) = new_mtext(NULL, 0, exp_concat); } -#line 1838 "tools/wrc/ppy.tab.c" +#line 1839 "tools/wrc/ppy.tab.c" break; case 52: /* mtext: tSTRINGIZE tIDENT */ @@ -1846,7 +1847,7 @@ else (yyval.mtext) = new_mtext(NULL, mat, exp_stringize); } -#line 1850 "tools/wrc/ppy.tab.c" +#line 1851 "tools/wrc/ppy.tab.c" break; case 53: /* mtext: tIDENT */ @@ -1858,203 +1859,203 @@ else if((yyvsp[0].cptr)) (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); } -#line 1862 "tools/wrc/ppy.tab.c" +#line 1863 "tools/wrc/ppy.tab.c" break; case 54: /* pp_expr: tSINT */ #line 357 "tools/wrc/ppy.y" { (yyval.cval).type = cv_sint; (yyval.cval).val.si = (yyvsp[0].sint); } -#line 1868 "tools/wrc/ppy.tab.c" +#line 1869 "tools/wrc/ppy.tab.c" break; case 55: /* pp_expr: tUINT */ #line 358 "tools/wrc/ppy.y" { (yyval.cval).type = cv_uint; (yyval.cval).val.ui = (yyvsp[0].uint); } -#line 1874 "tools/wrc/ppy.tab.c" +#line 1875 "tools/wrc/ppy.tab.c" break; case 56: /* pp_expr: tSLONG */ #line 359 "tools/wrc/ppy.y" { (yyval.cval).type = cv_slong; (yyval.cval).val.sl = (yyvsp[0].slong); } -#line 1880 "tools/wrc/ppy.tab.c" +#line 1881 "tools/wrc/ppy.tab.c" break; case 57: /* pp_expr: tULONG */ #line 360 "tools/wrc/ppy.y" { (yyval.cval).type = cv_ulong; (yyval.cval).val.ul = (yyvsp[0].ulong); } -#line 1886 "tools/wrc/ppy.tab.c" +#line 1887 "tools/wrc/ppy.tab.c" break; case 58: /* pp_expr: tSLONGLONG */ #line 361 "tools/wrc/ppy.y" { (yyval.cval).type = cv_sll; (yyval.cval).val.sll = (yyvsp[0].sll); } -#line 1892 "tools/wrc/ppy.tab.c" +#line 1893 "tools/wrc/ppy.tab.c" break; case 59: /* pp_expr: tULONGLONG */ #line 362 "tools/wrc/ppy.y" { (yyval.cval).type = cv_ull; (yyval.cval).val.ull = (yyvsp[0].ull); } -#line 1898 "tools/wrc/ppy.tab.c" +#line 1899 "tools/wrc/ppy.tab.c" break; case 60: /* pp_expr: tDEFINED tIDENT */ #line 363 "tools/wrc/ppy.y" { (yyval.cval).type = cv_sint; (yyval.cval).val.si = pplookup((yyvsp[0].cptr)) != NULL; } -#line 1904 "tools/wrc/ppy.tab.c" +#line 1905 "tools/wrc/ppy.tab.c" break; case 61: /* pp_expr: tDEFINED '(' tIDENT ')' */ #line 364 "tools/wrc/ppy.y" { (yyval.cval).type = cv_sint; (yyval.cval).val.si = pplookup((yyvsp[-1].cptr)) != NULL; } -#line 1910 "tools/wrc/ppy.tab.c" +#line 1911 "tools/wrc/ppy.tab.c" break; case 62: /* pp_expr: tIDENT */ #line 365 "tools/wrc/ppy.y" { (yyval.cval).type = cv_sint; (yyval.cval).val.si = 0; } -#line 1916 "tools/wrc/ppy.tab.c" +#line 1917 "tools/wrc/ppy.tab.c" break; case 63: /* pp_expr: pp_expr tLOGOR pp_expr */ #line 366 "tools/wrc/ppy.y" { (yyval.cval).type = cv_sint; (yyval.cval).val.si = boolean(&(yyvsp[-2].cval)) || boolean(&(yyvsp[0].cval)); } -#line 1922 "tools/wrc/ppy.tab.c" +#line 1923 "tools/wrc/ppy.tab.c" break; case 64: /* pp_expr: pp_expr tLOGAND pp_expr */ #line 367 "tools/wrc/ppy.y" { (yyval.cval).type = cv_sint; (yyval.cval).val.si = boolean(&(yyvsp[-2].cval)) && boolean(&(yyvsp[0].cval)); } -#line 1928 "tools/wrc/ppy.tab.c" +#line 1929 "tools/wrc/ppy.tab.c" break; case 65: /* pp_expr: pp_expr tEQ pp_expr */ #line 368 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), ==); } -#line 1934 "tools/wrc/ppy.tab.c" +#line 1935 "tools/wrc/ppy.tab.c" break; case 66: /* pp_expr: pp_expr tNE pp_expr */ #line 369 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), !=); } -#line 1940 "tools/wrc/ppy.tab.c" +#line 1941 "tools/wrc/ppy.tab.c" break; case 67: /* pp_expr: pp_expr '<' pp_expr */ #line 370 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <); } -#line 1946 "tools/wrc/ppy.tab.c" +#line 1947 "tools/wrc/ppy.tab.c" break; case 68: /* pp_expr: pp_expr '>' pp_expr */ #line 371 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >); } -#line 1952 "tools/wrc/ppy.tab.c" +#line 1953 "tools/wrc/ppy.tab.c" break; case 69: /* pp_expr: pp_expr tLTE pp_expr */ #line 372 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <=); } -#line 1958 "tools/wrc/ppy.tab.c" +#line 1959 "tools/wrc/ppy.tab.c" break; case 70: /* pp_expr: pp_expr tGTE pp_expr */ #line 373 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >=); } -#line 1964 "tools/wrc/ppy.tab.c" +#line 1965 "tools/wrc/ppy.tab.c" break; case 71: /* pp_expr: pp_expr '+' pp_expr */ #line 374 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), +); } -#line 1970 "tools/wrc/ppy.tab.c" +#line 1971 "tools/wrc/ppy.tab.c" break; case 72: /* pp_expr: pp_expr '-' pp_expr */ #line 375 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), -); } -#line 1976 "tools/wrc/ppy.tab.c" +#line 1977 "tools/wrc/ppy.tab.c" break; case 73: /* pp_expr: pp_expr '^' pp_expr */ #line 376 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), ^); } -#line 1982 "tools/wrc/ppy.tab.c" +#line 1983 "tools/wrc/ppy.tab.c" break; case 74: /* pp_expr: pp_expr '&' pp_expr */ #line 377 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), &); } -#line 1988 "tools/wrc/ppy.tab.c" +#line 1989 "tools/wrc/ppy.tab.c" break; case 75: /* pp_expr: pp_expr '|' pp_expr */ #line 378 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), |); } -#line 1994 "tools/wrc/ppy.tab.c" +#line 1995 "tools/wrc/ppy.tab.c" break; case 76: /* pp_expr: pp_expr '*' pp_expr */ #line 379 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), *); } -#line 2000 "tools/wrc/ppy.tab.c" +#line 2001 "tools/wrc/ppy.tab.c" break; case 77: /* pp_expr: pp_expr '/' pp_expr */ #line 380 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), /); } -#line 2006 "tools/wrc/ppy.tab.c" +#line 2007 "tools/wrc/ppy.tab.c" break; case 78: /* pp_expr: pp_expr tLSHIFT pp_expr */ #line 381 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <<); } -#line 2012 "tools/wrc/ppy.tab.c" +#line 2013 "tools/wrc/ppy.tab.c" break; case 79: /* pp_expr: pp_expr tRSHIFT pp_expr */ #line 382 "tools/wrc/ppy.y" { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >>); } -#line 2018 "tools/wrc/ppy.tab.c" +#line 2019 "tools/wrc/ppy.tab.c" break; case 80: /* pp_expr: '+' pp_expr */ #line 383 "tools/wrc/ppy.y" { (yyval.cval) = (yyvsp[0].cval); } -#line 2024 "tools/wrc/ppy.tab.c" +#line 2025 "tools/wrc/ppy.tab.c" break; case 81: /* pp_expr: '-' pp_expr */ #line 384 "tools/wrc/ppy.y" { UNARY_OP((yyval.cval), (yyvsp[0].cval), -); } -#line 2030 "tools/wrc/ppy.tab.c" +#line 2031 "tools/wrc/ppy.tab.c" break; case 82: /* pp_expr: '~' pp_expr */ #line 385 "tools/wrc/ppy.y" { UNARY_OP((yyval.cval), (yyvsp[0].cval), ~); } -#line 2036 "tools/wrc/ppy.tab.c" +#line 2037 "tools/wrc/ppy.tab.c" break; case 83: /* pp_expr: '!' pp_expr */ #line 386 "tools/wrc/ppy.y" { (yyval.cval).type = cv_sint; (yyval.cval).val.si = !boolean(&(yyvsp[0].cval)); } -#line 2042 "tools/wrc/ppy.tab.c" +#line 2043 "tools/wrc/ppy.tab.c" break; case 84: /* pp_expr: '(' pp_expr ')' */ #line 387 "tools/wrc/ppy.y" { (yyval.cval) = (yyvsp[-1].cval); } -#line 2048 "tools/wrc/ppy.tab.c" +#line 2049 "tools/wrc/ppy.tab.c" break; case 85: /* pp_expr: pp_expr '?' pp_expr ':' pp_expr */ #line 388 "tools/wrc/ppy.y" { (yyval.cval) = boolean(&(yyvsp[-4].cval)) ? (yyvsp[-2].cval) : (yyvsp[0].cval); } -#line 2054 "tools/wrc/ppy.tab.c" +#line 2055 "tools/wrc/ppy.tab.c" break; -#line 2058 "tools/wrc/ppy.tab.c" +#line 2059 "tools/wrc/ppy.tab.c" default: break; } @@ -2136,6 +2137,7 @@ label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; + ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -2196,7 +2198,7 @@ `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; /*-----------------------------------. @@ -2204,24 +2206,22 @@ `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#if !defined yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; - goto yyreturn; -#endif + goto yyreturnlab; -/*-------------------------------------------------------. -| yyreturn -- parsing is finished, clean up and return. | -`-------------------------------------------------------*/ -yyreturn: +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: if (yychar != PPY_EMPTY) { /* Make sure we have latest lookahead translation. See comments at
diff --git a/mingw-w64-tools/widl/src/ppy.tab.h b/mingw-w64-tools/widl/src/ppy.tab.h index f406b3c..4669ea5 100644 --- a/mingw-w64-tools/widl/src/ppy.tab.h +++ b/mingw-w64-tools/widl/src/ppy.tab.h
@@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.7-dirty. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -138,6 +138,8 @@ extern PPY_STYPE ppy_lval; + int ppy_parse (void); + #endif /* !YY_PPY_TOOLS_WRC_PPY_TAB_H_INCLUDED */
diff --git a/mingw-w64-tools/widl/src/typelib_struct.h b/mingw-w64-tools/widl/src/typelib_struct.h index ec1e317..c7bc141 100644 --- a/mingw-w64-tools/widl/src/typelib_struct.h +++ b/mingw-w64-tools/widl/src/typelib_struct.h
@@ -282,7 +282,7 @@ * */ -#include "pshpack1.h" +#pragma pack(push,1) typedef struct { /*00*/ unsigned int SLTG_magic; /* 0x47544c53 == "SLTG" */ @@ -579,7 +579,7 @@ WORD typeofarray */ -#include "poppack.h" +#pragma pack(pop) /*---------------------------END--------------------------------------------*/ #endif
diff --git a/mingw-w64-tools/widl/src/write_sltg.c b/mingw-w64-tools/widl/src/write_sltg.c index 414a8ec..b4ec340 100644 --- a/mingw-w64-tools/widl/src/write_sltg.c +++ b/mingw-w64-tools/widl/src/write_sltg.c
@@ -85,7 +85,7 @@ int *href; }; -#include "pshpack1.h" +#pragma pack(push,1) struct sltg_typeinfo_header { short magic; @@ -221,7 +221,7 @@ short pos; }; -#include "poppack.h" +#pragma pack(pop) static void add_structure_typeinfo(struct sltg_typelib *typelib, type_t *type); static void add_interface_typeinfo(struct sltg_typelib *typelib, type_t *type);
diff --git a/mingw-w64-tools/widl/tools.h b/mingw-w64-tools/widl/tools.h index 5a8173d..f55bdd9 100644 --- a/mingw-w64-tools/widl/tools.h +++ b/mingw-w64-tools/widl/tools.h
@@ -27,6 +27,7 @@ #include <limits.h> #include <stdarg.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -140,7 +141,7 @@ return strcpy( xmalloc( strlen(str)+1 ), str ); } -static inline int strendswith( const char *str, const char *end ) +static inline bool strendswith( const char *str, const char *end ) { int l = strlen( str ); int m = strlen( end ); @@ -196,12 +197,12 @@ for (i = 0; i < added.count; i++) strarray_add( array, added.str[i] ); } -static inline int strarray_exists( struct strarray array, const char *str ) +static inline bool strarray_exists( struct strarray array, const char *str ) { unsigned int i; - for (i = 0; i < array.count; i++) if (!strcmp( array.str[i], str )) return 1; - return 0; + for (i = 0; i < array.count; i++) if (!strcmp( array.str[i], str )) return true; + return false; } static inline void strarray_add_uniq( struct strarray *array, const char *str ) @@ -277,8 +278,9 @@ { if (strpbrk( args.str[i], " \t\n\r")) printf( "\"%s\"", args.str[i] ); else printf( "%s", args.str[i] ); - putchar( i < args.count - 1 ? ' ' : '\n' ); + if (i < args.count - 1) putchar( ' ' ); } + putchar( '\n' ); } static inline int strarray_spawn( struct strarray args ) @@ -550,7 +552,7 @@ } -static inline int is_pe_target( struct target target ) +static inline bool is_pe_target( struct target target ) { return (target.platform == PLATFORM_WINDOWS || target.platform == PLATFORM_MINGW || @@ -630,7 +632,7 @@ return strmake( "/%s-%s", cpu_names[target.cpu], is_pe_target( target ) ? "windows" : "unix" ); } -static inline int parse_target( const char *name, struct target *target ) +static inline bool parse_target( const char *name, struct target *target ) { int res; char *p, *spec = xstrdup( name ); @@ -645,7 +647,7 @@ if ((res = get_cpu_from_name( spec )) == -1) { free( spec ); - return 0; + return false; } target->cpu = res; } @@ -657,7 +659,7 @@ else { free( spec ); - return 0; + return false; } /* get the OS part */ @@ -675,7 +677,7 @@ } free( spec ); - return 1; + return true; } @@ -854,7 +856,7 @@ struct long_option { const char *name; - int has_arg; + bool has_arg; int val; };