widl: Import Wine version 1.4 (099e35983ff768b5).

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
diff --git a/mingw-w64-tools/widl/VERSION b/mingw-w64-tools/widl/VERSION
index 9fa400d..0636f42 100644
--- a/mingw-w64-tools/widl/VERSION
+++ b/mingw-w64-tools/widl/VERSION
@@ -1 +1 @@
-WIDL version 10.3
+WIDL version 10.4
diff --git a/mingw-w64-tools/widl/configure b/mingw-w64-tools/widl/configure
index 8b0ae42..df93cae 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.3.
+# Generated by GNU Autoconf 2.72 for widl 10.4.
 #
 # 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.3'
-PACKAGE_STRING='widl 10.3'
+PACKAGE_VERSION='10.4'
+PACKAGE_STRING='widl 10.4'
 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.3 to adapt to many kinds of systems.
+'configure' configures widl 10.4 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.3:";;
+     short | recursive ) echo "Configuration of widl 10.4:";;
    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.3
+widl configure 10.4
 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.3, which was
+It was created by widl $as_me 10.4, 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.3'
+ VERSION='10.4'
 
 
 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.3, which was
+This file was extended by widl $as_me 10.4, 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.3
+widl config.status 10.4
 configured by $0, generated by GNU Autoconf 2.72,
   with options \\"\$ac_cs_config\\"
 
diff --git a/mingw-w64-tools/widl/include/poppack.h b/mingw-w64-tools/widl/include/poppack.h
index e7a273f..525b1eb 100644
--- a/mingw-w64-tools/widl/include/poppack.h
+++ b/mingw-w64-tools/widl/include/poppack.h
@@ -16,248 +16,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#if defined(__WINE_PSHPACK_H15)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H15
-#  endif
-/* Depth == 15 */
-
-#  if __WINE_PSHPACK_H14 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H14 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H14 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H14)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H14
-#  endif
-/* Depth == 14 */
-
-#  if __WINE_PSHPACK_H13 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H13 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H13 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H13)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H13
-#  endif
-/* Depth == 13 */
-
-#  if __WINE_PSHPACK_H12 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H12 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H12 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H12)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H12
-#  endif
-/* Depth == 12 */
-
-#  if __WINE_PSHPACK_H11 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H11 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H11 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H11)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H11
-#  endif
-/* Depth == 11 */
-
-#  if __WINE_PSHPACK_H10 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H10 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H10 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H10)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H10
-#  endif
-/* Depth == 10 */
-
-#  if __WINE_PSHPACK_H9 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H9 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H9 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H9)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H9
-#  endif
-/* Depth == 9 */
-
-#  if __WINE_PSHPACK_H8 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H8 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H8 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H8)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H8
-#  endif
-/* Depth == 8 */
-
-#  if __WINE_PSHPACK_H7 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H7 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H7 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H7)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H7
-#  endif
-/* Depth == 7 */
-
-#  if __WINE_PSHPACK_H6 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H6 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H6 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H6)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H6
-#  endif
-/* Depth == 6 */
-
-#  if __WINE_PSHPACK_H5 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H5 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H5 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H5)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H5
-#  endif
-/* Depth == 5 */
-
-#  if __WINE_PSHPACK_H4 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H4 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H4 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H4)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H4
-#  endif
-/* Depth == 4 */
-
-#  if __WINE_PSHPACK_H3 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H3 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H3 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H3)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H3
-#  endif
-/* Depth == 3 */
-
-#  if __WINE_PSHPACK_H2 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H2 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H2 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H2)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H2
-#  endif
-/* Depth == 2 */
-
-#  if __WINE_PSHPACK_H == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H
-#  endif
-/* Depth == 1 */
-
-#  if defined(__SUNPRO_CC)
-#    warning "Assuming a default alignment of 4"
-#    pragma pack(4)
-#  else
-#    pragma pack()
-#  endif
-
-#else
-/* Depth == 0 ! */
-
-#error "Popping alignment isn't possible since no alignment has been pushed"
-
+#ifdef _MSC_VER
+# pragma warning(disable:4103)
 #endif
 
