diff --git a/.github/actions/build_llvm_clang/action.yml b/.github/actions/build_llvm_clang/action.yml
new file mode 100644
index 0000000000000000000000000000000000000000..a9a0355babb715e3fc614ce4d632ff2a1dafe0aa
--- /dev/null
+++ b/.github/actions/build_llvm_clang/action.yml
@@ -0,0 +1,84 @@
+name: 'Configure, Build, and Install LLVM and Clang'
+description: 'Action that sets up the toolchain needed'
+inputs:
+  install-prefix:
+    description: 'Installation target directory for LLVM and Clang'
+    required: true
+    # default: ${{ env.INSTALLROOT }}/${{ env.TOOLS_INSTALLATION }}
+  llvm-builddir:
+    description: 'Directory where llvm will be built'
+    required: true
+    default: ${{ github.workspace }}/build/llvm
+  llvm-makedir:
+    description: 'Directory where the llvm CMake files reside'
+    required: true
+    # default: ${{ env.LLVM_MAKEDIR }}
+  clang-builddir:
+    description: 'Directory where clang will be built'
+    required: true
+    default: ${{ github.workspace }}/build/clang
+  clang-makedir:
+    description: 'Directory where the clang CMake files reside'
+    required: true
+    # default: ${{ env.CLANG_MAKEDIR }}
+
+runs:
+  using: "composite"
+  steps:
+    - name: Install LLVM / Clang build dependencies
+      shell: bash
+      run: |
+        brew install cmake ninja
+
+    - name: Configure LLVM
+      shell: bash
+      run: |
+        set -x
+        mkdir -p ${{ inputs.llvm-builddir }}
+        pushd ${{ inputs.llvm-builddir }}
+        cmake -G Ninja \
+              -DLLVM_TARGETS_TO_BUILD=X86 \
+              -DCMAKE_BUILD_TYPE=Release \
+              -DCMAKE_INSTALL_PREFIX="${{ inputs.install-prefix }}" \
+              ${{ inputs.llvm-makedir }}
+        popd
+
+    - name: Build LLVM
+      shell: bash
+      run: |
+        pushd ${{ inputs.llvm-builddir }}
+        Ninja
+        popd
+
+    - name: Install LLVM
+      shell: bash
+      run: |
+        pushd ${{ inputs.llvm-builddir }}
+        Ninja install
+        popd
+
+    - name: Configure Clang
+      shell: bash
+      run: |
+        set -x
+        mkdir -p ${{ inputs.clang-builddir }}
+        pushd ${{ inputs.clang-builddir }}
+        cmake -G Ninja \
+              -DCMAKE_BUILD_TYPE=Release \
+              -DCMAKE_INSTALL_PREFIX="${{ inputs.install-prefix }}" \
+              ${{ inputs.clang-makedir }}
+        popd
+
+    - name: Build Clang
+      shell: bash
+      run: |
+        pushd ${{ inputs.clang-builddir }}
+        Ninja
+        popd
+
+    - name: Install Clang
+      shell: bash
+      run: |
+        pushd ${{ inputs.clang-builddir }}
+        Ninja install
+        popd
diff --git a/.github/actions/configure_wine/action.yml b/.github/actions/configure_wine/action.yml
new file mode 100644
index 0000000000000000000000000000000000000000..886b58a42459caa8f39af4056d6e78ea2ffd34d8
--- /dev/null
+++ b/.github/actions/configure_wine/action.yml
@@ -0,0 +1,76 @@
+name: 'Configure Wine'
+description: 'Crossover-version independent action to configure Wine'
+inputs:
+  winearch:
+    description: 'wine64 or wine32on64'
+    required: true
+    default: "wine64"
+  crossflags:
+    descriptions: 'CROSSFLAGS to be given to ming-w64'
+    required: true
+    default: "-g -O2"
+  cflags:
+    descriptions: 'CFLAGS to be given to clang'
+    required: true
+    # Xcode12 by default enables '-Werror,-Wimplicit-function-declaration' (49917738)
+    # this causes wine(64) builds to fail so needs to be disabled.
+    # https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes    
+    default: "-g -O2 -Wno-implicit-function-declaration -Wno-deprecated-declarations -Wno-format"
+  ldflags:
+    descriptions: 'LDFLAGS to be given to clang'
+    required: true
+    default: "-Wl,-headerpad_max_install_names"
+  build-dir:
+    description: 'Build directory'
+    required: true
+  wine-configure:
+    description: 'Path to wine configure script'
+    required: true
+    default: ${{ github.workspace }}/sources/wine/configure
+  configure-params:
+    description: 'additional parameters to be given to the wine configure script'
+    required: true
+    default: "--enable-win64 --with-vulkan"
+runs:
+  using: "composite"
+  steps:
+      - name: Configure ${{ inputs.winearch }}
+        env:
+          CC: clang
+          CXX: clang++
+          CROSSCFLAGS: ${{ inputs.crossflags }}
+          CFLAGS: ${{ inputs.cflags }}
+          LDFLAGS: ${{ inputs.ldflags }}
+        run: |
+          set -x
+
+          export SDL2_CFLAGS="-I$(brew --prefix sdl2)/include -I$(brew --prefix sdl2)/include/SDL2"
+          export GPHOTO2_CFLAGS="-I$(brew --prefix libgphoto2)/include -I$(brew --prefix libgphoto2)/include/gphoto2"
+          export GPHOTO2_PORT_CFLAGS="-I$(brew --prefix libgphoto2)/include -I$(brew --prefix libgphoto2)/include/gphoto2"
+
+          export PNG_CFLAGS="-I$(brew --prefix libpng)/include"
+          export PNG_LIBS="-L$(brew --prefix libpng)/lib"
+
+          export LDFLAGS="-L $(brew --prefix molten-vk)/lib"
+
+          mkdir -p ${{ inputs.build-dir }}/
+          pushd ${{ inputs.build-dir }}
+          ${{ inputs.wine-configure }} \
+                    --disable-tests \
+                    --without-alsa \
+                    --without-capi \
+                    --without-dbus \
+                    --without-inotify \
+                    --without-oss \
+                    --without-pulse \
+                    --without-udev \
+                    --without-v4l2 \
+                    --without-gsm \
+                    --with-png \
+                    --with-sdl \
+                    --with-vulkan \
+                    --without-x \
+                    ${{ inputs.configure-params }}
+          popd
+
+        shell: bash
diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml
new file mode 100644
index 0000000000000000000000000000000000000000..b9643ab23b9df77a0491045aff5ca53a11ca7677
--- /dev/null
+++ b/.github/actions/install/action.yml
@@ -0,0 +1,19 @@
+name: 'Make Install'
+description: 'Run make install with build and target directory'
+inputs:
+  build-dir:
+    description: 'Build directory'
+    required: true
+  install-dir:
+    description: 'Installation directory'
+    required: true
+runs:
+  using: "composite"
+  steps:
+      - name: Install from ${{ inputs.build-dir }} to ${{ inputs.install-dir }}
+        run: |
+          set -x
+          pushd ${{ inputs.build-dir }}
+          make install-lib DESTDIR="${{ inputs.install-dir }}"
+          popd
+        shell: bash
diff --git a/.github/actions/make/action.yml b/.github/actions/make/action.yml
new file mode 100644
index 0000000000000000000000000000000000000000..b9905c808c47640f816ad9d0c1a6c84c566be88e
--- /dev/null
+++ b/.github/actions/make/action.yml
@@ -0,0 +1,15 @@
+name: 'Make'
+description: 'Make a configured project'
+inputs:
+  build-dir:
+    description: 'Build directory'
+    required: true
+runs:
+  using: "composite"
+  steps:
+      - name: Building in ${{ inputs.build-dir }}
+        run: |
+          pushd ${{ inputs.build-dir }}
+          make -j$(sysctl -n hw.activecpu 2>/dev/null)
+          popd
+        shell: bash
diff --git a/.github/workflows/build_local.yml b/.github/workflows/build_local.yml
index 90822d161b0c2d7f3ca3bc00c63ff753cece76da..35ccdb4d30af6136cc1a90522aefbe35dad689c9 100644
--- a/.github/workflows/build_local.yml
+++ b/.github/workflows/build_local.yml
@@ -1,10 +1,10 @@
 name: Wine-Crossover-MacOS-local
 
 on:
-  push:
-    branches: [ main ]
-  pull_request:
-    branches: [ main ]
+  #push:
+  #  branches: [ main ]
+  #pull_request:
+  #  branches: [ main ]
   workflow_dispatch:
 
 env:
@@ -17,7 +17,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        CROSS_OVER_VERSION: [20.0.4, 20.0.2, 20.0.1, 20.0.0, 19.0.2]
+        CROSS_OVER_VERSION: [21.0.0, 20.0.4, 19.0.2] # 20.0.2, 20.0.1, 20.0.0
 
     runs-on:  macos-10.15
 
diff --git a/.github/workflows/build_monolithic.yml b/.github/workflows/build_monolithic.yml
index 9f337b729699a1672ad20125f16f3e1fd1869425..d1cab90f1a1584b04b9ba074b1c5200f0f5d53e0 100644
--- a/.github/workflows/build_monolithic.yml
+++ b/.github/workflows/build_monolithic.yml
@@ -19,14 +19,67 @@ env:
     CLANG_BUILDDIR: ${{ github.workspace }}/build/clang
     # target directory for installation
     INSTALLROOT: ${{ github.workspace }}/install
+    TOOLS_INSTALLATION: build-tools-cx
 
 jobs:
+  llvm-clang:
+    runs-on:  macos-10.15
+    env:
+      # crossover source code to be downloaded
+      CROSS_OVER_SOURCE_URL: https://media.codeweavers.com/pub/crossover/source/crossover-sources-21.0.0.tar.gz
+      CROSS_OVER_LOCAL_FILE: crossover-21.0.0
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+
+      ############ Restore LLVM / Clang from cache ##############
+
+      - name: Restore LLVM / Clang from cache
+        uses: actions/cache@v2
+        id: cache_llvm_clang
+        with:
+          path: ${{ env.INSTALLROOT }}/${{ env.TOOLS_INSTALLATION }}
+          key: llvm_clang
+
+      ############ Build LLVM / Clang (if restore from cache failed) ##############
+
+      - name: Get and Extract Source
+        if:  steps.cache_llvm_clang.outputs.cache-hit != 'true'
+        run:  |
+          curl -o ${{ env.CROSS_OVER_LOCAL_FILE }}.tar.gz ${{ env.CROSS_OVER_SOURCE_URL }}
+          tar xf ${{ env.CROSS_OVER_LOCAL_FILE }}.tar.gz
+
+      - name: Build / Install LLVM and Clang (if restore from cache failed)
+        if:  steps.cache_llvm_clang.outputs.cache-hit != 'true'
+        uses: ./.github/actions/build_llvm_clang
+        with:
+          install-prefix: ${{ env.INSTALLROOT }}/${{ env.TOOLS_INSTALLATION }}
+          llvm-makedir: ${{ github.workspace }}/sources/clang/llvm
+          clang-makedir: ${{ github.workspace }}/sources/clang/clang
+
+      ############ Upload LLVM / Clang to be used in subsequent job steps ##############
+
+      - name: Tar Build Tools
+        run: |
+          set -x
+          pushd ${{ env.INSTALLROOT }}
+          tar -czf ${{ env.TOOLS_INSTALLATION }}.tar.gz ${{ env.TOOLS_INSTALLATION }}
+          ls -alt
+          popd
+
+      - name: Upload Build Tools
+        uses: actions/upload-artifact@v2
+        with:
+          name: ${{ env.TOOLS_INSTALLATION }}
+          path: ${{ env.INSTALLROOT }}/${{ env.TOOLS_INSTALLATION }}.tar.gz
+
   wine-crossover:
+    needs: llvm-clang
 
     strategy:
       fail-fast: false
       matrix:
-        CROSS_OVER_VERSION: [20.0.4, 20.0.2, 20.0.1, 20.0.0, 19.0.2]
+        CROSS_OVER_VERSION: [21.0.0, 20.0.4, 19.0.2] # 20.0.2, 20.0.1, 20.0.0
 
     runs-on:  macos-10.15
 
@@ -34,11 +87,7 @@ jobs:
       # crossover source code to be downloaded
       CROSS_OVER_SOURCE_URL: https://media.codeweavers.com/pub/crossover/source/crossover-sources-${{ matrix.CROSS_OVER_VERSION }}.tar.gz
       CROSS_OVER_LOCAL_FILE: crossover-${{ matrix.CROSS_OVER_VERSION }}
-      # directories / files inside the downloaded tar file directory structure
-      LLVM_MAKEDIR: $GITHUB_WORKSPACE/sources/${{ startsWith(matrix.CROSS_OVER_VERSION, '20') && 'clang/llvm' || 'llvm' }}
-      CLANG_MAKEDIR: $GITHUB_WORKSPACE/sources/${{ startsWith(matrix.CROSS_OVER_VERSION, '20') && 'clang/clang' || 'clang' }}
       # artifact names