-#undef __WINE_INTERNAL_POPPACK
+#pragma pack(pop)
diff --git a/mingw-w64-tools/widl/include/pshpack1.h b/mingw-w64-tools/widl/include/pshpack1.h
index f9d4caa..573ca0e 100644
--- a/mingw-w64-tools/widl/include/pshpack1.h
+++ b/mingw-w64-tools/widl/include/pshpack1.h
@@ -16,92 +16,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#if defined(__WINE_PSHPACK_H15)
-
-   /* Depth > 15 */
-#  error "Alignment nesting > 15 is not supported"
-
-#else
-
-#  if !defined(__WINE_PSHPACK_H)
-#    define __WINE_PSHPACK_H  1
-     /* Depth == 1 */
-#  elif !defined(__WINE_PSHPACK_H2)
-#    define __WINE_PSHPACK_H2 1
-     /* Depth == 2 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H3)
-#    define __WINE_PSHPACK_H3 1
-     /* Depth == 3 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H4)
-#    define __WINE_PSHPACK_H4 1
-     /* Depth == 4 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H5)
-#    define __WINE_PSHPACK_H5 1
-     /* Depth == 5 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H6)
-#    define __WINE_PSHPACK_H6 1
-     /* Depth == 6 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H7)
-#    define __WINE_PSHPACK_H7 1
-     /* Depth == 7 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H8)
-#    define __WINE_PSHPACK_H8 1
-     /* Depth == 8 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H9)
-#    define __WINE_PSHPACK_H9 1
-     /* Depth == 9 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H10)
-#    define __WINE_PSHPACK_H10 1
-     /* Depth == 10 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H11)
-#    define __WINE_PSHPACK_H11 1
-     /* Depth == 11 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H12)
-#    define __WINE_PSHPACK_H12 1
-     /* Depth == 12 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H13)
-#    define __WINE_PSHPACK_H13 1
-     /* Depth == 13 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H14)
-#    define __WINE_PSHPACK_H14 1
-     /* Depth == 14 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H15)
-#    define __WINE_PSHPACK_H15 1
-     /* Depth == 15 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  endif
-
-#  ifdef _MSC_VER
-#   pragma warning(disable:4103)
-#  endif
-
-#  pragma pack(1)
-
+#ifdef _MSC_VER
+# pragma warning(disable:4103)
 #endif
+
+#pragma pack(push,1)
diff --git a/mingw-w64-tools/widl/include/pshpack2.h b/mingw-w64-tools/widl/include/pshpack2.h
index 8bb9527..fdd0ec3 100644
--- a/mingw-w64-tools/widl/include/pshpack2.h
+++ b/mingw-w64-tools/widl/include/pshpack2.h
@@ -16,92 +16,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#if defined(__WINE_PSHPACK_H15)
-
-   /* Depth > 15 */
-#  error "Alignment nesting > 15 is not supported"
-
-#else
-
-#  if !defined(__WINE_PSHPACK_H)
-#    define __WINE_PSHPACK_H  2
-     /* Depth == 1 */
-#  elif !defined(__WINE_PSHPACK_H2)
-#    define __WINE_PSHPACK_H2 2
-     /* Depth == 2 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H3)
-#    define __WINE_PSHPACK_H3 2
-     /* Depth == 3 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H4)
-#    define __WINE_PSHPACK_H4 2
-     /* Depth == 4 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H5)
-#    define __WINE_PSHPACK_H5 2
-     /* Depth == 5 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H6)
-#    define __WINE_PSHPACK_H6 2
-     /* Depth == 6 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H7)
-#    define __WINE_PSHPACK_H7 2
-     /* Depth == 7 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H8)
-#    define __WINE_PSHPACK_H8 2
-     /* Depth == 8 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H9)
-#    define __WINE_PSHPACK_H9 2
-     /* Depth == 9 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H10)
-#    define __WINE_PSHPACK_H10 2
-     /* Depth == 10 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H11)
-#    define __WINE_PSHPACK_H11 2
-     /* Depth == 11 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H12)
-#    define __WINE_PSHPACK_H12 2
-     /* Depth == 12 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H13)
-#    define __WINE_PSHPACK_H13 2
-     /* Depth == 13 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H14)
-#    define __WINE_PSHPACK_H14 2
-     /* Depth == 14 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H15)
-#    define __WINE_PSHPACK_H15 2
-     /* Depth == 15 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  endif
-
-#  ifdef _MSC_VER
-#   pragma warning(disable:4103)
-#  endif
-
-#  pragma pack(2)
-
+#ifdef _MSC_VER
+# pragma warning(disable:4103)
 #endif
+
+#pragma pack(push,2)
diff --git a/mingw-w64-tools/widl/include/pshpack4.h b/mingw-w64-tools/widl/include/pshpack4.h
index ae7e63c..4849df4 100644
--- a/mingw-w64-tools/widl/include/pshpack4.h
+++ b/mingw-w64-tools/widl/include/pshpack4.h
@@ -16,92 +16,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#if defined(__WINE_PSHPACK_H15)
-
-   /* Depth > 15 */
-#  error "Alignment nesting > 15 is not supported"
-
-#else
-
-#  if !defined(__WINE_PSHPACK_H)
-#    define __WINE_PSHPACK_H  4
-     /* Depth == 1 */
-#  elif !defined(__WINE_PSHPACK_H2)
-#    define __WINE_PSHPACK_H2 4
-     /* Depth == 2 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H3)
-#    define __WINE_PSHPACK_H3 4
-     /* Depth == 3 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H4)
-#    define __WINE_PSHPACK_H4 4
-     /* Depth == 4 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H5)
-#    define __WINE_PSHPACK_H5 4
-     /* Depth == 5 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H6)
-#    define __WINE_PSHPACK_H6 4
-     /* Depth == 6 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H7)
-#    define __WINE_PSHPACK_H7 4
-     /* Depth == 7 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H8)
-#    define __WINE_PSHPACK_H8 4
-     /* Depth == 8 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H9)
-#    define __WINE_PSHPACK_H9 4
-     /* Depth == 9 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H10)
-#    define __WINE_PSHPACK_H10 4
-     /* Depth == 10 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H11)
-#    define __WINE_PSHPACK_H11 4
-     /* Depth == 11 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H12)
-#    define __WINE_PSHPACK_H12 4
-     /* Depth == 12 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H13)
-#    define __WINE_PSHPACK_H13 4
-     /* Depth == 13 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H14)
-#    define __WINE_PSHPACK_H14 4
-     /* Depth == 14 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H15)
-#    define __WINE_PSHPACK_H15 4
-     /* Depth == 15 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  endif
-
-#  ifdef _MSC_VER
-#   pragma warning(disable:4103)
-#  endif
-
-#  pragma pack(4)
-
+#ifdef _MSC_VER
+# pragma warning(disable:4103)
 #endif
+
+#pragma pack(push,4)
diff --git a/mingw-w64-tools/widl/include/pshpack8.h b/mingw-w64-tools/widl/include/pshpack8.h
index fe8fda5..81fee6e 100644
--- a/mingw-w64-tools/widl/include/pshpack8.h
+++ b/mingw-w64-tools/widl/include/pshpack8.h
@@ -16,92 +16,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#if defined(__WINE_PSHPACK_H15)
-
-   /* Depth > 15 */
-#  error "Alignment nesting > 15 is not supported"
-
-#else
-
-#  if !defined(__WINE_PSHPACK_H)
-#    define __WINE_PSHPACK_H  8
-     /* Depth == 1 */
-#  elif !defined(__WINE_PSHPACK_H2)
-#    define __WINE_PSHPACK_H2 8
-     /* Depth == 2 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H3)
-#    define __WINE_PSHPACK_H3 8
-     /* Depth == 3 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H4)
-#    define __WINE_PSHPACK_H4 8
-     /* Depth == 4 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H5)
-#    define __WINE_PSHPACK_H5 8
-     /* Depth == 5 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H6)
-#    define __WINE_PSHPACK_H6 8
-     /* Depth == 6 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H7)
-#    define __WINE_PSHPACK_H7 8
-     /* Depth == 7 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H8)
-#    define __WINE_PSHPACK_H8 8
-     /* Depth == 8 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H9)
-#    define __WINE_PSHPACK_H9 8
-     /* Depth == 9 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H10)
-#    define __WINE_PSHPACK_H10 8
-     /* Depth == 10 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H11)
-#    define __WINE_PSHPACK_H11 8
-     /* Depth == 11 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H12)
-#    define __WINE_PSHPACK_H12 8
-     /* Depth == 12 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H13)
-#    define __WINE_PSHPACK_H13 8
-     /* Depth == 13 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H14)
-#    define __WINE_PSHPACK_H14 8
-     /* Depth == 14 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H15)
-#    define __WINE_PSHPACK_H15 8
-     /* Depth == 15 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  endif
-
-#  ifdef _MSC_VER
-#   pragma warning(disable:4103)
-#  endif
-
-#  pragma pack(8)
-
+#ifdef _MSC_VER
+# pragma warning(disable:4103)
 #endif
+
+#pragma pack(push,8)
diff --git a/mingw-w64-tools/widl/src/header.c b/mingw-w64-tools/widl/src/header.c
index cec4a33..31b476d 100644
--- a/mingw-w64-tools/widl/src/header.c
+++ b/mingw-w64-tools/widl/src/header.c
@@ -2017,7 +2017,6 @@
           write_forward(header, stmt->u.type);
         break;
       case STMT_IMPORTLIB:
-      case STMT_PRAGMA:
         /* not included in header */
         break;
       case STMT_IMPORT:
@@ -2043,6 +2042,9 @@
         write_header_stmts(header, stmt->u.type->details.module->stmts, stmt->u.type, FALSE);
         fprintf(header, "#endif /* __%s_MODULE_DEFINED__ */\n", stmt->u.type->name);
         break;
+      case STMT_PRAGMA:
+        if (!strncmp( stmt->u.str, "pack", 4 )) fprintf(header, "#pragma %s\n", stmt->u.str);
+        break;
       case STMT_CPPQUOTE:
         fprintf(header, "%s\n", stmt->u.str);
         break;
diff --git a/mingw-w64-tools/widl/src/typegen.c b/mingw-w64-tools/widl/src/typegen.c
index c29bbba..9567b2d 100644
--- a/mingw-w64-tools/widl/src/typegen.c
+++ b/mingw-w64-tools/widl/src/typegen.c
@@ -5047,7 +5047,7 @@
 
     needs_packing = (align > pointer_size);
 
-    if (needs_packing) print_file( file, 0, "#include <pshpack%u.h>\n", pointer_size );
+    if (needs_packing) print_file( file, 0, "#pragma pack(push,%u)\n", pointer_size );
     print_file(file, 1, "struct _PARAM_STRUCT\n" );
     print_file(file, 1, "{\n" );
     if (is_object( iface )) print_file(file, 2, "%s *This;\n", iface->name );