-      TOOLS_INSTALLATION: build-tools-cx${{ matrix.CROSS_OVER_VERSION }}
       WINE_INSTALLATION: wine-cx${{ matrix.CROSS_OVER_VERSION }}
       DXVK_INSTALLATION: dxvk-cx${{ matrix.CROSS_OVER_VERSION }}
 
@@ -49,14 +98,8 @@ jobs:
       - name: Checkout
         uses: actions/checkout@v2
 
-      - name: Install Dependencies
+      - name: Install Wine Dependencies
         run: |
-          # build tools
-          brew install  cmake            \
-                        ninja            \
-                        mingw-w64        \
-
-          # build dependencies for wine / crossover
           brew install  freetype         \
                         bison            \
                         krb5             \
@@ -68,20 +111,31 @@ jobs:
                         mpg123           \
                         little-cms2      \
                         libpng           \
+                        mingw-w64        \
                         molten-vk
 
-          # dependencies for dxvk
-          brew install  coreutils \
-                        meson     \
-                        glslang
-
       - name: Add bison & krb5 to $PATH
         run: |
           set -x
           echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
           echo "$(brew --prefix krb5)/bin" >> $GITHUB_PATH
 
-      - name: Add llvm/clang to $PATH (for later)
+      - name: Download llvm/clang (from previous job)
+        uses: actions/download-artifact@v2
+        with:
+          name: ${{ env.TOOLS_INSTALLATION }}
+          path: ${{ env.INSTALLROOT }}
+
+      - name: Unpack llvm/clang
+        run: |
+          set -x
+          pushd ${{ env.INSTALLROOT }}
+          ls -al
+          tar -xvf ${{ env.TOOLS_INSTALLATION }}.tar.gz
+          ls -alt
+          popd
+
+      - name: Add llvm/clang to $PATH
         run: |
           set -x
           echo "${{ env.INSTALLROOT }}/${{ env.TOOLS_INSTALLATION }}/bin" >> $GITHUB_PATH
@@ -97,236 +151,131 @@ jobs:
         run:  |
           tar xf ${{ env.CROSS_OVER_LOCAL_FILE }}.tar.gz
 
-      - name: Add missing llvm/clang
-        if: ${{ matrix.CROSS_OVER_VERSION == '20.0.1' || matrix.CROSS_OVER_VERSION == '20.0.2' }}
-        run: |
-          curl -o crossover-20.0.0.tar.gz https://media.codeweavers.com/pub/crossover/source/crossover-sources-20.0.0.tar.gz
-          tar -xf crossover-20.0.0.tar.gz sources/clang
-
-      - name: Add distversion.h
-        run: cp distversion.h sources/wine/include/distversion.h
-
-      - name: Patch wcslen() in ntdll/wcstring.c to prevent crash if a nullptr is suppluied to the function (HACK)
-        if: startsWith(matrix.CROSS_OVER_VERSION, '20')
-        run: patch sources/wine/dlls/ntdll/wcstring.c < wcstring.patch
-
-      - name: Patch DXVK
-        if: startsWith(matrix.CROSS_OVER_VERSION, '20')
-        run: patch sources/dxvk/src/util/rc/util_rc_ptr.h < dxvk_util_rc_ptr.patch
-
-
-      ############ Build LLVM / Clang ##############
-
-      - name: Configure LLVM
-        run: |
-          set -x
-          mkdir -p ${{ env.LLVM_BUILDDIR }}
-          pushd ${{ env.LLVM_BUILDDIR }}
-          cmake -G Ninja \
-                -DLLVM_TARGETS_TO_BUILD=X86 \
-                -DCMAKE_BUILD_TYPE=Release \
-                -DCMAKE_INSTALL_PREFIX="${{ env.INSTALLROOT }}/${{ env.TOOLS_INSTALLATION }}" \
-                ${{ env.LLVM_MAKEDIR }}
-          popd
-
-      - name: Build LLVM
-        run: |
-          pushd ${{ env.LLVM_BUILDDIR }}
-          Ninja
-          popd
-
-      - name: Install LLVM
+      - name: Patch Add missing distversion.h
+        # Patch provided by Josh Dubois, CrossOver product manager, CodeWeavers.
         run: |
-          pushd ${{ env.LLVM_BUILDDIR }}
-          Ninja install
+          pushd sources/wine
+          patch -p1 < ${{ github.workspace }}/distversion.patch
           popd
 
-      - name: Configure Clang
-        run: |
-          set -x
-          mkdir -p ${{ env.CLANG_BUILDDIR }}
-          pushd ${{ env.CLANG_BUILDDIR }}
-          cmake -G Ninja \
-                -DCMAKE_BUILD_TYPE=Release \
-                -DCMAKE_INSTALL_PREFIX="${{ env.INSTALLROOT }}/${{ env.TOOLS_INSTALLATION }}" \
-                ${{ env.CLANG_MAKEDIR }}
-          popd
-
-      - name: Build Clang
-        run: |
-          pushd ${{ env.CLANG_BUILDDIR }}
-          Ninja
-          popd
-
-      - name: Install Clang
+      - name: Patch ntdll/wcstring.c to prevent crash if a nullptr is supplied to the function
+        # Hack by dasmy
+        if: startsWith(matrix.CROSS_OVER_VERSION, '20')
         run: |
-          pushd ${{ env.CLANG_BUILDDIR }}
-          Ninja install
+          pushd sources/wine
+          patch -p1 < ${{ github.workspace }}/wcstring.patch
           popd
 
-      - name: Tar Build Tools
+      - name: Patch msvcrt to export the missing sincos function
+        # https://github.com/wine-mirror/wine/commit/f0131276474997b9d4e593bbf8c5616b879d3bd5
+        if: startsWith(matrix.CROSS_OVER_VERSION, '20')
         run: |
-          set -x
-          pushd ${{ env.INSTALLROOT }}
-          tar -czf ${{ env.TOOLS_INSTALLATION }}.tar.gz ${{ env.TOOLS_INSTALLATION }}
-          ls -alt
+          pushd sources/wine
+          patch -p1 < ${{ github.workspace }}/msvcrt-sincos.patch
           popd
 
-      - name: Upload Build Tools
-        uses: actions/upload-artifact@v2
-        with:
-          name: ${{ env.TOOLS_INSTALLATION }}
-          path: ${{ env.INSTALLROOT }}/${{ env.TOOLS_INSTALLATION }}.tar.gz
+      - name: Patch DXVK
+        if: startsWith(matrix.CROSS_OVER_VERSION, '20')
+        run: patch sources/dxvk/src/util/rc/util_rc_ptr.h < dxvk_util_rc_ptr.patch
 
 
       ############ Build DXVK ##############
 
-      - name: Build DXVK
-        if: startsWith(matrix.CROSS_OVER_VERSION, '20')
-        run: |
-          set -x
-          PATH="$(brew --prefix coreutils)/libexec/gnubin:${PATH}" ${{ env.DXVK_BUILDSCRIPT }} master ${{ env.INSTALLROOT }}/${{ env.DXVK_INSTALLATION }} --no-package
-
-      - name: Tar DXVK
-        if: startsWith(matrix.CROSS_OVER_VERSION, '20')
-        run: |
-          set -x
-          pushd ${{ env.INSTALLROOT }}
-          tar -czf ${{ env.DXVK_INSTALLATION }}.tar.gz ${{ env.DXVK_INSTALLATION }}
-          popd
-
-      - name: Upload DXVK
-        if: startsWith(matrix.CROSS_OVER_VERSION, '20')
-        uses: actions/upload-artifact@v2
+      #- name: Install Dependencies for DXVK
+      #  run: |
+      #    brew install  coreutils \
+      #                  meson     \
+      #                  glslang
+
+      #- name: Build DXVK
+      #  if: startsWith(matrix.CROSS_OVER_VERSION, '20')
+      #  run: |
+      #    set -x
+      #    PATH="$(brew --prefix coreutils)/libexec/gnubin:${PATH}" ${{ env.DXVK_BUILDSCRIPT }} master ${{ env.INSTALLROOT }}/${{ env.DXVK_INSTALLATION }} --no-package
+
+      #- name: Tar DXVK
+      #  if: startsWith(matrix.CROSS_OVER_VERSION, '20')
+      #  run: |
+      #    set -x
+      #    pushd ${{ env.INSTALLROOT }}
+      #    tar -czf ${{ env.DXVK_INSTALLATION }}.tar.gz ${{ env.DXVK_INSTALLATION }}
+      #    popd
+
+      #- name: Upload DXVK
+      #  if: startsWith(matrix.CROSS_OVER_VERSION, '20')
+      #  uses: actions/upload-artifact@v2
+      #  with:
+      #    name: ${{ env.DXVK_INSTALLATION }}
+      #    path: ${{ env.INSTALLROOT }}/${{ env.DXVK_INSTALLATION }}.tar.gz
+
+
+      ############ Configure 64bit Version ##############
+
+      - name: Configure wine64 (specific to 2x)
+        if: startsWith(matrix.CROSS_OVER_VERSION, '2')
+        uses: ./.github/actions/configure_wine
         with:
-          name: ${{ env.DXVK_INSTALLATION }}
-          path: ${{ env.INSTALLROOT }}/${{ env.DXVK_INSTALLATION }}.tar.gz
-
+          winearch: "wine64"
+          build-dir: "${{ env.BUILDROOT }}/wine64"
+          crossflags: "-g -O2"
+          configure-params: "--enable-win64 --with-vulkan"
+
+      - name: Configure wine64 (specific to 19)
+        if: startsWith(matrix.CROSS_OVER_VERSION, '19')
+        uses: ./.github/actions/configure_wine
+        with:
+          winearch: "wine64"
+          build-dir: "${{ env.BUILDROOT }}/wine64"
+          crossflags: "-g -O2 -fcommon"
+          configure-params: "--enable-win64 --with-vulkan"
 
       ############ Build 64bit Version ##############
 
-      - name: Configure wine64
-        env:
-          CC: clang
-          CXX: clang++
-          # see https://github.com/Gcenx/macOS_Wine_builds/issues/17#issuecomment-750346843
-          CROSSCFLAGS: "-g -O2 -fcommon"
-          # Xcode12 by default enables '-Werror,-Wimplicit-function-declaration' (49917738)
-          # this causes wine(64) builds to fail so needs to be disabled.
-          # https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes
-          CFLAGS: "-g -O2 -Wno-implicit-function-declaration -Wno-deprecated-declarations -Wno-format"
-          LDFLAGS: "-Wl,-headerpad_max_install_names"
-        run: |
-          set -x
-
-          export SDL2_CFLAGS="-I$(brew --prefix sdl2)/include"
-          export GPHOTO2_CFLAGS="-I$(brew --prefix libgphoto2)/include -I$(brew --prefix libgphoto2)/include/gphoto2"
-          export GPHOTO2_PORT_CFLAGS="-I$(brew --prefix libgphoto2)/include -I$(brew --prefix libgphoto2)/include/gphoto2"
-
-          export PNG_CFLAGS="-I$(brew --prefix libpng)/include"
-          export PNG_LIBS="-L$(brew --prefix libpng)/lib"
-
-          export LDFLAGS="-L $(brew --prefix molten-vk)/lib"
-
-          mkdir -p ${{ env.BUILDROOT }}/wine64
-          pushd ${{ env.BUILDROOT }}/wine64
-          ${{ env.WINE_CONFIGURE }} \
-                    --enable-win64 \
-                    --disable-tests \
-                    --without-alsa \
-                    --without-capi \
-                    --without-dbus \
-                    --without-inotify \
-                    --without-oss \
-                    --without-pulse \
-                    --without-udev \
-                    --without-v4l2 \
-                    --without-gsm \
-                    --with-png \
-                    --with-sdl \
-                    --with-vulkan \
-                    --without-x
-          popd
-
       - name: Build wine64
-        run: |
-          pushd ${{ env.BUILDROOT }}/wine64
-          make -j$(sysctl -n hw.ncpu 2>/dev/null)
-          popd
-
+        uses: ./.github/actions/make
+        with:
+          build-dir: "${{ env.BUILDROOT }}/wine64"
 
-      ############ Build 32bit Version (WoW64) ##############
+      ############ Configure 32on64bit Version ##############
 