@@ -5081,7 +5081,7 @@
         fprintf( file, "%s;\n", retval->name );
     }
     print_file(file, 1, "} %s;\n", var_decl );
-    if (needs_packing) print_file( file, 0, "#include <poppack.h>\n" );
+    if (needs_packing) print_file( file, 0, "#pragma pack(pop)\n" );
     print_file( file, 0, "\n" );
 }
 
diff --git a/mingw-w64-tools/widl/tools.h b/mingw-w64-tools/widl/tools.h
index f017bab..5a8173d 100644
--- a/mingw-w64-tools/widl/tools.h
+++ b/mingw-w64-tools/widl/tools.h
@@ -550,6 +550,14 @@
 }
 
 
+static inline int is_pe_target( struct target target )
+{
+    return (target.platform == PLATFORM_WINDOWS ||
+            target.platform == PLATFORM_MINGW ||
+            target.platform == PLATFORM_CYGWIN);
+}
+
+
 static inline int get_cpu_from_name( const char *name )
 {
     static const struct
@@ -619,16 +627,7 @@
     };
 
     if (!cpu_names[target.cpu]) return "";
-
-    switch (target.platform)
-    {
-    case PLATFORM_WINDOWS:
-    case PLATFORM_CYGWIN:
-    case PLATFORM_MINGW:
-        return strmake( "/%s-windows", cpu_names[target.cpu] );
-    default:
-        return strmake( "/%s-unix", cpu_names[target.cpu] );
-    }
+    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 )