-      - name: Configure wine32on64
-        env:
-          CC: clang
-          CXX: clang++
-          # see https://github.com/Gcenx/macOS_Wine_builds/issues/17#issuecomment-750346843
-          CROSSCFLAGS: "-g -O2 -fcommon"
-          # Xcode12 by default enables '-Werror,-Wimplicit-function-declaration' (49917738)
-          # this causes wine(64) builds to fail so needs to be disabled.
-          # https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes
-          CFLAGS: "-g -O2 -Wno-implicit-function-declaration -Wno-deprecated-declarations -Wno-format"
-          LDFLAGS: "-Wl,-headerpad_max_install_names"
-        run: |
-          set -x
+      - name: Configure wine32on64 (specific to 2x)
+        if: startsWith(matrix.CROSS_OVER_VERSION, '2')
+        uses: ./.github/actions/configure_wine
+        with:
+          winearch: "wine32on64"
+          build-dir: "${{ env.BUILDROOT }}/wine32on64"
+          crossflags: "-g -O2"
+          configure-params: "--enable-win32on64 --with-wine64=${{ env.BUILDROOT }}/wine64 --without-cms --without-gstreamer --without-gphoto --without-sane --without-krb5 --disable-winedbg --without-vkd3d --without-vulkan --disable-vulkan_1 --disable-winevulkan"
+
+      - name: Configure wine32on64 (specific to 19)
+        if: startsWith(matrix.CROSS_OVER_VERSION, '19')
+        uses: ./.github/actions/configure_wine
+        with:
+          winearch: "wine32on64"
+          build-dir: "${{ env.BUILDROOT }}/wine32on64"
+          crossflags: "-g -O2 -fcommon"
+          configure-params: "--enable-win32on64 --with-wine64=${{ env.BUILDROOT }}/wine64 --without-cms --without-gstreamer --without-gphoto --without-sane --without-krb5 --disable-winedbg --without-vkd3d --without-vulkan --disable-vulkan_1 --disable-winevulkan"
 
-          export SDL2_CFLAGS="-I$(brew --prefix sdl2)/include"
-
-          export PNG_CFLAGS="-I$(brew --prefix libpng)/include"
-          export PNG_LIBS="-L$(brew --prefix libpng)/lib"
-
-          mkdir -p ${{ env.BUILDROOT }}/wine32on64
-          pushd ${{ env.BUILDROOT }}/wine32on64
-          ${{ env.WINE_CONFIGURE }} \
-                    --enable-win32on64 \
-                    --with-wine64=${{ env.BUILDROOT }}/wine64 \
-                    --disable-tests \
-                    --without-alsa \
-                    --without-capi \
-                    --without-dbus \
-                    --without-inotify \
-                    --without-oss \
-                    --without-pulse \
-                    --without-udev \
-                    --without-v4l2 \
-                    --disable-winedbg \
-                    --without-cms \
-                    --without-gstreamer \
-                    --without-gsm \
-                    --without-gphoto \
-                    --without-sane \
-                    --with-png \
-                    --with-sdl \
-                    --without-vkd3d \
-                    --without-vulkan \
-                    --disable-vulkan_1 \
-                    --disable-winevulkan \
-                    --without-x
-          popd
+      ############ Build 32on64bit Version ##############
 
       - name: Build wine32on64
-        run: |
-          pushd ${{ env.BUILDROOT }}/wine32on64
-          make -j$(sysctl -n hw.ncpu 2>/dev/null)
-          popd
-
+        uses: ./.github/actions/make
+        with:
+          build-dir: "${{ env.BUILDROOT }}/wine32on64"
 
       ############ Install wine ##############
 
       - name: Install wine32on64
-        run: |
-          set -x
-          pushd ${{ env.BUILDROOT }}/wine32on64
-          make install-lib DESTDIR="${{ env.INSTALLROOT }}/${{ env.WINE_INSTALLATION }}"
-          popd
+        uses: ./.github/actions/install
+        with:
+          build-dir: "${{ env.BUILDROOT }}/wine32on64"
+          install-dir: "${{ env.INSTALLROOT }}/${{ env.WINE_INSTALLATION }}"
 
       - name: Install wine64
-        run: |
-          set -x
-          pushd ${{ env.BUILDROOT }}/wine64
-          make install-lib DESTDIR="${{ env.INSTALLROOT }}/${{ env.WINE_INSTALLATION }}"
-          popd
+        uses: ./.github/actions/install
+        with:
+          build-dir: "${{ env.BUILDROOT }}/wine64"
+          install-dir: "${{ env.INSTALLROOT }}/${{ env.WINE_INSTALLATION }}"
 
       ############ Bundle and Upload Deliverable ##############
 
diff --git a/build_local.sh b/build_local.sh
index 8323e8e1b94521f3f284fcdec9f190f8765f7d27..d0f06576e4ba1f90bd0bc34b439adec01ab4abde 100755
--- a/build_local.sh
+++ b/build_local.sh
@@ -7,7 +7,7 @@ echo Wine-Crossover-MacOS
 export GITHUB_WORKSPACE=$(pwd)
 
 if [ -z "$CROSS_OVER_VERSION" ]; then
-    export CROSS_OVER_VERSION=20.0.4
+    export CROSS_OVER_VERSION=21.0.0
 fi
 
 # avoid weird linker errors with Xcode 10 and later
@@ -16,8 +16,8 @@ export MACOSX_DEPLOYMENT_TARGET=10.14
 export CROSS_OVER_SOURCE_URL=https://media.codeweavers.com/pub/crossover/source/crossover-sources-${CROSS_OVER_VERSION}.tar.gz
 export CROSS_OVER_LOCAL_FILE=crossover-${CROSS_OVER_VERSION}
 # directories / files inside the downloaded tar file directory structure
-export LLVM_MAKEDIR=$GITHUB_WORKSPACE/sources/$([[ ${CROSS_OVER_VERSION} == 20.* ]] && echo "clang/llvm" || echo "llvm")
-export CLANG_MAKEDIR=$GITHUB_WORKSPACE/sources/$([[ ${CROSS_OVER_VERSION} == 20.* ]] && echo "clang/clang" || echo "clang")
+export LLVM_MAKEDIR=$GITHUB_WORKSPACE/sources/$([[ ${CROSS_OVER_VERSION} == 2?.* ]] && echo "clang/llvm" || echo "llvm")
+export CLANG_MAKEDIR=$GITHUB_WORKSPACE/sources/$([[ ${CROSS_OVER_VERSION} == 2?.* ]] && echo "clang/clang" || echo "clang")
 export WINE_CONFIGURE=$GITHUB_WORKSPACE/sources/wine/configure
 export DXVK_BUILDSCRIPT=$GITHUB_WORKSPACE/sources/dxvk/package-release.sh
 # build directories
@@ -36,8 +36,7 @@ export DXVK_INSTALLATION=dxvk-cx${CROSS_OVER_VERSION}
 echo Install Dependencies
 # build tools
 brew install  cmake            \
-              ninja            \
-              mingw-w64        \
+              ninja
 
 # build dependencies for wine / crossover
 brew install  freetype         \
@@ -51,13 +50,9 @@ brew install  freetype         \
               mpg123           \
               little-cms2      \
               libpng           \
+              mingw-w64        \
               molten-vk
 
-# dependencies for dxvk
-brew install  coreutils \
-            meson     \
-            glslang
-
 echo Add bison and krb5 to PATH
 export PATH="$(brew --prefix bison)/bin":${PATH}
 export PATH="$(brew --prefix krb5)/bin":${PATH}
@@ -80,13 +75,24 @@ if [[ "${CROSS_OVER_VERSION}" == "20.0.1" || "${CROSS_OVER_VERSION}" == "20.0.2"
     tar -xf crossover-20.0.0.tar.gz sources/clang
 fi
 
-echo Add distversion.h
-cp distversion.h sources/wine/include/distversion.h
+echo "Patch Add missing distversion.h"
+# Patch provided by Josh Dubois, CrossOver product manager, CodeWeavers.
+pushd sources/wine
+patch -p1 < ${GITHUB_WORKSPACE}/distversion.patch
+popd
 
 
 if [[ ${CROSS_OVER_VERSION} == 20.* ]]; then
     echo "Patch wcslen() in ntdll/wcstring.c to prevent crash if a nullptr is suppluied to the function (HACK)"
-    patch sources/wine/dlls/ntdll/wcstring.c < wcstring.patch
+    pushd sources/wine
+    patch -p1 < ${GITHUB_WORKSPACE}/wcstring.patch
+    popd
+
+    echo "Patch msvcrt to export the missing sincos function"
+    # https://github.com/wine-mirror/wine/commit/f0131276474997b9d4e593bbf8c5616b879d3bd5
+    pushd sources/wine
+    patch -p1 < ${GITHUB_WORKSPACE}/msvcrt-sincos.patch
+    popd
 
     echo Patch DXVK
     patch sources/dxvk/src/util/rc/util_rc_ptr.h < dxvk_util_rc_ptr.patch
@@ -145,19 +151,23 @@ cp ${INSTALLROOT}/${TOOLS_INSTALLATION}.tar.gz ${PACKAGE_UPLOAD}/
 
 ############ Build DXVK ##############
 
-if [[ ${CROSS_OVER_VERSION} == 20.* ]]; then
-    echo Build DXVK
-    PATH="$(brew --prefix coreutils)/libexec/gnubin:${PATH}" ${DXVK_BUILDSCRIPT} master ${INSTALLROOT}/${DXVK_INSTALLATION} --no-package
-
-    echo Tar DXVK
-    pushd ${INSTALLROOT}
-    tar -czf ${DXVK_INSTALLATION}.tar.gz ${DXVK_INSTALLATION}
-    popd
-
-    echo Upload DXVK
-    mkdir -p ${PACKAGE_UPLOAD}
-    cp ${INSTALLROOT}/${DXVK_INSTALLATION}.tar.gz ${PACKAGE_UPLOAD}/
-fi
+#if [[ ${CROSS_OVER_VERSION} == 20.* ]]; thend
+#    Echo "Installing dependencies for dxvk"
+#    brew install  coreutils \
+#                  meson     \
+#                  glslang
+#    echo Build DXVK
+#    PATH="$(brew --prefix coreutils)/libexec/gnubin:${PATH}" ${DXVK_BUILDSCRIPT} master ${INSTALLROOT}/${DXVK_INSTALLATION} --no-package
+#
+#    echo Tar DXVK
+#    pushd ${INSTALLROOT}
+#    tar -czf ${DXVK_INSTALLATION}.tar.gz ${DXVK_INSTALLATION}
+#    popd
+#
+#    echo Upload DXVK
+#    mkdir -p ${PACKAGE_UPLOAD}
+#    cp ${INSTALLROOT}/${DXVK_INSTALLATION}.tar.gz ${PACKAGE_UPLOAD}/
+#fi
 
 ############ Build 64bit Version ##############
 
@@ -165,14 +175,14 @@ echo Configure wine64
 export CC=clang
 export CXX=clang++
 # see https://github.com/Gcenx/macOS_Wine_builds/issues/17#issuecomment-750346843
-export CROSSCFLAGS="-g -O2 -fcommon"
+export CROSSCFLAGS=$([[ ${CROSS_OVER_VERSION} == 19.* ]] && echo "-g -O2 -fcommon" || echo "-g -O2")
 # Xcode12 by default enables '-Werror,-Wimplicit-function-declaration' (49917738)
 # this causes wine(64) builds to fail so needs to be disabled.
 # https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes
 export CFLAGS="-g -O2 -Wno-implicit-function-declaration -Wno-deprecated-declarations -Wno-format"
 export LDFLAGS="-Wl,-headerpad_max_install_names"
 
-export SDL2_CFLAGS="-I$(brew --prefix sdl2)/include"
+export SDL2_CFLAGS="-I$(brew --prefix sdl2)/"$([[ ${CROSS_OVER_VERSION} == 21.* ]] && echo "include/SDL2" || echo "include")
 export GPHOTO2_CFLAGS="-I$(brew --prefix libgphoto2)/include -I$(brew --prefix libgphoto2)/include/gphoto2"
 export GPHOTO2_PORT_CFLAGS="-I$(brew --prefix libgphoto2)/include -I$(brew --prefix libgphoto2)/include/gphoto2"
 
@@ -213,20 +223,26 @@ echo Configure wine32on64
 export CC=clang
 export CXX=clang++
 # see https://github.com/Gcenx/macOS_Wine_builds/issues/17#issuecomment-750346843
-export CROSSCFLAGS="-g -O2 -fcommon"
+export CROSSCFLAGS=$([[ ${CROSS_OVER_VERSION} == 19.* ]] && echo "-g -O2 -fcommon" || echo "-g -O2")
 # Xcode12 by default enables '-Werror,-Wimplicit-function-declaration' (49917738)
 # this causes wine(64) builds to fail so needs to be disabled.
 # https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes
 export CFLAGS="-g -O2 -Wno-implicit-function-declaration -Wno-deprecated-declarations -Wno-format"
 export LDFLAGS="-Wl,-headerpad_max_install_names"
 
-export SDL2_CFLAGS="-I$(brew --prefix sdl2)/include"
+export SDL2_CFLAGS="-I$(brew --prefix sdl2)/"$([[ ${CROSS_OVER_VERSION} == 21.* ]] && echo "include/SDL2" || echo "include")
 export GPHOTO2_CFLAGS="-I$(brew --prefix libgphoto2)/include -I$(brew --prefix libgphoto2)/include/gphoto2"
 export GPHOTO2_PORT_CFLAGS="-I$(brew --prefix libgphoto2)/include -I$(brew --prefix libgphoto2)/include/gphoto2"
 
 export PNG_CFLAGS="-I$(brew --prefix libpng)/include"
 export PNG_LIBS="-L$(brew --prefix libpng)/lib"
 
+if [[ ${CROSS_OVER_VERSION} == 19.* || ${CROSS_OVER_VERSION} == 20.* ]]; then
+    export DISABLE_VULKAN="--without-vkd3d --without-vulkan --disable-vulkan_1 --disable-winevulkan"
+else
+    export DISABLE_VULKAN=""
+fi
+
 mkdir -p ${BUILDROOT}/wine32on64
 pushd ${BUILDROOT}/wine32on64
 ${WINE_CONFIGURE} \
@@ -249,16 +265,14 @@ ${WINE_CONFIGURE} \
         --without-sane \
         --with-png \
         --with-sdl \
-        --without-vkd3d \
-        --without-vulkan \
-        --disable-vulkan_1 \
-        --disable-winevulkan \
+        --without-krb5 \
+        ${DISABLE_VULKAN} \
         --without-x
 popd
 
 echo Build wine32on64
 pushd ${BUILDROOT}/wine32on64
-make -j$(sysctl -n hw.ncpu 2>/dev/null)
+make -j$(sysctl -n hw.activecpu 2>/dev/null)
 popd
 
 
diff --git a/distversion.h b/distversion.h
deleted file mode 100644
index 2795ce082e26c806d8c394516178ffc839392ae2..0000000000000000000000000000000000000000
--- a/distversion.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* ---------------------------------------------------------------
-*   distversion.c
-*
-* Copyright 2013, CodeWeavers, Inc.
-*
-* Information from DISTVERSION which needs to find
-* its way into the wine tree.
-* --------------------------------------------------------------- */
-
-#define WINDEBUG_WHAT_HAPPENED_MESSAGE "This can be caused by a problem in the program or a deficiency in Wine. You may want to check <a href=\"http://www.codeweavers.com/compatibility/\">http://www.codeweavers.com/compatibility/</a> for tips about running this application. As this is an unofficial build, do not expect to get any support, though."
-
-#define WINDEBUG_USER_SUGGESTION_MESSAGE "If this problem is not present under Windows and has not been reported yet, you can save the detailed information to a file using the \"Save As\" button and try to find out more via elaborate internet search. As this is an unofficial build, do not expect to get any support, though."
diff --git a/distversion.patch b/distversion.patch
new file mode 100644
index 0000000000000000000000000000000000000000..92dc025a83c353a2b338b38f1b836b2516e7862c
--- /dev/null
+++ b/distversion.patch
@@ -0,0 +1,16 @@
+Patch provided by Josh Dubois, CrossOver product manager, CodeWeavers.
+--- /dev/null	            	2013-12-07 10:15:02.000000000 -0600
++++ b/include/distversion.h	    2013-12-07 10:14:51.000000000 -0600
+@@ -0,0 +1,12 @@
++/* ---------------------------------------------------------------
++ *   distversion.c
++ *
++ * Copyright 2013, CodeWeavers, Inc.
++ * 
++ * Information from DISTVERSION which needs to find 
++ * its way into the wine tree.
++ * --------------------------------------------------------------- */
++
++#define WINDEBUG_WHAT_HAPPENED_MESSAGE "This can be caused by a problem in the program or a deficiency in Wine. You may want to check <a href=\"http://www.codeweavers.com/compatibility/\">http://www.codeweavers.com/compatibility/</a> for tips about running this application."
++
++#define WINDEBUG_USER_SUGGESTION_MESSAGE "If this problem is not present under Windows and has not been reported yet, you can save the detailed information to a file using the \"Save As\" button, then <a href=\"http://www.codeweavers.com/support/tickets/enter/\">file a bug report</a> and attach that file to the report."
diff --git a/msvcrt-sincos.patch b/msvcrt-sincos.patch
new file mode 100644
index 0000000000000000000000000000000000000000..8f8f7f1757d484801268260c56f8afcb885551c7
--- /dev/null
+++ b/msvcrt-sincos.patch
@@ -0,0 +1,180 @@
+From f0131276474997b9d4e593bbf8c5616b879d3bd5 Mon Sep 17 00:00:00 2001
+From: Jacek Caban <jacek@codeweavers.com>
+Date: Tue, 18 May 2021 18:08:43 +0200
+Subject: [PATCH] msvcrt: Add sincos to importlib.
+
+Fixes cross compilation with GCC 11, which may optimize a pair of sin(),
+cos() calls to a single sincos() call, which is not exported by any
+msvcrt version.
+
+Signed-off-by: Jacek Caban <jacek@codeweavers.com>
+Signed-off-by: Piotr Caban <piotr@codeweavers.com>
+Signed-off-by: Alexandre Julliard <julliard@winehq.org>
+---
+ dlls/msvcr100/Makefile.in |  1 +
+ dlls/msvcr110/Makefile.in |  1 +
+ dlls/msvcr120/Makefile.in |  1 +
+ dlls/msvcr70/Makefile.in  |  1 +
+ dlls/msvcr71/Makefile.in  |  1 +
+ dlls/msvcr80/Makefile.in  |  1 +
+ dlls/msvcr90/Makefile.in  |  1 +
+ dlls/msvcrt/Makefile.in   |  1 +
+ dlls/msvcrt/sincos.c      | 40 +++++++++++++++++++++++++++++++++++++++
+ dlls/ucrtbase/Makefile.in |  1 +
+ 10 files changed, 49 insertions(+)
+ create mode 100644 dlls/msvcrt/sincos.c
+
+diff --git a/dlls/msvcr100/Makefile.in b/dlls/msvcr100/Makefile.in
+index c5a7710ea419..edf4b4d4407a 100644
+--- a/dlls/msvcr100/Makefile.in
++++ b/dlls/msvcr100/Makefile.in
+@@ -34,6 +34,7 @@ C_SRCS = \
+ 	process.c \
+ 	scanf.c \
+ 	scheduler.c \
++	sincos.c \
+ 	string.c \
+ 	thread.c \
+ 	time.c \
+diff --git a/dlls/msvcr110/Makefile.in b/dlls/msvcr110/Makefile.in
+index d2ba0ac29e3b..c3ee2ca7e8e1 100644
+--- a/dlls/msvcr110/Makefile.in
++++ b/dlls/msvcr110/Makefile.in
+@@ -34,6 +34,7 @@ C_SRCS = \
+ 	process.c \
+ 	scanf.c \
+ 	scheduler.c \
++	sincos.c \
+ 	string.c \
+ 	thread.c \
+ 	time.c \
+diff --git a/dlls/msvcr120/Makefile.in b/dlls/msvcr120/Makefile.in
+index 68a85c581d1f..953e9760ca01 100644
+--- a/dlls/msvcr120/Makefile.in
++++ b/dlls/msvcr120/Makefile.in
+@@ -34,6 +34,7 @@ C_SRCS = \
+ 	process.c \
+ 	scanf.c \
+ 	scheduler.c \
++	sincos.c \
+ 	string.c \
+ 	thread.c \
+ 	time.c \
+diff --git a/dlls/msvcr70/Makefile.in b/dlls/msvcr70/Makefile.in
+index e6dd41b32a54..4c443ecd7f62 100644
+--- a/dlls/msvcr70/Makefile.in
++++ b/dlls/msvcr70/Makefile.in
+@@ -33,6 +33,7 @@ C_SRCS = \
+ 	onexit.c \
+ 	process.c \
+ 	scanf.c \
++	sincos.c \
+ 	string.c \
+ 	thread.c \
+ 	time.c \
+diff --git a/dlls/msvcr71/Makefile.in b/dlls/msvcr71/Makefile.in
+index 7795ce1ae245..6f51a326c6b8 100644
+--- a/dlls/msvcr71/Makefile.in
++++ b/dlls/msvcr71/Makefile.in
+@@ -33,6 +33,7 @@ C_SRCS = \
+ 	onexit.c \
+ 	process.c \
+ 	scanf.c \
++	sincos.c \
+ 	string.c \
+ 	thread.c \
+ 	time.c \
+diff --git a/dlls/msvcr80/Makefile.in b/dlls/msvcr80/Makefile.in
+index 7d11f65b3a37..3e2da5535626 100644
+--- a/dlls/msvcr80/Makefile.in
++++ b/dlls/msvcr80/Makefile.in
+@@ -33,6 +33,7 @@ C_SRCS = \
+ 	onexit.c \
+ 	process.c \
+ 	scanf.c \
++	sincos.c \
+ 	string.c \
+ 	thread.c \
+ 	time.c \
+diff --git a/dlls/msvcr90/Makefile.in b/dlls/msvcr90/Makefile.in
+index 9cb511bbe065..4a49fcfd254c 100644
+--- a/dlls/msvcr90/Makefile.in
++++ b/dlls/msvcr90/Makefile.in
+@@ -33,6 +33,7 @@ C_SRCS = \
+ 	onexit.c \
+ 	process.c \
+ 	scanf.c \
++	sincos.c \
+ 	string.c \
+ 	thread.c \
+ 	time.c \
+diff --git a/dlls/msvcrt/Makefile.in b/dlls/msvcrt/Makefile.in
+index 486e6f5491bd..16405262fca0 100644
+--- a/dlls/msvcrt/Makefile.in
++++ b/dlls/msvcrt/Makefile.in
+@@ -38,6 +38,7 @@ C_SRCS = \
+ 	process.c \
+ 	scanf.c \
+ 	scheduler.c \
++	sincos.c \
+ 	string.c \
+ 	thread.c \
+ 	time.c \
+diff --git a/dlls/msvcrt/sincos.c b/dlls/msvcrt/sincos.c
+new file mode 100644
+index 000000000000..1a34c50f0349
+--- /dev/null
++++ b/dlls/msvcrt/sincos.c
+@@ -0,0 +1,40 @@
++/*
++ * sincos implementation
++ *
++ * Copyright 2021 Jacek Caban for CodeWeavers
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
++ */
++
++#if 0
++#pragma makedep implib
++#endif
++
++#include <math.h>
++
++/* GCC may optimize a pair of sin(), cos() calls to a single sincos() call,
++ * which is not exported by any msvcrt version. */
++
++void sincos(double x, double *s, double *c)
++{
++    *s = sin(x);
++    *c = cos(x);
++}
++
++void sincosf(float x, float *s, float *c)
++{
++    *s = sinf(x);
++    *c = cosf(x);
++}
+diff --git a/dlls/ucrtbase/Makefile.in b/dlls/ucrtbase/Makefile.in
+index a576cf0250bb..2910016f29f4 100644
+--- a/dlls/ucrtbase/Makefile.in
++++ b/dlls/ucrtbase/Makefile.in
+@@ -37,6 +37,7 @@ C_SRCS = \
+ 	printf.c \
+ 	process.c \
+ 	scanf.c \
++	sincos.c \
+ 	string.c \
+ 	thread.c \
+ 	time.c \
diff --git a/wcstring.patch b/wcstring.patch
index a7d55bb7676d4f8461a2756453f396589d75318e..990c9bd1de206ecc63bb750a58766d4558a2738c 100644
--- a/wcstring.patch
+++ b/wcstring.patch
@@ -1,10 +1,20 @@
---- wcstring.c.orig	2021-04-17 16:17:37.000000000 +0200
-+++ wcstring.c	2021-04-17 16:19:18.000000000 +0200
-@@ -137,6 +137,7 @@
+From fe17ff5c022cf388c4ab827d31ce493bb35554d9 Mon Sep 17 00:00:00 2001
+From: dasmy <win_wa@gmx.net>
+Date: Sat, 17 Apr 2021 16:25:06 +0200
+Subject: [PATCH] wcstring.c: HACK to prevent a nullptr-access crash
+
+---
+ dlls/ntdll/wcstring.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/dlls/ntdll/wcstring.c b/dlls/ntdll/wcstring.c
+index aaf8d29b..192697d9 100644
+--- a/dlls/ntdll/wcstring.c
++++ b/dlls/ntdll/wcstring.c
+@@ -137,6 +137,7 @@ INT __cdecl NTDLL_wcscspn( LPCWSTR str, LPCWSTR reject )
   */
  INT __cdecl NTDLL_wcslen( LPCWSTR str )
  {
 +    if (!str) return 0;  // HACK(dasmy): prevent crash if this function is called with a nullptr argument
      return strlenW( str );
  }
-