Compare commits
68 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cdb61af358 | |||
| 8155d78230 | |||
| b052497701 | |||
| ea71e0d8b2 | |||
| c6e74909b4 | |||
| a9643c78e7 | |||
| 57133b71ee | |||
| 00ddcbd9ff | |||
| eb29dfe1f9 | |||
| a731bedad0 | |||
| 1aa358a78f | |||
| 505c9a609f | |||
| bfd4cff9ff | |||
| 002b7b4d54 | |||
| e0dc59bb7d | |||
| d3ab0cf488 | |||
| 919395a423 | |||
| c2c91b9e48 | |||
| f4cd9b9bf2 | |||
| bc02b8b9cc | |||
| 10c2268071 | |||
| 062c077a42 | |||
| f140165f75 | |||
| 89beca4409 | |||
| 6cf744d3a4 | |||
| 7295140210 | |||
| ff0f99f8b6 | |||
| bc96b491d6 | |||
| 24893784d9 | |||
| d620989a6c | |||
| 3e5bd02fe0 | |||
| 870e5ba5b2 | |||
| 6f37d34920 | |||
| 8a76f8cc70 | |||
| 2207fbf217 | |||
| 8e8f26ae95 | |||
| 56f831017e | |||
| 8968d0fd0c | |||
| bcbae1b0be | |||
| 68f5101c64 | |||
| eec05089cf | |||
| c232693340 | |||
| 5419d38372 | |||
| 0a7ffdff4a | |||
| e92e48d7bc | |||
| e125ea5f9c | |||
| 6a961306c9 | |||
| 480f93aed5 | |||
| 2491f0eba1 | |||
| 0053ce8fcc | |||
| 13787d1af9 | |||
| 62e066c754 | |||
| e4362a3d02 | |||
| 3c87501c40 | |||
| 68d949aa5b | |||
| da6bf4fd04 | |||
| f973bf3107 | |||
| 4f4508ccc3 | |||
| 84125ef688 | |||
| c10249d171 | |||
| 576706dc17 | |||
| b5d635d96f | |||
| 00263ec4ba | |||
| 6e91c0ac31 | |||
| df1e68b378 | |||
| e39129c300 | |||
| e64386ebe5 | |||
| cda44e07a8 |
+18
-43
@@ -8,23 +8,26 @@
|
|||||||
# Trigger:
|
# Trigger:
|
||||||
# - push su main (incluso quello propagato dal mirror Gitea)
|
# - push su main (incluso quello propagato dal mirror Gitea)
|
||||||
# - PR aperte su GitHub
|
# - PR aperte su GitHub
|
||||||
# - run manuale via UI
|
# - run manuale via UI (senza input)
|
||||||
|
|
||||||
name: Build
|
name: Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches:
|
||||||
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
- 'examples/**'
|
- 'examples/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches:
|
||||||
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
if: ${{ false }}
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -32,24 +35,17 @@ jobs:
|
|||||||
config: [x86-ansi, x86-unicode, x64-unicode]
|
config: [x86-ansi, x86-unicode, x64-unicode]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
|
|
||||||
- name: Setup MSBuild
|
- name: Setup MSBuild
|
||||||
uses: microsoft/setup-msbuild@v2
|
uses: microsoft/setup-msbuild@v3
|
||||||
|
|
||||||
- name: Read VERSION
|
|
||||||
id: version
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$v = (Get-Content VERSION -Raw).Trim()
|
|
||||||
"version=$v" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
|
|
||||||
|
|
||||||
- name: Build ${{ matrix.config }}
|
- name: Build ${{ matrix.config }}
|
||||||
run: python build_plugin.py --configs ${{ matrix.config }} --verbosity normal
|
run: python build_plugin.py --configs ${{ matrix.config }} --verbosity normal
|
||||||
@@ -58,20 +54,22 @@ jobs:
|
|||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$map = @{ 'x86-ansi' = 'x86-ansi'; 'x86-unicode' = 'x86-unicode'; 'x64-unicode' = 'amd64-unicode' }
|
$map = @{ 'x86-ansi' = 'x86-ansi'; 'x86-unicode' = 'x86-unicode'; 'x64-unicode' = 'amd64-unicode' }
|
||||||
$src = "plugins\$($map['${{ matrix.config }}'])\nsis7z.dll"
|
$dir = $map['${{ matrix.config }}']
|
||||||
$dst = "dist\${{ matrix.config }}"
|
$src = "plugins\$dir\nsis7z.dll"
|
||||||
|
$dst = "dll-bundle\$dir"
|
||||||
New-Item -ItemType Directory -Force -Path $dst | Out-Null
|
New-Item -ItemType Directory -Force -Path $dst | Out-Null
|
||||||
Copy-Item $src $dst
|
Copy-Item $src $dst
|
||||||
|
|
||||||
- name: Upload DLL
|
- name: Upload DLL
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: ${{ github.event.repository.name }}-${{ steps.version.outputs.version }}-${{ matrix.config }}
|
name: dll-win-${{ matrix.config }}
|
||||||
path: dist/**
|
path: dll-bundle/**
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
|
if: ${{ false }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -79,12 +77,12 @@ jobs:
|
|||||||
config: [x86-ansi, x86-unicode, x64-unicode]
|
config: [x86-ansi, x86-unicode, x64-unicode]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
|
|
||||||
@@ -98,30 +96,7 @@ jobs:
|
|||||||
g++-mingw-w64-i686 \
|
g++-mingw-w64-i686 \
|
||||||
g++-mingw-w64-x86-64
|
g++-mingw-w64-x86-64
|
||||||
|
|
||||||
- name: Read VERSION
|
|
||||||
id: version_linux
|
|
||||||
run: |
|
|
||||||
v="$(tr -d '\r\n' < VERSION)"
|
|
||||||
echo "version=$v" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Build ${{ matrix.config }} on Linux
|
- name: Build ${{ matrix.config }} on Linux
|
||||||
run: python build_plugin.py --host linux --configs ${{ matrix.config }} --verbose
|
run: python build_plugin.py --host linux --configs ${{ matrix.config }} --verbose
|
||||||
|
|
||||||
- name: Collect DLL
|
|
||||||
run: |
|
|
||||||
case "${{ matrix.config }}" in
|
|
||||||
x86-ansi) dir="x86-ansi" ;;
|
|
||||||
x86-unicode) dir="x86-unicode" ;;
|
|
||||||
x64-unicode) dir="amd64-unicode" ;;
|
|
||||||
esac
|
|
||||||
dst="dist/${{ matrix.config }}"
|
|
||||||
mkdir -p "$dst"
|
|
||||||
cp "plugins/$dir/nsis7z.dll" "$dst/"
|
|
||||||
|
|
||||||
- name: Upload DLL
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ github.event.repository.name }}-${{ steps.version_linux.outputs.version }}-${{ matrix.config }}-linux
|
|
||||||
path: dist/**
|
|
||||||
if-no-files-found: error
|
|
||||||
retention-days: 30
|
|
||||||
|
|||||||
+241
-63
@@ -1,18 +1,27 @@
|
|||||||
# Release (GitHub) — pipeline release primaria
|
# Release (GitHub) — pipeline release primaria
|
||||||
#
|
#
|
||||||
# Triggerata quando un tag v* viene propagato dal mirror Gitea.
|
# Strategia hosting:
|
||||||
# Costruisce gli artifact per tutte le architetture e crea la GitHub Release.
|
# - Repo primario su Gitea (push iniziale)
|
||||||
|
# - Push mirror automatico Gitea -> GitHub
|
||||||
|
# - GitHub esegue TUTTA la CI (Gitea non esegue Actions)
|
||||||
|
#
|
||||||
|
# Trigger:
|
||||||
|
# - push di un tag v* (propagato dal mirror Gitea)
|
||||||
|
#
|
||||||
|
# - run manuale via UI (con input 'tag')
|
||||||
|
|
||||||
name: Release
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: ['v*']
|
tags:
|
||||||
|
- 'v*'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: 'Tag versione (es. v1.7.0)'
|
description: 'Tag versione (es. v1.7.0)'
|
||||||
required: true
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -21,65 +30,57 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
config: [x86-ansi, x86-unicode, x64-unicode]
|
config: [x86-ansi, x86-unicode, x64-unicode]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
|
|
||||||
- uses: microsoft/setup-msbuild@v2
|
- name: Setup MSBuild
|
||||||
|
uses: microsoft/setup-msbuild@v3
|
||||||
|
|
||||||
- name: Build ${{ matrix.config }}
|
- name: Build ${{ matrix.config }}
|
||||||
run: python build_plugin.py --config ${{ matrix.config }}
|
run: python build_plugin.py --configs ${{ matrix.config }} --verbosity normal
|
||||||
|
|
||||||
- name: Determine version & arch
|
- name: Collect DLL
|
||||||
id: meta
|
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$tag = "${{ github.ref_name }}"
|
|
||||||
if ([string]::IsNullOrEmpty($tag) -or $tag -eq "main") { $tag = "${{ inputs.tag }}" }
|
|
||||||
$v = $tag -replace '^v',''
|
|
||||||
$map = @{ 'x86-ansi' = 'x86-ansi'; 'x86-unicode' = 'x86-unicode'; 'x64-unicode' = 'amd64-unicode' }
|
$map = @{ 'x86-ansi' = 'x86-ansi'; 'x86-unicode' = 'x86-unicode'; 'x64-unicode' = 'amd64-unicode' }
|
||||||
$dir = $map['${{ matrix.config }}']
|
$dir = $map['${{ matrix.config }}']
|
||||||
echo "version=$v" >> $env:GITHUB_OUTPUT
|
$src = "plugins\$dir\nsis7z.dll"
|
||||||
echo "tag=$tag" >> $env:GITHUB_OUTPUT
|
$dst = "dll-bundle\$dir"
|
||||||
echo "dir=$dir" >> $env:GITHUB_OUTPUT
|
New-Item -ItemType Directory -Force -Path $dst | Out-Null
|
||||||
|
Copy-Item $src $dst
|
||||||
|
|
||||||
- name: Package
|
- name: Upload DLL
|
||||||
shell: pwsh
|
uses: actions/upload-artifact@v7
|
||||||
run: |
|
|
||||||
$name = "${{ github.event.repository.name }}-${{ steps.meta.outputs.version }}-${{ steps.meta.outputs.dir }}"
|
|
||||||
$stage = "stage/$name"
|
|
||||||
New-Item -ItemType Directory -Force -Path $stage | Out-Null
|
|
||||||
Copy-Item "dist/${{ steps.meta.outputs.dir }}/*" $stage -Recurse
|
|
||||||
Copy-Item README.md, LICENSE, VERSION, CHANGELOG.md $stage
|
|
||||||
if (Test-Path "include") { Copy-Item "include" $stage -Recurse }
|
|
||||||
if (Test-Path "examples") { Copy-Item "examples" $stage -Recurse }
|
|
||||||
Compress-Archive -Path "$stage/*" -DestinationPath "$name.zip" -Force
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: pkg-${{ matrix.config }}
|
name: dll-win-${{ matrix.config }}
|
||||||
path: '*.zip'
|
path: dll-bundle/**
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
config: [x86-ansi, x86-unicode, x64-unicode]
|
config: [x86-ansi, x86-unicode, x64-unicode]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
|
|
||||||
@@ -94,51 +95,228 @@ jobs:
|
|||||||
g++-mingw-w64-x86-64
|
g++-mingw-w64-x86-64
|
||||||
|
|
||||||
- name: Build ${{ matrix.config }} on Linux
|
- name: Build ${{ matrix.config }} on Linux
|
||||||
run: python build_plugin.py --host linux --configs ${{ matrix.config }}
|
run: python build_plugin.py --host linux --configs ${{ matrix.config }} --verbose
|
||||||
|
|
||||||
- name: Collect DLL
|
|
||||||
run: |
|
|
||||||
case "${{ matrix.config }}" in
|
|
||||||
x86-ansi) dir="x86-ansi" ;;
|
|
||||||
x86-unicode) dir="x86-unicode" ;;
|
|
||||||
x64-unicode) dir="amd64-unicode" ;;
|
|
||||||
esac
|
|
||||||
dst="dist/${{ matrix.config }}"
|
|
||||||
mkdir -p "$dst"
|
|
||||||
cp "plugins/$dir/nsis7z.dll" "$dst/"
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: linux-build-${{ matrix.config }}
|
|
||||||
path: dist/**
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
needs: [build, build-linux]
|
needs: [build, build-linux]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- name: Resolve release tag
|
||||||
|
id: tag
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
tag="${{ github.ref_name }}"
|
||||||
|
if [ -z "$tag" ] || [ "$tag" = "main" ]; then
|
||||||
|
tag="${{ inputs.tag }}"
|
||||||
|
fi
|
||||||
|
if [ -z "$tag" ]; then
|
||||||
|
echo "Tag non disponibile. Imposta l'input 'tag' (es. v2.2.1)." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
case "$tag" in
|
||||||
|
v*) ;;
|
||||||
|
*) tag="v$tag" ;;
|
||||||
|
esac
|
||||||
|
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Download DLL artifacts
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
path: artifacts
|
path: dll-bundle
|
||||||
|
pattern: dll-win-*
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
|
- name: Extract changelog section
|
||||||
|
run: |
|
||||||
|
tag="${{ steps.tag.outputs.tag }}"
|
||||||
|
version="${tag#v}"
|
||||||
|
awk -v ver="[$version]" '
|
||||||
|
/^## / && index($0, ver) { found=1; next }
|
||||||
|
found && /^## / { exit }
|
||||||
|
found { print }
|
||||||
|
' CHANGELOG.md > release_body.md echo "" >> release_body.md
|
||||||
|
echo "--" >> release_body.md
|
||||||
|
|
||||||
|
- name: Package plugins ZIP
|
||||||
|
id: pkg
|
||||||
|
run: |
|
||||||
|
tag="${{ steps.tag.outputs.tag }}"
|
||||||
|
version="${tag#v}"
|
||||||
|
zip_name="${{ github.event.repository.name }}-${version}-bundle.zip"
|
||||||
|
(cd dll-bundle && zip -r "../$zip_name" .)
|
||||||
|
echo "zip_name=$zip_name" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: SHA256SUMS
|
- name: SHA256SUMS
|
||||||
run: |
|
run: |
|
||||||
cd artifacts
|
sha256sum "${{ steps.pkg.outputs.zip_name }}" > SHA256SUMS.txt
|
||||||
sha256sum *.zip > SHA256SUMS.txt
|
|
||||||
cat SHA256SUMS.txt
|
cat SHA256SUMS.txt
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v3
|
||||||
with:
|
with:
|
||||||
|
tag_name: ${{ steps.tag.outputs.tag }}
|
||||||
|
name: ${{ steps.tag.outputs.tag }}
|
||||||
files: |
|
files: |
|
||||||
artifacts/*.zip
|
${{ steps.pkg.outputs.zip_name }}
|
||||||
artifacts/SHA256SUMS.txt
|
SHA256SUMS.txt
|
||||||
generate_release_notes: true
|
body_path: release_body.md
|
||||||
body: |
|
|
||||||
**Repository primario**: vedi link Gitea nel README.
|
- name: Update Gitea Release and upload assets
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
GITEA_TAG: ${{ steps.tag.outputs.tag }}
|
||||||
|
ZIP_NAME: ${{ steps.pkg.outputs.zip_name }}
|
||||||
|
run: |
|
||||||
|
python3 - <<'PY'
|
||||||
|
import json
|
||||||
|
import mimetypes
|
||||||
|
import os
|
||||||
|
import urllib.error
|
||||||
|
import urllib.request
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
base = "https://gitea.emulab.it/api/v1"
|
||||||
|
repo = "Simone/nsis-plugin-ns7zip"
|
||||||
|
tag = os.environ.get("GITEA_TAG", "").strip()
|
||||||
|
token = os.environ.get("GITEA_TOKEN", "").strip()
|
||||||
|
zip_name = os.environ.get("ZIP_NAME", "").strip()
|
||||||
|
|
||||||
|
if not tag:
|
||||||
|
raise SystemExit("Tag non disponibile: imposta input 'tag' in workflow_dispatch")
|
||||||
|
if not token:
|
||||||
|
raise SystemExit("GITEA_TOKEN is missing or empty")
|
||||||
|
|
||||||
|
with open("release_body.md", "r", encoding="utf-8") as f:
|
||||||
|
body = f.read()
|
||||||
|
|
||||||
|
def request(method, path, payload=None, auth_scheme="token"):
|
||||||
|
data = json.dumps(payload).encode("utf-8") if payload is not None else None
|
||||||
|
req = urllib.request.Request(
|
||||||
|
f"{base}{path}",
|
||||||
|
data=data,
|
||||||
|
method=method,
|
||||||
|
headers={
|
||||||
|
"Authorization": f"{auth_scheme} {token}",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"User-Agent": "GitHubActions-GiteaReleaseSync/1.0",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
with urllib.request.urlopen(req) as resp:
|
||||||
|
raw = resp.read()
|
||||||
|
return json.loads(raw) if raw else {}
|
||||||
|
|
||||||
|
def upload_asset(rid, path, auth_scheme):
|
||||||
|
p = Path(path)
|
||||||
|
mime = mimetypes.guess_type(p.name)[0] or "application/octet-stream"
|
||||||
|
data = p.read_bytes()
|
||||||
|
boundary = "----FormBoundary7MA4YWxkTrZu0gW"
|
||||||
|
body_parts = (
|
||||||
|
f"--{boundary}\r\n"
|
||||||
|
f'Content-Disposition: form-data; name="attachment"; filename="{p.name}"\r\n'
|
||||||
|
f"Content-Type: {mime}\r\n\r\n"
|
||||||
|
).encode() + data + f"\r\n--{boundary}--\r\n".encode()
|
||||||
|
req = urllib.request.Request(
|
||||||
|
f"{base}/repos/{repo}/releases/{rid}/assets?name={p.name}",
|
||||||
|
data=body_parts,
|
||||||
|
method="POST",
|
||||||
|
headers={
|
||||||
|
"Authorization": f"{auth_scheme} {token}",
|
||||||
|
"Content-Type": f"multipart/form-data; boundary={boundary}",
|
||||||
|
"User-Agent": "GitHubActions-GiteaReleaseSync/1.0",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
with urllib.request.urlopen(req) as resp:
|
||||||
|
raw = resp.read()
|
||||||
|
return json.loads(raw) if raw else {}
|
||||||
|
|
||||||
|
auth_scheme = None
|
||||||
|
last_error = None
|
||||||
|
for scheme in ("token", "Bearer"):
|
||||||
|
try:
|
||||||
|
user = request("GET", "/user", auth_scheme=scheme)
|
||||||
|
auth_scheme = scheme
|
||||||
|
print(f"Gitea auth OK via '{scheme}' as user: {user.get('login', '<unknown>')}")
|
||||||
|
break
|
||||||
|
except urllib.error.HTTPError as e:
|
||||||
|
try:
|
||||||
|
details = e.read().decode("utf-8", errors="replace")
|
||||||
|
except Exception:
|
||||||
|
details = ""
|
||||||
|
last_error = f"HTTP {e.code} {e.reason} ({scheme}) {details}".strip()
|
||||||
|
|
||||||
|
if not auth_scheme:
|
||||||
|
raise SystemExit(
|
||||||
|
"Gitea authentication failed for both 'token' and 'Bearer'. "
|
||||||
|
"Check secret GITEA_TOKEN value and permissions (Repository Read+Write). "
|
||||||
|
f"Last error: {last_error}"
|
||||||
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
|
release = request("GET", f"/repos/{repo}/releases/tags/{tag}", auth_scheme=auth_scheme)
|
||||||
|
rid = release["id"]
|
||||||
|
request("PATCH", f"/repos/{repo}/releases/{rid}", {"body": body}, auth_scheme=auth_scheme)
|
||||||
|
print(f"Updated existing Gitea release id={rid} for tag {tag}")
|
||||||
|
except urllib.error.HTTPError as e:
|
||||||
|
if e.code != 404:
|
||||||
|
try:
|
||||||
|
details = e.read().decode("utf-8", errors="replace")
|
||||||
|
except Exception:
|
||||||
|
details = ""
|
||||||
|
raise SystemExit(f"Gitea release lookup/update failed: HTTP {e.code} {e.reason}. {details}".strip())
|
||||||
|
|
||||||
|
created = request(
|
||||||
|
"POST",
|
||||||
|
f"/repos/{repo}/releases",
|
||||||
|
{
|
||||||
|
"tag_name": tag,
|
||||||
|
"name": tag,
|
||||||
|
"body": body,
|
||||||
|
"draft": False,
|
||||||
|
"prerelease": False,
|
||||||
|
},
|
||||||
|
auth_scheme=auth_scheme,
|
||||||
|
)
|
||||||
|
rid = created["id"]
|
||||||
|
print(f"Created Gitea release id={rid} for tag {tag}")
|
||||||
|
|
||||||
|
# Rimuovi asset giĂ presenti con lo stesso nome (retag idempotente)
|
||||||
|
existing = request("GET", f"/repos/{repo}/releases/{rid}/assets", auth_scheme=auth_scheme)
|
||||||
|
upload_names = {zip_name, "SHA256SUMS.txt"}
|
||||||
|
for asset in existing:
|
||||||
|
if asset["name"] in upload_names:
|
||||||
|
request("DELETE", f"/repos/{repo}/releases/{rid}/assets/{asset['id']}", auth_scheme=auth_scheme)
|
||||||
|
print(f"Deleted existing asset: {asset['name']}")
|
||||||
|
|
||||||
|
# Carica ZIP e SHA256SUMS
|
||||||
|
for f in [zip_name, "SHA256SUMS.txt"]:
|
||||||
|
if Path(f).exists():
|
||||||
|
result = upload_asset(rid, f, auth_scheme)
|
||||||
|
print(f"Uploaded {f} -> {result.get('browser_download_url', result.get('id'))}")
|
||||||
|
else:
|
||||||
|
print(f"WARNING: {f} not found, skipping upload")
|
||||||
|
PY
|
||||||
|
|
||||||
|
- name: Push back dist/ DLLs to Gitea
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
run: |
|
||||||
|
tag="${{ steps.tag.outputs.tag }}"
|
||||||
|
# Copia le DLL compilate in dist/
|
||||||
|
for dir in amd64-unicode x86-ansi x86-unicode; do
|
||||||
|
mkdir -p "dist/$dir"
|
||||||
|
cp "dll-bundle/$dir/nsis7z.dll" "dist/$dir/nsis7z.dll"
|
||||||
|
done
|
||||||
|
# Configura git con le credenziali Gitea
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git remote add gitea "https://x-token:${GITEA_TOKEN}@gitea.emulab.it/Simone/nsis-plugin-ns7zip.git"
|
||||||
|
git add dist/
|
||||||
|
git diff --cached --quiet || git commit -m "chore: update dist/ DLLs for ${tag}"
|
||||||
|
git push gitea HEAD:main
|
||||||
|
|
||||||
Il mirror GitHub è generato automaticamente dal repo Gitea (sorgente di verità ).
|
|
||||||
Per issue e PR aprire ticket sul repository primario Gitea.
|
|
||||||
|
|||||||
+29
@@ -64,3 +64,32 @@ tools/check_*.py
|
|||||||
# Plugin-specific
|
# Plugin-specific
|
||||||
versions/*/CPP/7zip/*/Release/
|
versions/*/CPP/7zip/*/Release/
|
||||||
versions/*/CPP/7zip/*/x64/
|
versions/*/CPP/7zip/*/x64/
|
||||||
|
_linux_build/
|
||||||
|
|
||||||
|
# Symlinks auto-generated by tools/linux/setup_bundle_symlinks.py at build
|
||||||
|
# time (Linux-only, not committed to git; recreated on-the-fly as needed).
|
||||||
|
versions/*-bundle/C
|
||||||
|
versions/*-bundle/Asm
|
||||||
|
versions/*-bundle/CPP/Build.mak
|
||||||
|
versions/*-bundle/CPP/Common
|
||||||
|
versions/*-bundle/CPP/Windows
|
||||||
|
versions/*-bundle/CPP/build*.cmd
|
||||||
|
versions/*-bundle/CPP/build*.sh
|
||||||
|
versions/*-bundle/CPP/7zip/*.mak
|
||||||
|
versions/*-bundle/CPP/7zip/*.rc
|
||||||
|
versions/*-bundle/CPP/7zip/*.h
|
||||||
|
versions/*-bundle/CPP/7zip/*.txt
|
||||||
|
versions/*-bundle/CPP/7zip/makefile
|
||||||
|
versions/*-bundle/CPP/7zip/Archive
|
||||||
|
versions/*-bundle/CPP/7zip/Common
|
||||||
|
versions/*-bundle/CPP/7zip/Compress
|
||||||
|
versions/*-bundle/CPP/7zip/Crypto
|
||||||
|
versions/*-bundle/CPP/7zip/UI/Agent
|
||||||
|
versions/*-bundle/CPP/7zip/UI/Client7z
|
||||||
|
versions/*-bundle/CPP/7zip/UI/Common
|
||||||
|
versions/*-bundle/CPP/7zip/UI/Console
|
||||||
|
versions/*-bundle/CPP/7zip/UI/Explorer
|
||||||
|
versions/*-bundle/CPP/7zip/UI/Far
|
||||||
|
versions/*-bundle/CPP/7zip/UI/FileManager
|
||||||
|
versions/*-bundle/CPP/7zip/UI/GUI
|
||||||
|
versions/*-bundle/CPP/7zip/UI/makefile
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
[submodule "versions/7-zip-zstd"]
|
[submodule "versions/7-zip-zstd"]
|
||||||
path = versions/7-zip-zstd
|
path = versions/7-zip-zstd
|
||||||
url = https://github.com/mcmilk/7-Zip-zstd.git
|
url = https://github.com/mcmilk/7-Zip-zstd.git
|
||||||
|
[submodule "versions/26.01"]
|
||||||
|
path = versions/26.01
|
||||||
|
url = https://github.com/ip7z/7zip.git
|
||||||
|
[submodule "versions/26.00"]
|
||||||
|
path = versions/26.00
|
||||||
|
url = https://github.com/ip7z/7zip.git
|
||||||
|
[submodule "versions/25.01"]
|
||||||
|
path = versions/25.01
|
||||||
|
url = https://github.com/ip7z/7zip.git
|
||||||
|
|||||||
+62
-1
@@ -7,6 +7,62 @@ e il progetto aderisce al [Semantic Versioning](https://semver.org/spec/v2.0.0.h
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [2.3.1] — 2026-05-05
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- `tools/update_github_releases.py`: one-shot script to sync GitHub Release bodies via API using local `tools/release-notes/` snippets
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Linux overlay shims (`tools/linux/overlay/include/`) now use `#include_next` instead of `#include` to forward to the real MinGW system header, avoiding infinite preprocessor recursion on Linux/WSL (GCC 12+)
|
||||||
|
- Removed stale prebuilt `plugins/*/nsis7z.dll` binaries from the repository
|
||||||
|
|
||||||
|
## [2.3.0] — 2026-05-03
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Auto-recreation of bundle POSIX symlinks on Linux if missing after a fresh clone (`_ensure_bundle_symlinks()` in `tools/linux/build_plugin_linux.py`)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Default 7-zip version changed from `26.00` to `26.01` in `build_plugin.py` and `tools/linux/build_plugin_linux.py`
|
||||||
|
- Renamed `versions/zstd` → `versions/zstd-bundle` for naming consistency with the other bundle directories
|
||||||
|
- Auto-generated bundle symlinks are now excluded from git tracking (`.gitignore`)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Windows build error `C1083: Cannot open include file` for `Common/Common.h`, `IPassword.h`, `C/Alloc.h` and other vendor headers: added `versions/VER/CPP/7zip/UI/Common/` to `AdditionalIncludeDirectories` in all five bundle vcxproj files (25.01, 26.00, 26.01)
|
||||||
|
- f-string nested-quote syntax errors in all `tools/legacy/` build scripts (patterns `{"="*60}`, `{"-"*50}`, `{'Rebuild' if ...}`): replaced with Python 3.10/3.11-compatible equivalents
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- One-shot `tools/fix_bundle_vcxproj_paths.py` helper (no longer needed)
|
||||||
|
|
||||||
|
## [2.2.2] — 2026-05-02
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- `tools/update_gitea_releases.py`: one-shot script to backfill Gitea release bodies with CHANGELOG content via the Gitea API
|
||||||
|
- `tools/release-notes/`: per-version Markdown snippets used by the backfill script
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Release workflow now extracts the relevant CHANGELOG section and uses it as the GitHub Release body (`body_path`)
|
||||||
|
- Release workflow adds a step to update the corresponding Gitea release body via API (`GITEA_TOKEN` secret)
|
||||||
|
- All GitHub Actions upgraded to node24-native major versions (no more Node 20 deprecation warnings)
|
||||||
|
|
||||||
|
## [2.2.1] — 2026-05-02
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Linux CI jobs for the GitHub `build` and `release` workflows using the MinGW-w64 cross-build path
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- GitHub Actions workflows now opt into Node 24 for JavaScript-based actions to avoid Node 20 deprecation warnings
|
||||||
|
|
||||||
|
## [2.2.0] — 2026-05-02
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Linux MinGW-w64 cross-build support in `build_plugin.py` via `--host linux`
|
||||||
|
- `tools/linux/build_plugin_linux.py` for standalone Linux builds
|
||||||
|
- Color output and progress spinner in all legacy build scripts
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- `build_plugin.py` now supports both Windows (MSBuild) and Linux (MinGW-w64) targets
|
||||||
|
- Windows build-script f-string fixes
|
||||||
|
|
||||||
## [2.1.0] — 2026-04-30
|
## [2.1.0] — 2026-04-30
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -36,7 +92,12 @@ e il progetto aderisce al [Semantic Versioning](https://semver.org/spec/v2.0.0.h
|
|||||||
- CI/CD via GitHub Actions (mirror automatico Gitea → GitHub)
|
- CI/CD via GitHub Actions (mirror automatico Gitea → GitHub)
|
||||||
- Documentazione completa (README, CONTRIBUTING, SECURITY)
|
- Documentazione completa (README, CONTRIBUTING, SECURITY)
|
||||||
|
|
||||||
[Unreleased]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.1.0...HEAD
|
[Unreleased]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.3.1...HEAD
|
||||||
|
[2.3.1]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.3.0...v2.3.1
|
||||||
|
[2.3.0]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.2.2...v2.3.0
|
||||||
|
[2.2.2]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.2.1...v2.2.2
|
||||||
|
[2.2.1]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.2.0...v2.2.1
|
||||||
|
[2.2.0]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.1.0...v2.2.0
|
||||||
[2.1.0]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.0.1...v2.1.0
|
[2.1.0]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.0.1...v2.1.0
|
||||||
[2.0.1]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.0.0...v2.0.1
|
[2.0.1]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/compare/v2.0.0...v2.0.1
|
||||||
[2.0.0]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/releases/tag/v2.0.0
|
[2.0.0]: https://gitea.emulab.it/Simone/nsis-plugin-ns7zip/releases/tag/v2.0.0
|
||||||
|
|||||||
@@ -75,14 +75,32 @@ Linux notes:
|
|||||||
## Repository Structure
|
## Repository Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
ns7zip/
|
nsis-plugin-ns7zip/
|
||||||
├── build_plugin.py # Unified build script (all versions)
|
├── build_plugin.py # Unified build script (all versions)
|
||||||
|
├── build_zstd.cmd # Build script for 7-zip-zstd variant
|
||||||
├── rebuild_nsis7z1900-src.ps1 # Rebuilds 19.00 sources
|
├── rebuild_nsis7z1900-src.ps1 # Rebuilds 19.00 sources
|
||||||
├── 7zip-19.00/ # 7-Zip 19.00 modified
|
├── versions/
|
||||||
├── 7zip-25.01/ # 7-Zip 25.01 modified (ZIP + NSIS handler)
|
│ ├── 19.00/ # 7-Zip 19.00 modified
|
||||||
└── 7zip-26.00/ # 7-Zip 26.00 modified (ZIP + NSIS handler)
|
│ ├── 25.01/ # 7-Zip 25.01 modified (ZIP + NSIS handler)
|
||||||
|
│ ├── 26.00/ # 7-Zip 26.00 modified (ZIP + NSIS handler)
|
||||||
|
│ └── 7-zip-zstd/ # 7-Zip zstd fork (submodule)
|
||||||
|
├── plugins/ # Compiled DLLs output
|
||||||
|
├── tools/
|
||||||
|
│ ├── fix_vcxproj.py # Project file patcher
|
||||||
|
│ ├── update_gitea_releases.py # Backfill Gitea release bodies (one-shot)
|
||||||
|
│ ├── release-notes/ # Per-version Markdown snippets
|
||||||
|
│ ├── linux/ # Linux-specific build helpers
|
||||||
|
│ └── legacy/ # Old per-version build scripts
|
||||||
|
└── .github/workflows/
|
||||||
|
├── build.yml # CI: Windows + Linux matrix build
|
||||||
|
└── release.yml # Release: build artifacts + publish to GitHub & Gitea
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## CI / Release Workflow
|
||||||
|
|
||||||
|
- **build.yml** — runs on every push/PR; builds all three configs on Windows (MSBuild) and Linux (MinGW-w64) in parallel.
|
||||||
|
- **release.yml** — triggered by a `v*` tag push; builds and packages artifacts, creates a GitHub Release with the relevant CHANGELOG section as body, and updates the corresponding Gitea release body via API (`GITEA_TOKEN` secret required).
|
||||||
|
|
||||||
## Changes from Original
|
## Changes from Original
|
||||||
|
|
||||||
### NSIS Archive Handler (25.01, 26.00)
|
### NSIS Archive Handler (25.01, 26.00)
|
||||||
|
|||||||
+33
-4
@@ -61,21 +61,46 @@ python build_plugin.py --7zip-version 25.01
|
|||||||
# Toolset specifico (2022|2026|auto)
|
# Toolset specifico (2022|2026|auto)
|
||||||
python build_plugin.py --toolset 2022
|
python build_plugin.py --toolset 2022
|
||||||
|
|
||||||
|
# Path Linux (cross-build con MinGW-w64, 26.00)
|
||||||
|
python build_plugin.py --host linux
|
||||||
|
|
||||||
# Stampa versione ed esce
|
# Stampa versione ed esce
|
||||||
python build_plugin.py --version
|
python build_plugin.py --version
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note Linux:
|
||||||
|
- Il path Linux locale supporta attualmente `--7zip-version 26.00`.
|
||||||
|
- Richiede toolchain MinGW-w64 (`x86_64-w64-mingw32-*` e `i686-w64-mingw32-*`) e `make`.
|
||||||
|
|
||||||
## Struttura Repository
|
## Struttura Repository
|
||||||
|
|
||||||
```
|
```
|
||||||
ns7zip/
|
nsis-plugin-ns7zip/
|
||||||
├── build_plugin.py # Script di build unificato (tutte le versioni)
|
├── build_plugin.py # Script di build unificato (tutte le versioni)
|
||||||
|
├── build_zstd.cmd # Script di build per la variante 7-zip-zstd
|
||||||
├── rebuild_nsis7z1900-src.ps1 # Ricostruisce sorgenti 19.00
|
├── rebuild_nsis7z1900-src.ps1 # Ricostruisce sorgenti 19.00
|
||||||
├── 7zip-19.00/ # 7-Zip 19.00 modificato
|
├── versions/
|
||||||
├── 7zip-25.01/ # 7-Zip 25.01 modificato (ZIP + NSIS handler)
|
│ ├── 19.00/ # 7-Zip 19.00 modificato
|
||||||
└── 7zip-26.00/ # 7-Zip 26.00 modificato (ZIP + NSIS handler)
|
│ ├── 25.01/ # 7-Zip 25.01 modificato (ZIP + NSIS handler)
|
||||||
|
│ ├── 26.00/ # 7-Zip 26.00 modificato (ZIP + NSIS handler)
|
||||||
|
│ └── 7-zip-zstd/ # Fork 7-Zip zstd (submodule)
|
||||||
|
├── plugins/ # DLL compilate
|
||||||
|
├── tools/
|
||||||
|
│ ├── fix_vcxproj.py # Patcher file di progetto
|
||||||
|
│ ├── update_gitea_releases.py # Backfill body release Gitea (one-shot)
|
||||||
|
│ ├── release-notes/ # Snippet Markdown per versione
|
||||||
|
│ ├── linux/ # Helper build Linux
|
||||||
|
│ └── legacy/ # Script di build legacy per-versione
|
||||||
|
└── .github/workflows/
|
||||||
|
├── build.yml # CI: build matrix Windows + Linux
|
||||||
|
└── release.yml # Release: build artifact + pubblicazione su GitHub e Gitea
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## CI / Workflow di Release
|
||||||
|
|
||||||
|
- **build.yml** — eseguito ad ogni push/PR; compila le tre configurazioni su Windows (MSBuild) e Linux (MinGW-w64) in parallelo.
|
||||||
|
- **release.yml** — triggerato dal push di un tag `v*`; compila e pacchettizza gli artifact, crea la GitHub Release con la sezione CHANGELOG come body, e aggiorna il body della corrispondente release Gitea via API (richiede il secret `GITEA_TOKEN`).
|
||||||
|
|
||||||
## Modifiche rispetto all'originale
|
## Modifiche rispetto all'originale
|
||||||
|
|
||||||
### NSIS Archive Handler (25.01, 26.00)
|
### NSIS Archive Handler (25.01, 26.00)
|
||||||
@@ -101,3 +126,7 @@ Aggiunto supporto per estrarre archivi `.exe` creati con NSIS (non presente nel
|
|||||||
- Igor Pavlov (7-Zip)
|
- Igor Pavlov (7-Zip)
|
||||||
- Afrow UK (Plugin originale)
|
- Afrow UK (Plugin originale)
|
||||||
- Simone (Supporto x64, VS2022/VS2026, ZIP, NSIS handler, ExtractWithFileCallback)
|
- Simone (Supporto x64, VS2022/VS2026, ZIP, NSIS handler, ExtractWithFileCallback)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*Vedi [README.md](README.md) per la versione in inglese.*
|
||||||
|
|||||||
+13
-1
@@ -23,17 +23,20 @@ WINDOWS_SCRIPTS = {
|
|||||||
"2026": "tools/legacy/build_plugin_2501_vs2026.py"},
|
"2026": "tools/legacy/build_plugin_2501_vs2026.py"},
|
||||||
"26.00": {"2022": None,
|
"26.00": {"2022": None,
|
||||||
"2026": "tools/legacy/build_plugin_2600_vs2026.py"},
|
"2026": "tools/legacy/build_plugin_2600_vs2026.py"},
|
||||||
|
"26.01": {"2022": None,
|
||||||
|
"2026": "tools/legacy/build_plugin_2601_vs2026.py"},
|
||||||
"zstd": {"2022": None,
|
"zstd": {"2022": None,
|
||||||
"2026": "tools/legacy/build_plugin_zstd_vs2026.py"},
|
"2026": "tools/legacy/build_plugin_zstd_vs2026.py"},
|
||||||
}
|
}
|
||||||
|
|
||||||
LINUX_SCRIPT = "tools/linux/build_plugin_linux.py"
|
LINUX_SCRIPT = "tools/linux/build_plugin_linux.py"
|
||||||
|
LINUX_SUPPORTED_7ZIP = {"25.01", "26.00", "26.01", "zstd"}
|
||||||
|
|
||||||
|
|
||||||
def main() -> int:
|
def main() -> int:
|
||||||
parser = argparse.ArgumentParser(description="Build nsis7z NSIS plugin")
|
parser = argparse.ArgumentParser(description="Build nsis7z NSIS plugin")
|
||||||
parser.add_argument("--7zip-version", dest="zip_version",
|
parser.add_argument("--7zip-version", dest="zip_version",
|
||||||
choices=["19.00", "25.01", "26.00", "zstd"], default="26.00",
|
choices=["19.00", "25.01", "26.00", "26.01", "zstd"], default="26.01",
|
||||||
help="7-Zip version to build (default: 26.00); "
|
help="7-Zip version to build (default: 26.00); "
|
||||||
"'zstd' uses mcmilk/7-Zip-zstd submodule")
|
"'zstd' uses mcmilk/7-Zip-zstd submodule")
|
||||||
parser.add_argument("--toolset", choices=["2022", "2026", "auto"], default="auto",
|
parser.add_argument("--toolset", choices=["2022", "2026", "auto"], default="auto",
|
||||||
@@ -58,6 +61,15 @@ def main() -> int:
|
|||||||
host = "windows" if platform.system().lower().startswith("win") else "linux"
|
host = "windows" if platform.system().lower().startswith("win") else "linux"
|
||||||
|
|
||||||
if host == "linux":
|
if host == "linux":
|
||||||
|
if known.zip_version not in LINUX_SUPPORTED_7ZIP:
|
||||||
|
supported = ", ".join(sorted(LINUX_SUPPORTED_7ZIP))
|
||||||
|
print(
|
||||||
|
"ERROR: Linux local build does not support "
|
||||||
|
f"--7zip-version {known.zip_version}. "
|
||||||
|
f"Supported values: {supported}",
|
||||||
|
file=sys.stderr,
|
||||||
|
)
|
||||||
|
return 2
|
||||||
script = ROOT / LINUX_SCRIPT
|
script = ROOT / LINUX_SCRIPT
|
||||||
cmd = [sys.executable, str(script), "--7zip-version", known.zip_version] + rest
|
cmd = [sys.executable, str(script), "--7zip-version", known.zip_version] + rest
|
||||||
return subprocess.run(cmd).returncode
|
return subprocess.run(cmd).returncode
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -141,7 +141,9 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
str(_VSWHERE_PATH),
|
str(_VSWHERE_PATH),
|
||||||
'-version', _VS_VERSION_RANGE[ver],
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
'-latest',
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -182,7 +184,7 @@ def get_project_paths() -> Tuple[Path, Path, Path]:
|
|||||||
script_dir = Path(__file__).parent.resolve()
|
script_dir = Path(__file__).parent.resolve()
|
||||||
|
|
||||||
# Project directory containing 7-Zip 25.01 sources
|
# Project directory containing 7-Zip 25.01 sources
|
||||||
project_dir = script_dir.parent.parent / 'versions' / '25.01'
|
project_dir = script_dir.parent.parent / 'versions' / '25.01-bundle'
|
||||||
|
|
||||||
# Project file path
|
# Project file path
|
||||||
project_file = project_dir / 'CPP' / '7zip' / 'Bundles' / 'Nsis7z' / 'Nsis7z.vcxproj'
|
project_file = project_dir / 'CPP' / '7zip' / 'Bundles' / 'Nsis7z' / 'Nsis7z.vcxproj'
|
||||||
@@ -328,7 +330,7 @@ def build_configuration(
|
|||||||
cmd = [
|
cmd = [
|
||||||
str(msbuild_path),
|
str(msbuild_path),
|
||||||
str(project_file),
|
str(project_file),
|
||||||
f'/t:{"Rebuild" if rebuild else "Build"}',
|
'/t:' + ('Rebuild' if rebuild else 'Build'),
|
||||||
f'/p:Configuration={config.config}',
|
f'/p:Configuration={config.config}',
|
||||||
f'/p:Platform={config.platform}',
|
f'/p:Platform={config.platform}',
|
||||||
f'/p:OutDir=Build\\{config.name}\\',
|
f'/p:OutDir=Build\\{config.name}\\',
|
||||||
@@ -747,10 +749,15 @@ Examples:
|
|||||||
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead of <repo>/plugins/<config>')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Get project paths early for list-project
|
# Get project paths early for list-project
|
||||||
project_dir, project_file, plugins_dir = get_project_paths()
|
project_dir, project_file, plugins_dir = get_project_paths()
|
||||||
|
# --dist: redirect output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
# List project configurations
|
# List project configurations
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
@@ -789,9 +796,9 @@ Examples:
|
|||||||
configs_to_build = [CONFIGS[name] for name in args.configs]
|
configs_to_build = [CONFIGS[name] for name in args.configs]
|
||||||
|
|
||||||
# Print header
|
# Print header
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"="*60}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'='*60}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Building nsis7z plugin (7-Zip 25.01){Colors.RESET} - {Colors.BRIGHT_WHITE}{len(configs_to_build)}{Colors.RESET} configuration(s)")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Building nsis7z plugin (7-Zip 25.01){Colors.RESET} - {Colors.BRIGHT_WHITE}{len(configs_to_build)}{Colors.RESET} configuration(s)")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"="*60}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'='*60}{Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}Visual Studio:{Colors.RESET} {Colors.BRIGHT_WHITE}{vs_version_name} (toolset {platform_toolset}){Colors.RESET}")
|
print(f"{Colors.CYAN}Visual Studio:{Colors.RESET} {Colors.BRIGHT_WHITE}{vs_version_name} (toolset {platform_toolset}){Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}MSBuild:{Colors.RESET} {Colors.BRIGHT_WHITE}{msbuild_path}{Colors.RESET}")
|
print(f"{Colors.CYAN}MSBuild:{Colors.RESET} {Colors.BRIGHT_WHITE}{msbuild_path}{Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}Project:{Colors.RESET} {Colors.BRIGHT_WHITE}{project_file}{Colors.RESET}")
|
print(f"{Colors.CYAN}Project:{Colors.RESET} {Colors.BRIGHT_WHITE}{project_file}{Colors.RESET}")
|
||||||
@@ -895,9 +902,9 @@ Examples:
|
|||||||
all_success = all(success for _, success, _, _, _ in build_results)
|
all_success = all(success for _, success, _, _, _ in build_results)
|
||||||
|
|
||||||
if all_success:
|
if all_success:
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{'='*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}ALL BUILDS SUCCESSFUL!{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}ALL BUILDS SUCCESSFUL!{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{'='*50}{Colors.RESET}")
|
||||||
print("\nPlugins copied to:")
|
print("\nPlugins copied to:")
|
||||||
for config, _, build_time, file_size, dest_path in build_results:
|
for config, _, build_time, file_size, dest_path in build_results:
|
||||||
dest = dest_path if dest_path else plugins_dir / config.dest_dir / 'nsis7z.dll'
|
dest = dest_path if dest_path else plugins_dir / config.dest_dir / 'nsis7z.dll'
|
||||||
@@ -908,23 +915,23 @@ Examples:
|
|||||||
print()
|
print()
|
||||||
clean_build_artifacts(project_dir, configs_to_build)
|
clean_build_artifacts(project_dir, configs_to_build)
|
||||||
else:
|
else:
|
||||||
print(f"{Colors.BOLD}{Colors.RED}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}{'='*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.RED}SOME BUILDS FAILED!{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}SOME BUILDS FAILED!{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.RED}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}{'='*50}{Colors.RESET}")
|
||||||
print("\nFailed configurations:")
|
print("\nFailed configurations:")
|
||||||
for config, success, build_time, file_size, dest_path in build_results:
|
for config, success, build_time, file_size, dest_path in build_results:
|
||||||
if not success:
|
if not success:
|
||||||
print(f" - {config.name}")
|
print(f" - {config.name}")
|
||||||
|
|
||||||
# Show timing summary
|
# Show timing summary
|
||||||
print(f"\n{Colors.BOLD}{Colors.BRIGHT_CYAN}{"-"*50}{Colors.RESET}")
|
print(f"\n{Colors.BOLD}{Colors.BRIGHT_CYAN}{'-'*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Build Summary:{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Build Summary:{Colors.RESET}")
|
||||||
for config, success, build_time, file_size, dest_path in build_results:
|
for config, success, build_time, file_size, dest_path in build_results:
|
||||||
status = "OK" if success else "FAIL"
|
status = "OK" if success else "FAIL"
|
||||||
row_color = Colors.BRIGHT_GREEN if success else Colors.RED
|
row_color = Colors.BRIGHT_GREEN if success else Colors.RED
|
||||||
size_str = f"{file_size:,} bytes" if file_size > 0 else "N/A"
|
size_str = f"{file_size:,} bytes" if file_size > 0 else "N/A"
|
||||||
print(f" {row_color}{status}{Colors.RESET} {config.name:15s} - {format_time(build_time):8s} - {size_str}")
|
print(f" {row_color}{status}{Colors.RESET} {config.name:15s} - {format_time(build_time):8s} - {size_str}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"-"*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'-'*50}{Colors.RESET}")
|
||||||
print(f"Total time: {Colors.BRIGHT_WHITE}{format_time(total_time)}{Colors.RESET}")
|
print(f"Total time: {Colors.BRIGHT_WHITE}{format_time(total_time)}{Colors.RESET}")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
|||||||
@@ -150,7 +150,9 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-products', '*',
|
'-products', '*',
|
||||||
'-version', _VS_VERSION_RANGE[ver],
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
'-latest',
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -200,7 +202,7 @@ def find_msbuild(vs_version: str = 'auto') -> 'Optional[Tuple[Path, str, str]]':
|
|||||||
def get_project_paths() -> Tuple[Path, Path, Path]:
|
def get_project_paths() -> Tuple[Path, Path, Path]:
|
||||||
"""Get project directory, project file, and plugins directory"""
|
"""Get project directory, project file, and plugins directory"""
|
||||||
script_dir = Path(__file__).parent.absolute()
|
script_dir = Path(__file__).parent.absolute()
|
||||||
project_dir = script_dir.parent.parent / 'versions' / '25.01'
|
project_dir = script_dir.parent.parent / 'versions' / '25.01-bundle'
|
||||||
project_file = project_dir / 'CPP' / '7zip' / 'Bundles' / 'Nsis7z' / 'Nsis7z_vs2026.vcxproj'
|
project_file = project_dir / 'CPP' / '7zip' / 'Bundles' / 'Nsis7z' / 'Nsis7z_vs2026.vcxproj'
|
||||||
plugins_dir = script_dir.parent.parent / 'plugins'
|
plugins_dir = script_dir.parent.parent / 'plugins'
|
||||||
|
|
||||||
@@ -344,7 +346,7 @@ def build_configuration(
|
|||||||
cmd = [
|
cmd = [
|
||||||
str(msbuild_path),
|
str(msbuild_path),
|
||||||
str(project_file),
|
str(project_file),
|
||||||
f'/t:{"Rebuild" if rebuild else "Build"}',
|
'/t:' + ('Rebuild' if rebuild else 'Build'),
|
||||||
f'/p:Configuration={config.config}',
|
f'/p:Configuration={config.config}',
|
||||||
f'/p:Platform={config.platform}',
|
f'/p:Platform={config.platform}',
|
||||||
f'/p:OutDir=Build\\{config.name}\\',
|
f'/p:OutDir=Build\\{config.name}\\',
|
||||||
@@ -763,10 +765,15 @@ Examples:
|
|||||||
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead of <repo>/plugins/<config>')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Get project paths early for list-project
|
# Get project paths early for list-project
|
||||||
project_dir, project_file, plugins_dir = get_project_paths()
|
project_dir, project_file, plugins_dir = get_project_paths()
|
||||||
|
# --dist: redirect output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
# List project configurations
|
# List project configurations
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
@@ -816,9 +823,9 @@ Examples:
|
|||||||
configs_to_build = [CONFIGS[name] for name in args.configs]
|
configs_to_build = [CONFIGS[name] for name in args.configs]
|
||||||
|
|
||||||
# Print header
|
# Print header
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"="*60}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'='*60}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Building nsis7z plugin (7-Zip 25.01, VS2026){Colors.RESET} - {Colors.BRIGHT_WHITE}{len(configs_to_build)}{Colors.RESET} configuration(s)")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Building nsis7z plugin (7-Zip 25.01, VS2026){Colors.RESET} - {Colors.BRIGHT_WHITE}{len(configs_to_build)}{Colors.RESET} configuration(s)")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"="*60}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'='*60}{Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}Visual Studio:{Colors.RESET} {Colors.BRIGHT_WHITE}{vs_version_name} (toolset {platform_toolset}){Colors.RESET}")
|
print(f"{Colors.CYAN}Visual Studio:{Colors.RESET} {Colors.BRIGHT_WHITE}{vs_version_name} (toolset {platform_toolset}){Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}MSBuild:{Colors.RESET} {Colors.BRIGHT_WHITE}{msbuild_path}{Colors.RESET}")
|
print(f"{Colors.CYAN}MSBuild:{Colors.RESET} {Colors.BRIGHT_WHITE}{msbuild_path}{Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}Project:{Colors.RESET} {Colors.BRIGHT_WHITE}{project_file}{Colors.RESET}")
|
print(f"{Colors.CYAN}Project:{Colors.RESET} {Colors.BRIGHT_WHITE}{project_file}{Colors.RESET}")
|
||||||
@@ -922,9 +929,9 @@ Examples:
|
|||||||
all_success = all(success for _, success, _, _, _ in build_results)
|
all_success = all(success for _, success, _, _, _ in build_results)
|
||||||
|
|
||||||
if all_success:
|
if all_success:
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{'='*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}ALL BUILDS SUCCESSFUL!{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}ALL BUILDS SUCCESSFUL!{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{'='*50}{Colors.RESET}")
|
||||||
print("\nPlugins copied to:")
|
print("\nPlugins copied to:")
|
||||||
for config, _, build_time, file_size, dest_path in build_results:
|
for config, _, build_time, file_size, dest_path in build_results:
|
||||||
dest = dest_path if dest_path else plugins_dir / config.dest_dir / 'nsis7z.dll'
|
dest = dest_path if dest_path else plugins_dir / config.dest_dir / 'nsis7z.dll'
|
||||||
@@ -935,23 +942,23 @@ Examples:
|
|||||||
print()
|
print()
|
||||||
clean_build_artifacts(project_dir, configs_to_build)
|
clean_build_artifacts(project_dir, configs_to_build)
|
||||||
else:
|
else:
|
||||||
print(f"{Colors.BOLD}{Colors.RED}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}{'='*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.RED}SOME BUILDS FAILED!{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}SOME BUILDS FAILED!{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.RED}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}{'='*50}{Colors.RESET}")
|
||||||
print("\nFailed configurations:")
|
print("\nFailed configurations:")
|
||||||
for config, success, build_time, file_size, dest_path in build_results:
|
for config, success, build_time, file_size, dest_path in build_results:
|
||||||
if not success:
|
if not success:
|
||||||
print(f" - {config.name}")
|
print(f" - {config.name}")
|
||||||
|
|
||||||
# Show timing summary
|
# Show timing summary
|
||||||
print(f"\n{Colors.BOLD}{Colors.BRIGHT_CYAN}{"-"*50}{Colors.RESET}")
|
print(f"\n{Colors.BOLD}{Colors.BRIGHT_CYAN}{'-'*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Build Summary:{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Build Summary:{Colors.RESET}")
|
||||||
for config, success, build_time, file_size, dest_path in build_results:
|
for config, success, build_time, file_size, dest_path in build_results:
|
||||||
status = "OK" if success else "FAIL"
|
status = "OK" if success else "FAIL"
|
||||||
row_color = Colors.BRIGHT_GREEN if success else Colors.RED
|
row_color = Colors.BRIGHT_GREEN if success else Colors.RED
|
||||||
size_str = f"{file_size:,} bytes" if file_size > 0 else "N/A"
|
size_str = f"{file_size:,} bytes" if file_size > 0 else "N/A"
|
||||||
print(f" {row_color}{status}{Colors.RESET} {config.name:15s} - {format_time(build_time):8s} - {size_str}")
|
print(f" {row_color}{status}{Colors.RESET} {config.name:15s} - {format_time(build_time):8s} - {size_str}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"-"*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'-'*50}{Colors.RESET}")
|
||||||
print(f"Total time: {Colors.BRIGHT_WHITE}{format_time(total_time)}{Colors.RESET}")
|
print(f"Total time: {Colors.BRIGHT_WHITE}{format_time(total_time)}{Colors.RESET}")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
|||||||
@@ -150,7 +150,9 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-products', '*',
|
'-products', '*',
|
||||||
'-version', _VS_VERSION_RANGE[ver],
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
'-latest',
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -200,7 +202,7 @@ def find_msbuild(vs_version: str = 'auto') -> 'Optional[Tuple[Path, str, str]]':
|
|||||||
def get_project_paths(toolset: str = 'v145') -> Tuple[Path, Path, Path]:
|
def get_project_paths(toolset: str = 'v145') -> Tuple[Path, Path, Path]:
|
||||||
"""Get project directory, project file, and plugins directory"""
|
"""Get project directory, project file, and plugins directory"""
|
||||||
script_dir = Path(__file__).parent.absolute()
|
script_dir = Path(__file__).parent.absolute()
|
||||||
project_dir = script_dir.parent.parent / 'versions' / '26.00'
|
project_dir = script_dir.parent.parent / 'versions' / '26.00-bundle'
|
||||||
vcxproj = 'Nsis7z_vs2026.vcxproj' if toolset == 'v145' else 'Nsis7z.vcxproj'
|
vcxproj = 'Nsis7z_vs2026.vcxproj' if toolset == 'v145' else 'Nsis7z.vcxproj'
|
||||||
project_file = project_dir / 'CPP' / '7zip' / 'Bundles' / 'Nsis7z' / vcxproj
|
project_file = project_dir / 'CPP' / '7zip' / 'Bundles' / 'Nsis7z' / vcxproj
|
||||||
plugins_dir = script_dir.parent.parent / 'plugins'
|
plugins_dir = script_dir.parent.parent / 'plugins'
|
||||||
@@ -346,7 +348,7 @@ def build_configuration(
|
|||||||
cmd = [
|
cmd = [
|
||||||
str(msbuild_path),
|
str(msbuild_path),
|
||||||
str(project_file),
|
str(project_file),
|
||||||
f'/t:{"Rebuild" if rebuild else "Build"}',
|
'/t:' + ('Rebuild' if rebuild else 'Build'),
|
||||||
f'/p:Configuration={config.config}',
|
f'/p:Configuration={config.config}',
|
||||||
f'/p:Platform={config.platform}',
|
f'/p:Platform={config.platform}',
|
||||||
f'/p:OutDir=Build\\{config.name}\\',
|
f'/p:OutDir=Build\\{config.name}\\',
|
||||||
@@ -766,6 +768,8 @@ Examples:
|
|||||||
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead of <repo>/plugins/<config>')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Find MSBuild early (needed for project path selection)
|
# Find MSBuild early (needed for project path selection)
|
||||||
@@ -777,6 +781,9 @@ Examples:
|
|||||||
|
|
||||||
# Get project paths (project file depends on toolset)
|
# Get project paths (project file depends on toolset)
|
||||||
project_dir, project_file, plugins_dir = get_project_paths(platform_toolset)
|
project_dir, project_file, plugins_dir = get_project_paths(platform_toolset)
|
||||||
|
# --dist: redirect output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
# List project configurations
|
# List project configurations
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
|
|||||||
Executable
+775
@@ -0,0 +1,775 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
Build script for nsis7z plugin (7-Zip 26.01) - Visual Studio 2026
|
||||||
|
Supports multiple build configurations with flexible parameters.
|
||||||
|
Uses PlatformToolset v145 (Visual Studio 2026 Build Tools).
|
||||||
|
|
||||||
|
The 7-Zip 26.01 source is pulled from the git submodule at versions/26.01/.
|
||||||
|
The NSIS plugin wrapper (nsis7z.cpp, vcxproj, …) lives in versions/26.01-bundle/.
|
||||||
|
|
||||||
|
NOTE: VS2026 Build Tools use v145 toolset (version 18.x)
|
||||||
|
"""
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import subprocess
|
||||||
|
import shutil
|
||||||
|
import time
|
||||||
|
import multiprocessing
|
||||||
|
import threading
|
||||||
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import List, Tuple, Optional
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Colors & Spinner
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class Colors:
|
||||||
|
CYAN = "\033[36m"
|
||||||
|
GREEN = "\033[32m"
|
||||||
|
YELLOW = "\033[33m"
|
||||||
|
RED = "\033[31m"
|
||||||
|
GRAY = "\033[90m"
|
||||||
|
BLUE = "\033[34m"
|
||||||
|
RESET = "\033[0m"
|
||||||
|
BOLD = "\033[1m"
|
||||||
|
BRIGHT_GREEN = "\033[92m"
|
||||||
|
BRIGHT_CYAN = "\033[96m"
|
||||||
|
BRIGHT_WHITE = "\033[97m"
|
||||||
|
BRIGHT_YELLOW = "\033[93m"
|
||||||
|
BRIGHT_RED = "\033[91m"
|
||||||
|
|
||||||
|
|
||||||
|
class Spinner:
|
||||||
|
def __init__(self, message: str = "Building...", delay: float = 0.1, total: int = 0):
|
||||||
|
self.spinner = ['\u280b', '\u2819', '\u2839', '\u2838', '\u283c', '\u2834', '\u2826', '\u2827', '\u2807', '\u280f']
|
||||||
|
self.delay = delay
|
||||||
|
self.message = message
|
||||||
|
self.running = False
|
||||||
|
self.thread = None
|
||||||
|
self.start_time = time.time()
|
||||||
|
|
||||||
|
def update(self, current=None):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _spin(self):
|
||||||
|
idx = 0
|
||||||
|
_block = '\u28ff'
|
||||||
|
while self.running:
|
||||||
|
elapsed = time.time() - self.start_time
|
||||||
|
n_blocks = int(elapsed // 2)
|
||||||
|
time_blocks = f"{Colors.YELLOW}{_block * n_blocks}{Colors.RESET}"
|
||||||
|
spin_char = f"{Colors.YELLOW}{self.spinner[idx % len(self.spinner)]}{Colors.RESET}"
|
||||||
|
msg = f"{Colors.BOLD}{Colors.CYAN}{self.message}{Colors.RESET}"
|
||||||
|
time_str = f"{Colors.GREEN}{int(elapsed)}s{Colors.RESET}"
|
||||||
|
sys.stdout.write(f"\r{msg} {time_str} {time_blocks}{spin_char} ")
|
||||||
|
sys.stdout.flush()
|
||||||
|
idx += 1
|
||||||
|
time.sleep(self.delay)
|
||||||
|
sys.stdout.write("\r" + " " * (len(self.message) + 80) + "\r")
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
def __enter__(self):
|
||||||
|
if sys.stdout.isatty():
|
||||||
|
self.running = True
|
||||||
|
self.thread = threading.Thread(target=self._spin, daemon=True)
|
||||||
|
self.thread.start()
|
||||||
|
return self
|
||||||
|
|
||||||
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||||
|
if self.running:
|
||||||
|
self.running = False
|
||||||
|
if self.thread:
|
||||||
|
self.thread.join()
|
||||||
|
|
||||||
|
|
||||||
|
class BuildConfig:
|
||||||
|
"""Configuration for a single build target"""
|
||||||
|
def __init__(self, name: str, config: str, platform: str, dest_dir: str):
|
||||||
|
self.name = name
|
||||||
|
self.config = config
|
||||||
|
self.platform = platform
|
||||||
|
self.dest_dir = dest_dir
|
||||||
|
|
||||||
|
|
||||||
|
# Predefined build configurations
|
||||||
|
CONFIGS = {
|
||||||
|
'x86-unicode': BuildConfig(
|
||||||
|
name='x86-unicode',
|
||||||
|
config='Release Unicode',
|
||||||
|
platform='Win32',
|
||||||
|
dest_dir='x86-unicode'
|
||||||
|
),
|
||||||
|
'x64-unicode': BuildConfig(
|
||||||
|
name='x64-unicode',
|
||||||
|
config='Release Unicode',
|
||||||
|
platform='x64',
|
||||||
|
dest_dir='amd64-unicode'
|
||||||
|
),
|
||||||
|
'x86-ansi': BuildConfig(
|
||||||
|
name='x86-ansi',
|
||||||
|
config='Release',
|
||||||
|
platform='Win32',
|
||||||
|
dest_dir='x86-ansi'
|
||||||
|
),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Standard vswhere.exe location (installed with any VS 2017+ setup)
|
||||||
|
_VSWHERE_PATH = Path(r'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe')
|
||||||
|
|
||||||
|
# vswhere version range per VS year
|
||||||
|
_VS_VERSION_RANGE = {
|
||||||
|
'2026': '[18.0,19.0)',
|
||||||
|
'2022': '[17.0,18.0)',
|
||||||
|
}
|
||||||
|
|
||||||
|
# MSBuild toolset per VS year
|
||||||
|
_VS_TOOLSET = {
|
||||||
|
'2026': 'v145', # VS 2026 uses v145 toolset
|
||||||
|
'2022': 'v143', # VS 2022 uses v143 toolset
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str]]':
|
||||||
|
"""Locate MSBuild via vswhere.exe."""
|
||||||
|
if not _VSWHERE_PATH.exists():
|
||||||
|
return None
|
||||||
|
versions_to_try = ['2026', '2022'] if vs_version == 'auto' else [vs_version]
|
||||||
|
for ver in versions_to_try:
|
||||||
|
if ver not in _VS_VERSION_RANGE:
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
result = subprocess.run(
|
||||||
|
[
|
||||||
|
str(_VSWHERE_PATH),
|
||||||
|
'-products', '*',
|
||||||
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
|
],
|
||||||
|
capture_output=True, text=True, timeout=15,
|
||||||
|
)
|
||||||
|
if result.returncode == 0:
|
||||||
|
lines = [ln.strip() for ln in result.stdout.splitlines() if ln.strip()]
|
||||||
|
if lines:
|
||||||
|
msbuild_path = Path(lines[0])
|
||||||
|
if msbuild_path.exists():
|
||||||
|
return msbuild_path, _VS_TOOLSET[ver], ver
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
# Numeric version folder used by VS2026 installer (version 18.x)
|
||||||
|
_VS_NUMERIC_FOLDER = {
|
||||||
|
'2026': '18',
|
||||||
|
'2022': '2022',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def find_msbuild(vs_version: str = 'auto') -> 'Optional[Tuple[Path, str, str]]':
|
||||||
|
"""Find MSBuild.exe via vswhere, then well-known fallback paths.
|
||||||
|
|
||||||
|
Returns (msbuild_path, toolset_version, vs_year) or None.
|
||||||
|
"""
|
||||||
|
result = _find_msbuild_via_vswhere(vs_version)
|
||||||
|
if result is not None:
|
||||||
|
return result
|
||||||
|
|
||||||
|
vs_editions = ['Community', 'Professional', 'Enterprise', 'BuildTools']
|
||||||
|
versions_to_try = ['2026', '2022'] if vs_version == 'auto' else [vs_version]
|
||||||
|
for version in versions_to_try:
|
||||||
|
numeric = _VS_NUMERIC_FOLDER.get(version, version)
|
||||||
|
base_paths = [
|
||||||
|
Path(rf'C:\Program Files (x86)\Microsoft Visual Studio\{numeric}'),
|
||||||
|
Path(rf'C:\Program Files\Microsoft Visual Studio\{version}'),
|
||||||
|
]
|
||||||
|
for base_path in base_paths:
|
||||||
|
for edition in vs_editions:
|
||||||
|
msbuild_path = base_path / edition / 'MSBuild' / 'Current' / 'Bin' / 'MSBuild.exe'
|
||||||
|
if msbuild_path.exists():
|
||||||
|
return msbuild_path, _VS_TOOLSET[version], version
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def get_project_paths(toolset: str = 'v145') -> Tuple[Path, Path, Path]:
|
||||||
|
"""Get project directory, project file, and plugins directory"""
|
||||||
|
script_dir = Path(__file__).parent.absolute()
|
||||||
|
project_dir = script_dir.parent.parent / 'versions' / '26.01-bundle'
|
||||||
|
vcxproj = 'Nsis7z_vs2026.vcxproj'
|
||||||
|
project_file = project_dir / 'CPP' / '7zip' / 'Bundles' / 'Nsis7z' / vcxproj
|
||||||
|
plugins_dir = script_dir.parent.parent / 'plugins'
|
||||||
|
|
||||||
|
return project_dir, project_file, plugins_dir
|
||||||
|
|
||||||
|
|
||||||
|
def get_cpu_info() -> dict:
|
||||||
|
"""Get CPU information for parallel build optimization"""
|
||||||
|
try:
|
||||||
|
import psutil
|
||||||
|
logical_cores = psutil.cpu_count(logical=True)
|
||||||
|
physical_cores = psutil.cpu_count(logical=False)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'logical_cores': logical_cores,
|
||||||
|
'physical_cores': physical_cores,
|
||||||
|
'has_hyperthreading': logical_cores > physical_cores,
|
||||||
|
'has_psutil': True
|
||||||
|
}
|
||||||
|
except ImportError:
|
||||||
|
cpu_count = multiprocessing.cpu_count()
|
||||||
|
return {
|
||||||
|
'logical_cores': cpu_count,
|
||||||
|
'physical_cores': cpu_count,
|
||||||
|
'has_hyperthreading': False,
|
||||||
|
'has_psutil': False
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def get_optimal_thread_count() -> int:
|
||||||
|
"""Get optimal thread count for compilation"""
|
||||||
|
cpu_info = get_cpu_info()
|
||||||
|
if cpu_info['has_hyperthreading'] and cpu_info['physical_cores'] > 1:
|
||||||
|
return cpu_info['physical_cores']
|
||||||
|
return cpu_info['logical_cores']
|
||||||
|
|
||||||
|
|
||||||
|
def get_build_optimizations() -> List[str]:
|
||||||
|
"""Get additional build optimization flags"""
|
||||||
|
return [
|
||||||
|
'/p:BuildInParallel=true',
|
||||||
|
'/p:MultiProcessorCompilation=true',
|
||||||
|
'/p:PreferredToolArchitecture=x64',
|
||||||
|
'/p:UseSharedCompilation=true',
|
||||||
|
'/p:TrackFileAccess=false',
|
||||||
|
'/nodeReuse:true',
|
||||||
|
'/p:GenerateResourceUsePreserializedResources=true'
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def get_memory_optimizations() -> List[str]:
|
||||||
|
"""Get memory optimization flags for faster builds"""
|
||||||
|
try:
|
||||||
|
import psutil
|
||||||
|
memory_gb = psutil.virtual_memory().total / (1024 ** 3)
|
||||||
|
if memory_gb >= 16:
|
||||||
|
return [
|
||||||
|
'/p:DisableFastUpToDateCheck=false',
|
||||||
|
'/p:BuildProjectReferences=true',
|
||||||
|
'/p:UseCommonOutputDirectory=false'
|
||||||
|
]
|
||||||
|
elif memory_gb >= 8:
|
||||||
|
return ['/p:DisableFastUpToDateCheck=false']
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
except ImportError:
|
||||||
|
return ['/p:DisableFastUpToDateCheck=false']
|
||||||
|
|
||||||
|
|
||||||
|
def print_cpu_info(use_parallel: bool, use_optimizations: bool = True) -> None:
|
||||||
|
"""Print CPU information for build optimization"""
|
||||||
|
if not use_parallel:
|
||||||
|
print(f"{Colors.CYAN}Build mode:{Colors.RESET} {Colors.BRIGHT_WHITE}Single-threaded{Colors.RESET}")
|
||||||
|
if use_optimizations:
|
||||||
|
print(f"{Colors.CYAN}Optimizations:{Colors.RESET} {Colors.BRIGHT_WHITE}ENABLED{Colors.RESET} (memory, caching)")
|
||||||
|
return
|
||||||
|
|
||||||
|
cpu_info = get_cpu_info()
|
||||||
|
optimal_threads = get_optimal_thread_count()
|
||||||
|
|
||||||
|
print(f"{Colors.CYAN}Build mode:{Colors.RESET} {Colors.BRIGHT_WHITE}Parallel{Colors.RESET}")
|
||||||
|
print(f"{Colors.CYAN}Logical cores:{Colors.RESET} {Colors.BRIGHT_WHITE}{cpu_info['logical_cores']}{Colors.RESET}")
|
||||||
|
print(f"{Colors.CYAN}Physical cores:{Colors.RESET} {Colors.BRIGHT_WHITE}{cpu_info['physical_cores']}{Colors.RESET}")
|
||||||
|
|
||||||
|
if cpu_info['has_hyperthreading']:
|
||||||
|
print(f"{Colors.CYAN}Hyperthreading:{Colors.RESET} {Colors.BRIGHT_GREEN}ENABLED{Colors.RESET}")
|
||||||
|
print(f"{Colors.CYAN}Optimal threads:{Colors.RESET} {Colors.BRIGHT_WHITE}{optimal_threads}{Colors.RESET} (using physical cores)")
|
||||||
|
else:
|
||||||
|
print(f"{Colors.CYAN}Hyperthreading:{Colors.RESET} {Colors.GRAY}NOT AVAILABLE{Colors.RESET}")
|
||||||
|
print(f"{Colors.CYAN}Optimal threads:{Colors.RESET} {Colors.BRIGHT_WHITE}{optimal_threads}{Colors.RESET}")
|
||||||
|
|
||||||
|
print(f"{Colors.CYAN}MSBuild threads:{Colors.RESET} {Colors.BRIGHT_WHITE}{optimal_threads}{Colors.RESET}")
|
||||||
|
|
||||||
|
if use_optimizations:
|
||||||
|
print(f"{Colors.CYAN}Optimizations:{Colors.RESET} {Colors.BRIGHT_GREEN}ENABLED{Colors.RESET} (parallel, memory, caching)")
|
||||||
|
try:
|
||||||
|
import psutil
|
||||||
|
memory_gb = psutil.virtual_memory().total / (1024 ** 3)
|
||||||
|
print(f"{Colors.CYAN}Available memory:{Colors.RESET} {Colors.BRIGHT_WHITE}{memory_gb:.1f} GB{Colors.RESET}")
|
||||||
|
except ImportError:
|
||||||
|
print(f"{Colors.CYAN}Available memory:{Colors.RESET} {Colors.GRAY}Unknown (install psutil for details){Colors.RESET}")
|
||||||
|
else:
|
||||||
|
print(f"{Colors.CYAN}Optimizations:{Colors.RESET} {Colors.RED}DISABLED{Colors.RESET}")
|
||||||
|
|
||||||
|
if not cpu_info['has_psutil']:
|
||||||
|
print(f"{Colors.GRAY}Note: Install 'psutil' for detailed CPU/memory info (pip install psutil){Colors.RESET}")
|
||||||
|
|
||||||
|
print()
|
||||||
|
|
||||||
|
|
||||||
|
def build_configuration(
|
||||||
|
msbuild_path: Path,
|
||||||
|
project_file: Path,
|
||||||
|
config: BuildConfig,
|
||||||
|
rebuild: bool = True,
|
||||||
|
verbosity: str = 'quiet',
|
||||||
|
parallel: bool = True,
|
||||||
|
optimizations: bool = True,
|
||||||
|
counter: str = "",
|
||||||
|
capture_output: bool = False,
|
||||||
|
toolset: str = 'v145',
|
||||||
|
) -> Tuple[bool, float, str]:
|
||||||
|
"""Build a single configuration.
|
||||||
|
|
||||||
|
Returns (success, elapsed_time, captured_output).
|
||||||
|
"""
|
||||||
|
cmd = [
|
||||||
|
str(msbuild_path),
|
||||||
|
str(project_file),
|
||||||
|
'/t:' + ('Rebuild' if rebuild else 'Build'),
|
||||||
|
f'/p:Configuration={config.config}',
|
||||||
|
f'/p:Platform={config.platform}',
|
||||||
|
f'/p:OutDir=Build\\{config.name}\\',
|
||||||
|
f'/p:IntDir=Build\\{config.name}\\obj\\',
|
||||||
|
'/p:WindowsTargetPlatformVersion=10.0',
|
||||||
|
f'/p:PlatformToolset={toolset}',
|
||||||
|
f'/v:{verbosity}',
|
||||||
|
]
|
||||||
|
|
||||||
|
if parallel:
|
||||||
|
optimal_threads = get_optimal_thread_count()
|
||||||
|
cmd.extend([
|
||||||
|
f'/maxcpucount:{optimal_threads}',
|
||||||
|
'/p:UseMultiToolTask=true',
|
||||||
|
f'/p:CL_MPCount={optimal_threads}'
|
||||||
|
])
|
||||||
|
|
||||||
|
if optimizations:
|
||||||
|
cmd.extend(get_build_optimizations())
|
||||||
|
cmd.extend(get_memory_optimizations())
|
||||||
|
cache_dir = setup_build_cache()
|
||||||
|
if cache_dir:
|
||||||
|
cmd.append('/p:MSBuildCacheEnabled=true')
|
||||||
|
|
||||||
|
if not capture_output:
|
||||||
|
print(f"\n{Colors.BOLD}{Colors.BRIGHT_YELLOW}{'=' * 50}{Colors.RESET}")
|
||||||
|
if counter:
|
||||||
|
print(f"{Colors.BOLD}{Colors.BRIGHT_WHITE}Building {config.name} [{counter}]{Colors.RESET}")
|
||||||
|
else:
|
||||||
|
print(f"{Colors.BOLD}{Colors.BRIGHT_WHITE}Building {config.name}...{Colors.RESET}")
|
||||||
|
print(f"{Colors.BOLD}{Colors.BRIGHT_YELLOW}{'=' * 50}{Colors.RESET}")
|
||||||
|
|
||||||
|
start_time = time.time()
|
||||||
|
try:
|
||||||
|
if capture_output:
|
||||||
|
result = subprocess.run(cmd, check=False, capture_output=True, text=True)
|
||||||
|
elapsed = time.time() - start_time
|
||||||
|
return result.returncode == 0, elapsed, result.stdout + result.stderr
|
||||||
|
else:
|
||||||
|
result = subprocess.run(cmd, check=False)
|
||||||
|
elapsed = time.time() - start_time
|
||||||
|
return result.returncode == 0, elapsed, ""
|
||||||
|
except Exception as e:
|
||||||
|
elapsed = time.time() - start_time
|
||||||
|
msg = f"ERROR: Build failed with exception: {e}"
|
||||||
|
if capture_output:
|
||||||
|
return False, elapsed, msg
|
||||||
|
print(msg)
|
||||||
|
return False, elapsed, ""
|
||||||
|
|
||||||
|
|
||||||
|
def copy_output(
|
||||||
|
project_dir: Path,
|
||||||
|
plugins_dir: Path,
|
||||||
|
config: BuildConfig
|
||||||
|
) -> Tuple[bool, int, Optional[Path]]:
|
||||||
|
"""Copy built DLL to destination directory.
|
||||||
|
|
||||||
|
Returns (success, file_size, dest_path).
|
||||||
|
"""
|
||||||
|
output_file = (
|
||||||
|
project_dir / 'CPP' / '7zip' / 'Bundles' / 'Nsis7z'
|
||||||
|
/ 'Build' / config.name / 'nsis7z.dll'
|
||||||
|
)
|
||||||
|
dest_dir = plugins_dir / config.dest_dir
|
||||||
|
|
||||||
|
if not output_file.exists():
|
||||||
|
print(f"{Colors.RED}ERROR:{Colors.RESET} {config.name} DLL not found at {output_file}")
|
||||||
|
return False, 0, None
|
||||||
|
|
||||||
|
dest_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
try:
|
||||||
|
dest_path = dest_dir / 'nsis7z.dll'
|
||||||
|
shutil.copy2(output_file, dest_path)
|
||||||
|
file_size = output_file.stat().st_size
|
||||||
|
print(f"{Colors.BRIGHT_GREEN}SUCCESS:{Colors.RESET} {config.name} - {file_size:,} bytes - Copied to {dest_dir}")
|
||||||
|
return True, file_size, dest_path
|
||||||
|
except Exception as e:
|
||||||
|
print(f"{Colors.RED}ERROR:{Colors.RESET} Failed to copy {config.name}: {e}")
|
||||||
|
return False, 0, None
|
||||||
|
|
||||||
|
|
||||||
|
def clean_build_artifacts(project_dir: Path, configs: List[BuildConfig]) -> None:
|
||||||
|
"""Clean up build artifacts"""
|
||||||
|
print(f"\n{Colors.CYAN}Cleaning build artifacts...{Colors.RESET}")
|
||||||
|
|
||||||
|
build_base_dir = (
|
||||||
|
project_dir / 'CPP' / '7zip' / 'Bundles' / 'Nsis7z' / 'Build'
|
||||||
|
)
|
||||||
|
|
||||||
|
dirs_to_clean = {build_base_dir / config.name for config in configs}
|
||||||
|
|
||||||
|
for dir_path in dirs_to_clean:
|
||||||
|
if dir_path.exists():
|
||||||
|
try:
|
||||||
|
shutil.rmtree(dir_path)
|
||||||
|
print(f" {Colors.GRAY}- Cleaned: {dir_path.name}{Colors.RESET}")
|
||||||
|
except Exception as e:
|
||||||
|
print(f" {Colors.RED}- Failed to clean {dir_path.name}: {e}{Colors.RESET}")
|
||||||
|
|
||||||
|
print(f"{Colors.BRIGHT_GREEN}Build artifacts cleaned successfully.{Colors.RESET}")
|
||||||
|
|
||||||
|
|
||||||
|
def format_time(seconds: float) -> str:
|
||||||
|
"""Format seconds to human-readable string"""
|
||||||
|
if seconds < 60:
|
||||||
|
return f"{seconds:.2f}s"
|
||||||
|
elif seconds < 3600:
|
||||||
|
minutes = int(seconds // 60)
|
||||||
|
secs = seconds % 60
|
||||||
|
return f"{minutes}m {secs:.1f}s"
|
||||||
|
else:
|
||||||
|
hours = int(seconds // 3600)
|
||||||
|
minutes = int((seconds % 3600) // 60)
|
||||||
|
secs = seconds % 60
|
||||||
|
return f"{hours}h {minutes}m {secs:.0f}s"
|
||||||
|
|
||||||
|
|
||||||
|
def setup_build_cache() -> Optional[str]:
|
||||||
|
"""Setup build cache directory for faster incremental builds"""
|
||||||
|
try:
|
||||||
|
cache_dir = Path.home() / '.msbuild_cache' / 'nsis7z-zstd-vs2026'
|
||||||
|
cache_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
return str(cache_dir)
|
||||||
|
except Exception:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def get_available_configurations(project_file: Path) -> List[Tuple[str, str]]:
|
||||||
|
"""Parse .vcxproj file to get available configurations"""
|
||||||
|
try:
|
||||||
|
tree = ET.parse(project_file)
|
||||||
|
root = tree.getroot()
|
||||||
|
ns = {'ms': 'http://schemas.microsoft.com/developer/msbuild/2003'}
|
||||||
|
configs = []
|
||||||
|
for item_group in root.findall('.//ms:ItemGroup', ns):
|
||||||
|
for proj_config in item_group.findall('ms:ProjectConfiguration', ns):
|
||||||
|
include = proj_config.get('Include')
|
||||||
|
if include:
|
||||||
|
parts = include.split('|')
|
||||||
|
if len(parts) == 2:
|
||||||
|
configs.append((parts[0], parts[1]))
|
||||||
|
return configs
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Warning: Could not parse project file: {e}")
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
def print_available_configurations(project_file: Path) -> None:
|
||||||
|
"""Print all configurations available in the project"""
|
||||||
|
configs = get_available_configurations(project_file)
|
||||||
|
if not configs:
|
||||||
|
print("No configurations found or could not read project file.")
|
||||||
|
return
|
||||||
|
|
||||||
|
print("Available configurations in project:")
|
||||||
|
print("-" * 60)
|
||||||
|
from collections import defaultdict
|
||||||
|
grouped = defaultdict(list)
|
||||||
|
for config, platform in configs:
|
||||||
|
grouped[config].append(platform)
|
||||||
|
for config_name in sorted(grouped.keys()):
|
||||||
|
platforms = ', '.join(sorted(grouped[config_name]))
|
||||||
|
print(f" {config_name:25s} - {platforms}")
|
||||||
|
print(f"\nTotal: {len(configs)} configuration(s)")
|
||||||
|
print()
|
||||||
|
print("Configurations mapped in this build script:")
|
||||||
|
print("-" * 60)
|
||||||
|
for name, config in CONFIGS.items():
|
||||||
|
print(f" {name:15s} -> {config.config} / {config.platform}")
|
||||||
|
print()
|
||||||
|
|
||||||
|
|
||||||
|
_print_lock = threading.Lock()
|
||||||
|
|
||||||
|
|
||||||
|
def _build_configs_parallel(
|
||||||
|
msbuild_path: Path,
|
||||||
|
project_file: Path,
|
||||||
|
configs: 'List[BuildConfig]',
|
||||||
|
*,
|
||||||
|
rebuild: bool,
|
||||||
|
verbosity: str,
|
||||||
|
parallel: bool,
|
||||||
|
optimizations: bool,
|
||||||
|
project_dir: Path,
|
||||||
|
plugins_dir: Path,
|
||||||
|
toolset: str = 'v145',
|
||||||
|
) -> list:
|
||||||
|
"""Build all configurations simultaneously, printing output atomically."""
|
||||||
|
n = len(configs)
|
||||||
|
print(f"\n{Colors.BOLD}{Colors.BRIGHT_CYAN}Parallel-configs:{Colors.RESET} launching {Colors.BRIGHT_WHITE}{n}{Colors.RESET} builds simultaneously...")
|
||||||
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'='*50}{Colors.RESET}")
|
||||||
|
|
||||||
|
total_start = time.time()
|
||||||
|
results_by_idx: dict = {}
|
||||||
|
idx_lock = threading.Lock()
|
||||||
|
|
||||||
|
def _build_one(idx: int, config: 'BuildConfig'):
|
||||||
|
success, build_time, captured = build_configuration(
|
||||||
|
msbuild_path, project_file, config,
|
||||||
|
rebuild=rebuild, verbosity=verbosity,
|
||||||
|
parallel=parallel, optimizations=optimizations,
|
||||||
|
capture_output=True, toolset=toolset,
|
||||||
|
)
|
||||||
|
import io, contextlib
|
||||||
|
copy_buf = io.StringIO()
|
||||||
|
if success:
|
||||||
|
with contextlib.redirect_stdout(copy_buf):
|
||||||
|
copy_ok, file_size, dest_path = copy_output(project_dir, plugins_dir, config)
|
||||||
|
else:
|
||||||
|
copy_ok, file_size, dest_path = False, 0, None
|
||||||
|
|
||||||
|
with _print_lock:
|
||||||
|
all_ok = success and copy_ok
|
||||||
|
tag_color = Colors.BRIGHT_GREEN if all_ok else Colors.RED
|
||||||
|
tag = "OK" if all_ok else "FAILED"
|
||||||
|
size_str = f"{file_size:,} bytes" if file_size > 0 else "N/A"
|
||||||
|
sys.stdout.write("\r" + " " * 80 + "\r")
|
||||||
|
sys.stdout.flush()
|
||||||
|
print(f"{tag_color}[{tag}]{Colors.RESET} {config.name} ({format_time(build_time)}) {size_str}")
|
||||||
|
if dest_path:
|
||||||
|
print(f" {Colors.GRAY}-> {dest_path}{Colors.RESET}")
|
||||||
|
if not all_ok:
|
||||||
|
copy_out = copy_buf.getvalue()
|
||||||
|
if copy_out.strip():
|
||||||
|
print(copy_out.rstrip())
|
||||||
|
if captured.strip():
|
||||||
|
print(f"{Colors.YELLOW}--- Build output ---{Colors.RESET}")
|
||||||
|
print(captured.rstrip())
|
||||||
|
|
||||||
|
with idx_lock:
|
||||||
|
results_by_idx[idx] = (config, success and copy_ok, build_time, file_size, dest_path)
|
||||||
|
|
||||||
|
with Spinner(f"Building {n} configs in parallel...") as _spinner:
|
||||||
|
with ThreadPoolExecutor(max_workers=n) as executor:
|
||||||
|
futures = {executor.submit(_build_one, i, cfg): i for i, cfg in enumerate(configs)}
|
||||||
|
for fut in as_completed(futures):
|
||||||
|
exc = fut.exception()
|
||||||
|
if exc:
|
||||||
|
idx = futures[fut]
|
||||||
|
with _print_lock:
|
||||||
|
print(f"{Colors.RED}ERROR:{Colors.RESET} worker for config index {idx} raised: {exc}")
|
||||||
|
with idx_lock:
|
||||||
|
results_by_idx[idx] = (configs[idx], False, 0.0, 0, None)
|
||||||
|
|
||||||
|
wall_time = time.time() - total_start
|
||||||
|
print(f"\n{Colors.BOLD}{Colors.BRIGHT_CYAN}All {n} configs finished in {Colors.BRIGHT_WHITE}{format_time(wall_time)}{Colors.CYAN} (wall clock){Colors.RESET}")
|
||||||
|
return [results_by_idx[i] for i in range(n)]
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""Main build function"""
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description='Build nsis7z plugin (7-Zip ZS / mcmilk/7-Zip-zstd, Visual Studio 2026)',
|
||||||
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||||
|
epilog="""
|
||||||
|
Examples:
|
||||||
|
%(prog)s # Build all configurations
|
||||||
|
%(prog)s --list # List script configurations
|
||||||
|
%(prog)s --list-project # List all project configurations
|
||||||
|
%(prog)s --configs x86-unicode # Build only x86-unicode
|
||||||
|
%(prog)s --configs x86-unicode x64-unicode
|
||||||
|
%(prog)s --no-rebuild # Incremental build
|
||||||
|
%(prog)s --no-parallel # Single-threaded build
|
||||||
|
%(prog)s --no-clean # Skip cleanup
|
||||||
|
%(prog)s --verbosity minimal # Show more build output
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
'--configs', nargs='+',
|
||||||
|
choices=list(CONFIGS.keys()) + ['all'],
|
||||||
|
default=['all'],
|
||||||
|
help='Configurations to build (default: all)'
|
||||||
|
)
|
||||||
|
parser.add_argument('--rebuild', action='store_true', default=True)
|
||||||
|
parser.add_argument('--no-rebuild', action='store_false', dest='rebuild',
|
||||||
|
help='Incremental build (only changed files)')
|
||||||
|
parser.add_argument('--parallel', action='store_true', default=True)
|
||||||
|
parser.add_argument('--no-parallel', action='store_false', dest='parallel')
|
||||||
|
parser.add_argument('--verbosity',
|
||||||
|
choices=['quiet', 'minimal', 'normal', 'detailed', 'diagnostic'],
|
||||||
|
default='quiet')
|
||||||
|
parser.add_argument('--clean', action='store_true', default=True)
|
||||||
|
parser.add_argument('--no-clean', action='store_false', dest='clean')
|
||||||
|
parser.add_argument('--list', action='store_true',
|
||||||
|
help='List script configurations and exit')
|
||||||
|
parser.add_argument('--list-project', action='store_true',
|
||||||
|
help='List all configurations in the .vcxproj and exit')
|
||||||
|
parser.add_argument('--pause', action='store_true',
|
||||||
|
help='Wait for key press at the end')
|
||||||
|
parser.add_argument('--no-optimizations', action='store_true',
|
||||||
|
help='Disable additional build optimizations')
|
||||||
|
parser.add_argument('--vs-version', choices=['auto', '2026', '2022'], default='auto',
|
||||||
|
help='Visual Studio version to use (default: auto)')
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead '
|
||||||
|
'of <repo>/plugins/<config>')
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# Find MSBuild
|
||||||
|
msbuild_result = find_msbuild(args.vs_version)
|
||||||
|
if not msbuild_result:
|
||||||
|
print("ERROR: MSBuild not found!")
|
||||||
|
return 1
|
||||||
|
msbuild_path, platform_toolset, vs_version_name = msbuild_result
|
||||||
|
|
||||||
|
# Get project paths
|
||||||
|
project_dir, project_file, plugins_dir = get_project_paths(platform_toolset)
|
||||||
|
# --dist: redirect the output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
|
if args.list_project:
|
||||||
|
if not project_file.exists():
|
||||||
|
print(f"ERROR: Project file not found: {project_file}")
|
||||||
|
return 1
|
||||||
|
print_available_configurations(project_file)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
if args.list:
|
||||||
|
print("Build script configurations (7-Zip ZS / mcmilk, VS2026):")
|
||||||
|
print("-" * 60)
|
||||||
|
for name, config in CONFIGS.items():
|
||||||
|
print(f" {name:15s} -> {config.config} / {config.platform}")
|
||||||
|
print(f"\nTotal: {len(CONFIGS)} configuration(s)")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
if not project_file.exists():
|
||||||
|
print(f"ERROR: Project file not found: {project_file}")
|
||||||
|
print()
|
||||||
|
print("Make sure the submodule is initialised:")
|
||||||
|
print(" git submodule update --init versions/7-zip-zstd")
|
||||||
|
return 1
|
||||||
|
|
||||||
|
# Determine configurations to build
|
||||||
|
if 'all' in args.configs:
|
||||||
|
configs_to_build = list(CONFIGS.values())
|
||||||
|
else:
|
||||||
|
configs_to_build = [CONFIGS[name] for name in args.configs]
|
||||||
|
|
||||||
|
# Print header
|
||||||
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'='*60}{Colors.RESET}")
|
||||||
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Building nsis7z plugin (7-Zip ZS, VS2026){Colors.RESET} - {Colors.BRIGHT_WHITE}{len(configs_to_build)}{Colors.RESET} configuration(s)")
|
||||||
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'='*60}{Colors.RESET}")
|
||||||
|
print(f"{Colors.CYAN}Visual Studio:{Colors.RESET} {Colors.BRIGHT_WHITE}{vs_version_name} (toolset {platform_toolset}){Colors.RESET}")
|
||||||
|
print(f"{Colors.CYAN}MSBuild:{Colors.RESET} {Colors.BRIGHT_WHITE}{msbuild_path}{Colors.RESET}")
|
||||||
|
print(f"{Colors.CYAN}Project:{Colors.RESET} {Colors.BRIGHT_WHITE}{project_file}{Colors.RESET}")
|
||||||
|
print(f"{Colors.CYAN}Plugins:{Colors.RESET} {Colors.BRIGHT_WHITE}{plugins_dir}{Colors.RESET}")
|
||||||
|
print(f"{Colors.CYAN}Rebuild:{Colors.RESET} {Colors.BRIGHT_WHITE}{args.rebuild}{Colors.RESET}")
|
||||||
|
print(f"{Colors.CYAN}Verbosity:{Colors.RESET} {Colors.BRIGHT_WHITE}{args.verbosity}{Colors.RESET}")
|
||||||
|
print()
|
||||||
|
|
||||||
|
use_optimizations = not args.no_optimizations
|
||||||
|
print_cpu_info(args.parallel, use_optimizations)
|
||||||
|
|
||||||
|
# Build
|
||||||
|
build_results = []
|
||||||
|
total_start_time = time.time()
|
||||||
|
|
||||||
|
if args.parallel and len(configs_to_build) > 1:
|
||||||
|
build_results = _build_configs_parallel(
|
||||||
|
msbuild_path, project_file, configs_to_build,
|
||||||
|
rebuild=args.rebuild, verbosity=args.verbosity,
|
||||||
|
parallel=args.parallel, optimizations=use_optimizations,
|
||||||
|
project_dir=project_dir, plugins_dir=plugins_dir,
|
||||||
|
toolset=platform_toolset,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
for i, config in enumerate(configs_to_build, 1):
|
||||||
|
success, build_time, _ = build_configuration(
|
||||||
|
msbuild_path, project_file, config,
|
||||||
|
rebuild=args.rebuild, verbosity=args.verbosity,
|
||||||
|
parallel=args.parallel, optimizations=use_optimizations,
|
||||||
|
counter=f"{i}/{len(configs_to_build)}",
|
||||||
|
toolset=platform_toolset,
|
||||||
|
)
|
||||||
|
|
||||||
|
if not success:
|
||||||
|
print(f"ERROR: {config.name} build failed! (Time: {format_time(build_time)})")
|
||||||
|
build_results.append((config, False, build_time, 0, None))
|
||||||
|
continue
|
||||||
|
|
||||||
|
success, file_size, dest_path = copy_output(project_dir, plugins_dir, config)
|
||||||
|
print(f"Build time: {format_time(build_time)}")
|
||||||
|
build_results.append((config, success, build_time, file_size, dest_path))
|
||||||
|
|
||||||
|
total_time = time.time() - total_start_time
|
||||||
|
|
||||||
|
# Summary
|
||||||
|
print()
|
||||||
|
all_success = all(success for _, success, _, _, _ in build_results)
|
||||||
|
|
||||||
|
if all_success:
|
||||||
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{'='*50}{Colors.RESET}")
|
||||||
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}ALL BUILDS SUCCESSFUL!{Colors.RESET}")
|
||||||
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{'='*50}{Colors.RESET}")
|
||||||
|
print("\nPlugins copied to:")
|
||||||
|
for config, _, build_time, file_size, dest_path in build_results:
|
||||||
|
dest = dest_path or plugins_dir / config.dest_dir / 'nsis7z.dll'
|
||||||
|
print(f" - {dest}")
|
||||||
|
if args.clean:
|
||||||
|
print()
|
||||||
|
clean_build_artifacts(project_dir, configs_to_build)
|
||||||
|
else:
|
||||||
|
print(f"{Colors.BOLD}{Colors.RED}{'='*50}{Colors.RESET}")
|
||||||
|
print(f"{Colors.BOLD}{Colors.RED}SOME BUILDS FAILED!{Colors.RESET}")
|
||||||
|
print(f"{Colors.BOLD}{Colors.RED}{'='*50}{Colors.RESET}")
|
||||||
|
print("\nFailed configurations:")
|
||||||
|
for config, success, build_time, file_size, dest_path in build_results:
|
||||||
|
if not success:
|
||||||
|
print(f" - {config.name}")
|
||||||
|
|
||||||
|
print(f"\n{Colors.BOLD}{Colors.BRIGHT_CYAN}{'-'*50}{Colors.RESET}")
|
||||||
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Build Summary:{Colors.RESET}")
|
||||||
|
for config, success, build_time, file_size, dest_path in build_results:
|
||||||
|
status = "OK" if success else "FAIL"
|
||||||
|
row_color = Colors.BRIGHT_GREEN if success else Colors.RED
|
||||||
|
size_str = f"{file_size:,} bytes" if file_size > 0 else "N/A"
|
||||||
|
print(f" {row_color}{status}{Colors.RESET} {config.name:15s} - {format_time(build_time):8s} - {size_str}")
|
||||||
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'-'*50}{Colors.RESET}")
|
||||||
|
print(f"Total time: {Colors.BRIGHT_WHITE}{format_time(total_time)}{Colors.RESET}")
|
||||||
|
print()
|
||||||
|
|
||||||
|
if args.pause:
|
||||||
|
try:
|
||||||
|
input("Press Enter to continue...")
|
||||||
|
except EOFError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
return 0 if all_success else 1
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.exit(main())
|
||||||
@@ -146,7 +146,9 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
str(_VSWHERE_PATH),
|
str(_VSWHERE_PATH),
|
||||||
'-version', _VS_VERSION_RANGE[ver],
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
'-latest',
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -328,7 +330,7 @@ def build_configuration(
|
|||||||
cmd = [
|
cmd = [
|
||||||
str(msbuild_path),
|
str(msbuild_path),
|
||||||
str(project_file),
|
str(project_file),
|
||||||
f'/t:{"Rebuild" if rebuild else "Build"}',
|
'/t:' + ('Rebuild' if rebuild else 'Build'),
|
||||||
f'/p:Configuration={config.config}',
|
f'/p:Configuration={config.config}',
|
||||||
f'/p:Platform={config.platform}',
|
f'/p:Platform={config.platform}',
|
||||||
f'/p:OutDir=Build\\{config.name}\\',
|
f'/p:OutDir=Build\\{config.name}\\',
|
||||||
@@ -747,10 +749,15 @@ Examples:
|
|||||||
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead of <repo>/plugins/<config>')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Get project paths early for list-project
|
# Get project paths early for list-project
|
||||||
project_dir, project_file, plugins_dir = get_project_paths()
|
project_dir, project_file, plugins_dir = get_project_paths()
|
||||||
|
# --dist: redirect output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
# List project configurations
|
# List project configurations
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
@@ -789,9 +796,9 @@ Examples:
|
|||||||
configs_to_build = [CONFIGS[name] for name in args.configs]
|
configs_to_build = [CONFIGS[name] for name in args.configs]
|
||||||
|
|
||||||
# Print header
|
# Print header
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"="*60}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'='*60}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Building nsis7z plugin{Colors.RESET} - {Colors.BRIGHT_WHITE}{len(configs_to_build)}{Colors.RESET} configuration(s)")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Building nsis7z plugin{Colors.RESET} - {Colors.BRIGHT_WHITE}{len(configs_to_build)}{Colors.RESET} configuration(s)")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"="*60}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'='*60}{Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}Visual Studio:{Colors.RESET} {Colors.BRIGHT_WHITE}{vs_version_name} (toolset {platform_toolset}){Colors.RESET}")
|
print(f"{Colors.CYAN}Visual Studio:{Colors.RESET} {Colors.BRIGHT_WHITE}{vs_version_name} (toolset {platform_toolset}){Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}MSBuild:{Colors.RESET} {Colors.BRIGHT_WHITE}{msbuild_path}{Colors.RESET}")
|
print(f"{Colors.CYAN}MSBuild:{Colors.RESET} {Colors.BRIGHT_WHITE}{msbuild_path}{Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}Project:{Colors.RESET} {Colors.BRIGHT_WHITE}{project_file}{Colors.RESET}")
|
print(f"{Colors.CYAN}Project:{Colors.RESET} {Colors.BRIGHT_WHITE}{project_file}{Colors.RESET}")
|
||||||
@@ -895,9 +902,9 @@ Examples:
|
|||||||
all_success = all(success for _, success, _, _, _ in build_results)
|
all_success = all(success for _, success, _, _, _ in build_results)
|
||||||
|
|
||||||
if all_success:
|
if all_success:
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{'='*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}ALL BUILDS SUCCESSFUL!{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}ALL BUILDS SUCCESSFUL!{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{'='*50}{Colors.RESET}")
|
||||||
print("\nPlugins copied to:")
|
print("\nPlugins copied to:")
|
||||||
for config, _, build_time, file_size, dest_path in build_results:
|
for config, _, build_time, file_size, dest_path in build_results:
|
||||||
dest = dest_path if dest_path else plugins_dir / config.dest_dir / 'nsis7z.dll'
|
dest = dest_path if dest_path else plugins_dir / config.dest_dir / 'nsis7z.dll'
|
||||||
@@ -908,23 +915,23 @@ Examples:
|
|||||||
print()
|
print()
|
||||||
clean_build_artifacts(project_dir, configs_to_build)
|
clean_build_artifacts(project_dir, configs_to_build)
|
||||||
else:
|
else:
|
||||||
print(f"{Colors.BOLD}{Colors.RED}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}{'='*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.RED}SOME BUILDS FAILED!{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}SOME BUILDS FAILED!{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.RED}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}{'='*50}{Colors.RESET}")
|
||||||
print("\nFailed configurations:")
|
print("\nFailed configurations:")
|
||||||
for config, success, build_time, file_size, dest_path in build_results:
|
for config, success, build_time, file_size, dest_path in build_results:
|
||||||
if not success:
|
if not success:
|
||||||
print(f" - {config.name}")
|
print(f" - {config.name}")
|
||||||
|
|
||||||
# Show timing summary
|
# Show timing summary
|
||||||
print(f"\n{Colors.BOLD}{Colors.BRIGHT_CYAN}{"-"*50}{Colors.RESET}")
|
print(f"\n{Colors.BOLD}{Colors.BRIGHT_CYAN}{'-'*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Build Summary:{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Build Summary:{Colors.RESET}")
|
||||||
for config, success, build_time, file_size, dest_path in build_results:
|
for config, success, build_time, file_size, dest_path in build_results:
|
||||||
status = "OK" if success else "FAIL"
|
status = "OK" if success else "FAIL"
|
||||||
row_color = Colors.BRIGHT_GREEN if success else Colors.RED
|
row_color = Colors.BRIGHT_GREEN if success else Colors.RED
|
||||||
size_str = f"{file_size:,} bytes" if file_size > 0 else "N/A"
|
size_str = f"{file_size:,} bytes" if file_size > 0 else "N/A"
|
||||||
print(f" {row_color}{status}{Colors.RESET} {config.name:15s} - {format_time(build_time):8s} - {size_str}")
|
print(f" {row_color}{status}{Colors.RESET} {config.name:15s} - {format_time(build_time):8s} - {size_str}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"-"*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'-'*50}{Colors.RESET}")
|
||||||
print(f"Total time: {Colors.BRIGHT_WHITE}{format_time(total_time)}{Colors.RESET}")
|
print(f"Total time: {Colors.BRIGHT_WHITE}{format_time(total_time)}{Colors.RESET}")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
|||||||
@@ -150,7 +150,9 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-products', '*',
|
'-products', '*',
|
||||||
'-version', _VS_VERSION_RANGE[ver],
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
'-latest',
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -344,7 +346,7 @@ def build_configuration(
|
|||||||
cmd = [
|
cmd = [
|
||||||
str(msbuild_path),
|
str(msbuild_path),
|
||||||
str(project_file),
|
str(project_file),
|
||||||
f'/t:{"Rebuild" if rebuild else "Build"}',
|
'/t:' + ('Rebuild' if rebuild else 'Build'),
|
||||||
f'/p:Configuration={config.config}',
|
f'/p:Configuration={config.config}',
|
||||||
f'/p:Platform={config.platform}',
|
f'/p:Platform={config.platform}',
|
||||||
f'/p:OutDir=Build\\{config.name}\\',
|
f'/p:OutDir=Build\\{config.name}\\',
|
||||||
@@ -763,10 +765,15 @@ Examples:
|
|||||||
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead of <repo>/plugins/<config>')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Get project paths early for list-project
|
# Get project paths early for list-project
|
||||||
project_dir, project_file, plugins_dir = get_project_paths()
|
project_dir, project_file, plugins_dir = get_project_paths()
|
||||||
|
# --dist: redirect output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
# List project configurations
|
# List project configurations
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
@@ -816,9 +823,9 @@ Examples:
|
|||||||
configs_to_build = [CONFIGS[name] for name in args.configs]
|
configs_to_build = [CONFIGS[name] for name in args.configs]
|
||||||
|
|
||||||
# Print header
|
# Print header
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"="*60}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'='*60}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Building nsis7z plugin (VS2026){Colors.RESET} - {Colors.BRIGHT_WHITE}{len(configs_to_build)}{Colors.RESET} configuration(s)")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Building nsis7z plugin (VS2026){Colors.RESET} - {Colors.BRIGHT_WHITE}{len(configs_to_build)}{Colors.RESET} configuration(s)")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"="*60}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'='*60}{Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}Visual Studio:{Colors.RESET} {Colors.BRIGHT_WHITE}{vs_version_name} (toolset {platform_toolset}){Colors.RESET}")
|
print(f"{Colors.CYAN}Visual Studio:{Colors.RESET} {Colors.BRIGHT_WHITE}{vs_version_name} (toolset {platform_toolset}){Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}MSBuild:{Colors.RESET} {Colors.BRIGHT_WHITE}{msbuild_path}{Colors.RESET}")
|
print(f"{Colors.CYAN}MSBuild:{Colors.RESET} {Colors.BRIGHT_WHITE}{msbuild_path}{Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}Project:{Colors.RESET} {Colors.BRIGHT_WHITE}{project_file}{Colors.RESET}")
|
print(f"{Colors.CYAN}Project:{Colors.RESET} {Colors.BRIGHT_WHITE}{project_file}{Colors.RESET}")
|
||||||
@@ -922,9 +929,9 @@ Examples:
|
|||||||
all_success = all(success for _, success, _, _, _ in build_results)
|
all_success = all(success for _, success, _, _, _ in build_results)
|
||||||
|
|
||||||
if all_success:
|
if all_success:
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{'='*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}ALL BUILDS SUCCESSFUL!{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}ALL BUILDS SUCCESSFUL!{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{'='*50}{Colors.RESET}")
|
||||||
print("\nPlugins copied to:")
|
print("\nPlugins copied to:")
|
||||||
for config, _, build_time, file_size, dest_path in build_results:
|
for config, _, build_time, file_size, dest_path in build_results:
|
||||||
dest = dest_path if dest_path else plugins_dir / config.dest_dir / 'nsis7z.dll'
|
dest = dest_path if dest_path else plugins_dir / config.dest_dir / 'nsis7z.dll'
|
||||||
@@ -935,23 +942,23 @@ Examples:
|
|||||||
print()
|
print()
|
||||||
clean_build_artifacts(project_dir, configs_to_build)
|
clean_build_artifacts(project_dir, configs_to_build)
|
||||||
else:
|
else:
|
||||||
print(f"{Colors.BOLD}{Colors.RED}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}{'='*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.RED}SOME BUILDS FAILED!{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}SOME BUILDS FAILED!{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.RED}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}{'='*50}{Colors.RESET}")
|
||||||
print("\nFailed configurations:")
|
print("\nFailed configurations:")
|
||||||
for config, success, build_time, file_size, dest_path in build_results:
|
for config, success, build_time, file_size, dest_path in build_results:
|
||||||
if not success:
|
if not success:
|
||||||
print(f" - {config.name}")
|
print(f" - {config.name}")
|
||||||
|
|
||||||
# Show timing summary
|
# Show timing summary
|
||||||
print(f"\n{Colors.BOLD}{Colors.BRIGHT_CYAN}{"-"*50}{Colors.RESET}")
|
print(f"\n{Colors.BOLD}{Colors.BRIGHT_CYAN}{'-'*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Build Summary:{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Build Summary:{Colors.RESET}")
|
||||||
for config, success, build_time, file_size, dest_path in build_results:
|
for config, success, build_time, file_size, dest_path in build_results:
|
||||||
status = "OK" if success else "FAIL"
|
status = "OK" if success else "FAIL"
|
||||||
row_color = Colors.BRIGHT_GREEN if success else Colors.RED
|
row_color = Colors.BRIGHT_GREEN if success else Colors.RED
|
||||||
size_str = f"{file_size:,} bytes" if file_size > 0 else "N/A"
|
size_str = f"{file_size:,} bytes" if file_size > 0 else "N/A"
|
||||||
print(f" {row_color}{status}{Colors.RESET} {config.name:15s} - {format_time(build_time):8s} - {size_str}")
|
print(f" {row_color}{status}{Colors.RESET} {config.name:15s} - {format_time(build_time):8s} - {size_str}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"-"*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'-'*50}{Colors.RESET}")
|
||||||
print(f"Total time: {Colors.BRIGHT_WHITE}{format_time(total_time)}{Colors.RESET}")
|
print(f"Total time: {Colors.BRIGHT_WHITE}{format_time(total_time)}{Colors.RESET}")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Supports multiple build configurations with flexible parameters.
|
|||||||
Uses PlatformToolset v145 (Visual Studio 2026 Build Tools).
|
Uses PlatformToolset v145 (Visual Studio 2026 Build Tools).
|
||||||
|
|
||||||
The 7-Zip ZS source is pulled from the git submodule at versions/7-zip-zstd/.
|
The 7-Zip ZS source is pulled from the git submodule at versions/7-zip-zstd/.
|
||||||
The NSIS plugin wrapper (nsis7z.cpp, vcxproj, …) lives in versions/zstd/.
|
The NSIS plugin wrapper (nsis7z.cpp, vcxproj, …) lives in versions/zstd-bundle/.
|
||||||
|
|
||||||
NOTE: VS2026 Build Tools use v145 toolset (version 18.x)
|
NOTE: VS2026 Build Tools use v145 toolset (version 18.x)
|
||||||
"""
|
"""
|
||||||
@@ -150,7 +150,9 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-products', '*',
|
'-products', '*',
|
||||||
'-version', _VS_VERSION_RANGE[ver],
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
'-latest',
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -201,7 +203,7 @@ def find_msbuild(vs_version: str = 'auto') -> 'Optional[Tuple[Path, str, str]]':
|
|||||||
def get_project_paths(toolset: str = 'v145') -> Tuple[Path, Path, Path]:
|
def get_project_paths(toolset: str = 'v145') -> Tuple[Path, Path, Path]:
|
||||||
"""Get project directory, project file, and plugins directory"""
|
"""Get project directory, project file, and plugins directory"""
|
||||||
script_dir = Path(__file__).parent.absolute()
|
script_dir = Path(__file__).parent.absolute()
|
||||||
project_dir = script_dir.parent.parent / 'versions' / 'zstd'
|
project_dir = script_dir.parent.parent / 'versions' / 'zstd-bundle'
|
||||||
vcxproj = 'Nsis7z_vs2026.vcxproj'
|
vcxproj = 'Nsis7z_vs2026.vcxproj'
|
||||||
project_file = project_dir / 'CPP' / '7zip' / 'Bundles' / 'Nsis7z' / vcxproj
|
project_file = project_dir / 'CPP' / '7zip' / 'Bundles' / 'Nsis7z' / vcxproj
|
||||||
plugins_dir = script_dir.parent.parent / 'plugins'
|
plugins_dir = script_dir.parent.parent / 'plugins'
|
||||||
@@ -332,7 +334,7 @@ def build_configuration(
|
|||||||
cmd = [
|
cmd = [
|
||||||
str(msbuild_path),
|
str(msbuild_path),
|
||||||
str(project_file),
|
str(project_file),
|
||||||
f'/t:{"Rebuild" if rebuild else "Build"}',
|
'/t:' + ('Rebuild' if rebuild else 'Build'),
|
||||||
f'/p:Configuration={config.config}',
|
f'/p:Configuration={config.config}',
|
||||||
f'/p:Platform={config.platform}',
|
f'/p:Platform={config.platform}',
|
||||||
f'/p:OutDir=Build\\{config.name}\\',
|
f'/p:OutDir=Build\\{config.name}\\',
|
||||||
@@ -631,6 +633,8 @@ Examples:
|
|||||||
parser.add_argument('--vs-version', choices=['auto', '2026', '2022'], default='auto',
|
parser.add_argument('--vs-version', choices=['auto', '2026', '2022'], default='auto',
|
||||||
help='Visual Studio version to use (default: auto)')
|
help='Visual Studio version to use (default: auto)')
|
||||||
|
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead of <repo>/plugins/<config>')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Find MSBuild
|
# Find MSBuild
|
||||||
@@ -642,6 +646,9 @@ Examples:
|
|||||||
|
|
||||||
# Get project paths
|
# Get project paths
|
||||||
project_dir, project_file, plugins_dir = get_project_paths(platform_toolset)
|
project_dir, project_file, plugins_dir = get_project_paths(platform_toolset)
|
||||||
|
# --dist: redirect output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
if not project_file.exists():
|
if not project_file.exists():
|
||||||
@@ -672,9 +679,9 @@ Examples:
|
|||||||
configs_to_build = [CONFIGS[name] for name in args.configs]
|
configs_to_build = [CONFIGS[name] for name in args.configs]
|
||||||
|
|
||||||
# Print header
|
# Print header
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"="*60}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'='*60}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Building nsis7z plugin (7-Zip ZS, VS2026){Colors.RESET} - {Colors.BRIGHT_WHITE}{len(configs_to_build)}{Colors.RESET} configuration(s)")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Building nsis7z plugin (7-Zip ZS, VS2026){Colors.RESET} - {Colors.BRIGHT_WHITE}{len(configs_to_build)}{Colors.RESET} configuration(s)")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"="*60}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'='*60}{Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}Visual Studio:{Colors.RESET} {Colors.BRIGHT_WHITE}{vs_version_name} (toolset {platform_toolset}){Colors.RESET}")
|
print(f"{Colors.CYAN}Visual Studio:{Colors.RESET} {Colors.BRIGHT_WHITE}{vs_version_name} (toolset {platform_toolset}){Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}MSBuild:{Colors.RESET} {Colors.BRIGHT_WHITE}{msbuild_path}{Colors.RESET}")
|
print(f"{Colors.CYAN}MSBuild:{Colors.RESET} {Colors.BRIGHT_WHITE}{msbuild_path}{Colors.RESET}")
|
||||||
print(f"{Colors.CYAN}Project:{Colors.RESET} {Colors.BRIGHT_WHITE}{project_file}{Colors.RESET}")
|
print(f"{Colors.CYAN}Project:{Colors.RESET} {Colors.BRIGHT_WHITE}{project_file}{Colors.RESET}")
|
||||||
@@ -724,9 +731,9 @@ Examples:
|
|||||||
all_success = all(success for _, success, _, _, _ in build_results)
|
all_success = all(success for _, success, _, _, _ in build_results)
|
||||||
|
|
||||||
if all_success:
|
if all_success:
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{'='*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}ALL BUILDS SUCCESSFUL!{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}ALL BUILDS SUCCESSFUL!{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_GREEN}{'='*50}{Colors.RESET}")
|
||||||
print("\nPlugins copied to:")
|
print("\nPlugins copied to:")
|
||||||
for config, _, build_time, file_size, dest_path in build_results:
|
for config, _, build_time, file_size, dest_path in build_results:
|
||||||
dest = dest_path or plugins_dir / config.dest_dir / 'nsis7z.dll'
|
dest = dest_path or plugins_dir / config.dest_dir / 'nsis7z.dll'
|
||||||
@@ -735,22 +742,22 @@ Examples:
|
|||||||
print()
|
print()
|
||||||
clean_build_artifacts(project_dir, configs_to_build)
|
clean_build_artifacts(project_dir, configs_to_build)
|
||||||
else:
|
else:
|
||||||
print(f"{Colors.BOLD}{Colors.RED}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}{'='*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.RED}SOME BUILDS FAILED!{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}SOME BUILDS FAILED!{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.RED}{"="*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.RED}{'='*50}{Colors.RESET}")
|
||||||
print("\nFailed configurations:")
|
print("\nFailed configurations:")
|
||||||
for config, success, build_time, file_size, dest_path in build_results:
|
for config, success, build_time, file_size, dest_path in build_results:
|
||||||
if not success:
|
if not success:
|
||||||
print(f" - {config.name}")
|
print(f" - {config.name}")
|
||||||
|
|
||||||
print(f"\n{Colors.BOLD}{Colors.BRIGHT_CYAN}{"-"*50}{Colors.RESET}")
|
print(f"\n{Colors.BOLD}{Colors.BRIGHT_CYAN}{'-'*50}{Colors.RESET}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Build Summary:{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}Build Summary:{Colors.RESET}")
|
||||||
for config, success, build_time, file_size, dest_path in build_results:
|
for config, success, build_time, file_size, dest_path in build_results:
|
||||||
status = "OK" if success else "FAIL"
|
status = "OK" if success else "FAIL"
|
||||||
row_color = Colors.BRIGHT_GREEN if success else Colors.RED
|
row_color = Colors.BRIGHT_GREEN if success else Colors.RED
|
||||||
size_str = f"{file_size:,} bytes" if file_size > 0 else "N/A"
|
size_str = f"{file_size:,} bytes" if file_size > 0 else "N/A"
|
||||||
print(f" {row_color}{status}{Colors.RESET} {config.name:15s} - {format_time(build_time):8s} - {size_str}")
|
print(f" {row_color}{status}{Colors.RESET} {config.name:15s} - {format_time(build_time):8s} - {size_str}")
|
||||||
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{"-"*50}{Colors.RESET}")
|
print(f"{Colors.BOLD}{Colors.BRIGHT_CYAN}{'-'*50}{Colors.RESET}")
|
||||||
print(f"Total time: {Colors.BRIGHT_WHITE}{format_time(total_time)}{Colors.RESET}")
|
print(f"Total time: {Colors.BRIGHT_WHITE}{format_time(total_time)}{Colors.RESET}")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,11 @@
|
|||||||
"""Linux build path for nsis7z plugin.
|
"""Linux build path for nsis7z plugin.
|
||||||
|
|
||||||
Builds Windows DLL artifacts from Linux using MinGW-w64 cross compilers.
|
Builds Windows DLL artifacts from Linux using MinGW-w64 cross compilers.
|
||||||
Current support: 7-Zip 26.00.
|
Supported versions: 7-Zip 25.01, 26.00 and zstd.
|
||||||
|
|
||||||
|
All project-owned build-infrastructure files (makefile.gcc, Nsis7z.def) live
|
||||||
|
under tools/linux/overlay/ and are never written into the vendor source trees.
|
||||||
|
Build artifacts go to _linux_build/<version>/<cfg>/ (gitignored).
|
||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
@@ -11,11 +15,79 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import threading
|
||||||
|
import time
|
||||||
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
# Symlink creation is shared across configs; serialize it so parallel
|
||||||
|
# per-config builds don't race recreating the bundle symlinks.
|
||||||
|
_SYMLINK_LOCK = threading.Lock()
|
||||||
|
|
||||||
ROOT = Path(__file__).resolve().parents[2]
|
ROOT = Path(__file__).resolve().parents[2]
|
||||||
|
|
||||||
SUPPORTED = {"26.00"}
|
OVERLAY = ROOT / "tools" / "linux" / "overlay"
|
||||||
|
BUILD_DIR = ROOT / "_linux_build"
|
||||||
|
|
||||||
|
SUPPORTED = {"25.01", "26.00", "26.01", "zstd"}
|
||||||
|
|
||||||
|
# For all versions the upstream vendor does NOT ship a Nsis7z bundle, so a
|
||||||
|
# *-bundle wrapper directory mirrors the vendor tree via symlinks and provides
|
||||||
|
# project-owned sources (NSIS UI, wrapper cpp files, vcxproj).
|
||||||
|
#
|
||||||
|
# For zstd the 7-zip C++ sources live in the 7-zip-zstd submodule while our
|
||||||
|
# NSIS wrapper sits in versions/zstd-bundle/. make is run with -C pointing to the
|
||||||
|
# wrapper dir and VENDOR_7ZIP overridden to the submodule tree so that
|
||||||
|
# include/source rules resolve correctly without touching the submodule.
|
||||||
|
VERSION_LAYOUT = {
|
||||||
|
"25.01": {
|
||||||
|
"vendor_7zip": ROOT / "versions" / "25.01" / "CPP" / "7zip",
|
||||||
|
"bundle_dir": ROOT / "versions" / "25.01-bundle" / "CPP" / "7zip" / "Bundles" / "Nsis7z",
|
||||||
|
},
|
||||||
|
"26.00": {
|
||||||
|
"vendor_7zip": ROOT / "versions" / "26.00" / "CPP" / "7zip",
|
||||||
|
"bundle_dir": ROOT / "versions" / "26.00-bundle" / "CPP" / "7zip" / "Bundles" / "Nsis7z",
|
||||||
|
},
|
||||||
|
"26.01": {
|
||||||
|
"vendor_7zip": ROOT / "versions" / "26.01" / "CPP" / "7zip",
|
||||||
|
"bundle_dir": ROOT / "versions" / "26.01-bundle" / "CPP" / "7zip" / "Bundles" / "Nsis7z",
|
||||||
|
},
|
||||||
|
# zstd: make runs in our wrapper dir; vendor_7zip points to submodule tree.
|
||||||
|
"zstd": {
|
||||||
|
"vendor_7zip": ROOT / "versions" / "7-zip-zstd" / "CPP" / "7zip",
|
||||||
|
"bundle_dir": ROOT / "versions" / "zstd-bundle" / "CPP" / "7zip" / "Bundles" / "Nsis7z",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
# Per-version extra flags for GCC/MinGW cross-compilation that apply to both
|
||||||
|
# C and C++ compilations. Passed via LOCAL_FLAGS_EXTRA → merged into CFLAGS
|
||||||
|
# and CXXFLAGS alike.
|
||||||
|
VERSION_EXTRA_FLAGS: dict[str, str] = {
|
||||||
|
# fast-lzma2 (part of the 7-zip-zstd vendor) triggers -Wsign-compare and
|
||||||
|
# -Wcast-function-type on C code that was never compiled with GCC -Werror.
|
||||||
|
"zstd": "-Wno-sign-compare -Wno-cast-function-type",
|
||||||
|
}
|
||||||
|
|
||||||
|
# Per-version C++-only extra flags for GCC/MinGW cross-compilation.
|
||||||
|
# These compensate for vendor code written exclusively for MSVC.
|
||||||
|
# Passed via LOCAL_CXXFLAGS_EXTRA → appended to CXXFLAGS only (not CFLAGS).
|
||||||
|
#
|
||||||
|
# If flag-based suppression is insufficient (e.g. the code must be modified),
|
||||||
|
# place a patched copy at tools/linux/overlay/src/<version>/<relative-path>
|
||||||
|
# and add a rule override in makefile.gcc using the OVERLAY_SRC variable.
|
||||||
|
VERSION_EXTRA_CXXFLAGS: dict[str, str] = {
|
||||||
|
# 7-zip 25.01 NSIS UI code was never compiled with GCC:
|
||||||
|
# - STDMETHODIMP implementations lack `noexcept`/`throw()` while the COM
|
||||||
|
# interface macros (Z7_COM7F_IMP) declare the virtuals with `throw()`
|
||||||
|
# (= noexcept in C++17). Fixed per-TU via -include z7_idecl_noexcept_strip.h
|
||||||
|
# in the specific makefile rule for NsisExtractCallbackConsole.o.
|
||||||
|
# - Several unused parameters and sign-compare on UInt64 vs. literal -1.
|
||||||
|
"25.01": "-Wno-sign-compare -Wno-unused-parameter",
|
||||||
|
# 7-zip-zstd NSIS UI code has the same unused-parameter issues as 25.01.
|
||||||
|
# sign-compare is in C code (fast-lzma2) and already in VERSION_EXTRA_FLAGS;
|
||||||
|
# unused-parameter warnings are C++-only (NSIS wrapper and nsis7z.cpp).
|
||||||
|
"zstd": "-Wno-unused-parameter",
|
||||||
|
}
|
||||||
|
|
||||||
CONFIGS = {
|
CONFIGS = {
|
||||||
"x86-ansi": {
|
"x86-ansi": {
|
||||||
@@ -55,6 +127,30 @@ def _resolve_jobs(value: str) -> int:
|
|||||||
return jobs
|
return jobs
|
||||||
|
|
||||||
|
|
||||||
|
def _ensure_bundle_symlinks(zip_version: str, bundle_dir: Path, vendor_7zip: Path) -> None:
|
||||||
|
"""Recreate bundle symlinks if they are missing (e.g. after a fresh clone).
|
||||||
|
|
||||||
|
Symlinks are no longer committed to git (they are POSIX-only and break
|
||||||
|
Windows clones), so they must be created on-the-fly on Linux before make
|
||||||
|
can resolve the relative source paths inside the bundle directory.
|
||||||
|
"""
|
||||||
|
# A sentinel: if the vendor C/ directory is not reachable via the bundle
|
||||||
|
# root symlink, assume all symlinks need to be (re)created.
|
||||||
|
sentinel = bundle_dir.parents[3] / "C" # bundle/CPP/7zip/../../../C = bundle/C
|
||||||
|
if sentinel.exists():
|
||||||
|
return # symlinks already in place
|
||||||
|
|
||||||
|
setup_script = ROOT / "tools" / "linux" / "setup_bundle_symlinks.py"
|
||||||
|
print(f"[linux] Bundle symlinks missing for {zip_version}, recreating via {setup_script.name} ...")
|
||||||
|
proc = subprocess.run(
|
||||||
|
[sys.executable, str(setup_script), zip_version],
|
||||||
|
cwd=ROOT,
|
||||||
|
)
|
||||||
|
if proc.returncode != 0:
|
||||||
|
print(f"ERROR: setup_bundle_symlinks.py failed for {zip_version}", file=sys.stderr)
|
||||||
|
sys.exit(proc.returncode)
|
||||||
|
|
||||||
|
|
||||||
def _build_one(
|
def _build_one(
|
||||||
zip_version: str,
|
zip_version: str,
|
||||||
cfg_name: str,
|
cfg_name: str,
|
||||||
@@ -62,18 +158,26 @@ def _build_one(
|
|||||||
jobs: int,
|
jobs: int,
|
||||||
clean: bool,
|
clean: bool,
|
||||||
cleanup_artifacts: bool,
|
cleanup_artifacts: bool,
|
||||||
|
dist: bool = False,
|
||||||
) -> int:
|
) -> int:
|
||||||
|
layout = VERSION_LAYOUT[zip_version]
|
||||||
|
vendor_7zip = layout["vendor_7zip"]
|
||||||
|
bundle_dir = layout["bundle_dir"]
|
||||||
|
|
||||||
|
# Symlinks are not committed to git; recreate them on Linux if missing.
|
||||||
|
# Serialized: concurrent per-config builds would race here.
|
||||||
|
if zip_version in VERSION_LAYOUT:
|
||||||
|
with _SYMLINK_LOCK:
|
||||||
|
_ensure_bundle_symlinks(zip_version, bundle_dir, vendor_7zip)
|
||||||
|
|
||||||
cfg = CONFIGS[cfg_name]
|
cfg = CONFIGS[cfg_name]
|
||||||
triplet = cfg["triplet"]
|
triplet = cfg["triplet"]
|
||||||
|
|
||||||
bundle_dir = ROOT / "versions" / zip_version / "CPP" / "7zip" / "Bundles" / "Nsis7z"
|
# Output objects go to an absolute path under _linux_build/ so nothing
|
||||||
cpp_root = ROOT / "versions" / zip_version / "CPP"
|
# temporary is ever written into the vendor source trees.
|
||||||
makefile = bundle_dir / "makefile.gcc"
|
out_dir = BUILD_DIR / zip_version / cfg_name
|
||||||
if not makefile.exists():
|
out_dir.mkdir(parents=True, exist_ok=True)
|
||||||
print(f"ERROR: Linux makefile not found: {makefile}", file=sys.stderr)
|
|
||||||
return 1
|
|
||||||
|
|
||||||
out_obj = f"_o_{cfg_name.replace('-', '_')}"
|
|
||||||
local_flags = "-DNDEBUG"
|
local_flags = "-DNDEBUG"
|
||||||
if cfg["unicode"]:
|
if cfg["unicode"]:
|
||||||
local_flags += " -DUNICODE -D_UNICODE"
|
local_flags += " -DUNICODE -D_UNICODE"
|
||||||
@@ -82,11 +186,36 @@ def _build_one(
|
|||||||
# build so that LPTSTR resolves to char* consistently in all TUs.
|
# build so that LPTSTR resolves to char* consistently in all TUs.
|
||||||
local_flags += " -DZ7_NO_UNICODE"
|
local_flags += " -DZ7_NO_UNICODE"
|
||||||
|
|
||||||
|
# Version-specific workarounds for vendor code that was MSVC-only.
|
||||||
|
# Flags that are C++-only (e.g. -fpermissive) must go into LOCAL_CXXFLAGS_EXTRA
|
||||||
|
# which the makefile appends only to CXXFLAGS, not to CFLAGS.
|
||||||
|
extra_flags = VERSION_EXTRA_FLAGS.get(zip_version, "")
|
||||||
|
extra_cxx = VERSION_EXTRA_CXXFLAGS.get(zip_version, "")
|
||||||
|
|
||||||
|
# CXX_INCLUDE_FLAGS:
|
||||||
|
# 1. overlay/include – case-sensitivity shims (Windows.h → windows.h, …)
|
||||||
|
# searched first so they shadow the actual MinGW system headers.
|
||||||
|
# 2. CPP root – so vendor #include paths resolve from any working dir.
|
||||||
|
cpp_root = vendor_7zip.parent # …/CPP
|
||||||
|
overlay_inc = OVERLAY / "include"
|
||||||
|
|
||||||
|
# For bundle-based builds (zstd, 26.01) the UI/NSIS wrapper files live in
|
||||||
|
# our bundle dir, not in the vendor tree. Override NSIS_DIR accordingly.
|
||||||
|
bundle_nsis = bundle_dir.parent.parent / "UI" / "NSIS"
|
||||||
|
|
||||||
|
# The 7-zip-zstd vendor calls LocalFileTimeToFileTime2() which is defined
|
||||||
|
# in MyWindows.cpp. That TU is normally excluded from SYS_OBJS when
|
||||||
|
# IS_MINGW=1, so we must inject it back via EXTRA_SYS_OBJS.
|
||||||
|
extra_sys_objs = f"{out_dir}/MyWindows.o" if zip_version == "zstd" else ""
|
||||||
|
|
||||||
base_cmd = [
|
base_cmd = [
|
||||||
"make",
|
"make",
|
||||||
"-f",
|
"-C", str(bundle_dir),
|
||||||
"makefile.gcc",
|
"-f", str(OVERLAY / "makefile.gcc"),
|
||||||
f"O={out_obj}",
|
f"O={out_dir}",
|
||||||
|
f"DEF_FILE={OVERLAY / 'Nsis7z.def'}",
|
||||||
|
f"VENDOR_7ZIP={vendor_7zip}",
|
||||||
|
*([ f"NSIS_DIR={bundle_nsis}" ] if bundle_nsis.is_dir() else []),
|
||||||
"SystemDrive=1",
|
"SystemDrive=1",
|
||||||
"IS_MINGW=1",
|
"IS_MINGW=1",
|
||||||
"MSYSTEM=LINUX",
|
"MSYSTEM=LINUX",
|
||||||
@@ -94,8 +223,14 @@ def _build_one(
|
|||||||
f"CC={triplet}-gcc",
|
f"CC={triplet}-gcc",
|
||||||
f"CXX={triplet}-g++",
|
f"CXX={triplet}-g++",
|
||||||
f"RC={triplet}-windres",
|
f"RC={triplet}-windres",
|
||||||
f"LOCAL_FLAGS_EXTRA={local_flags} -Wno-unknown-pragmas",
|
f"LOCAL_FLAGS_EXTRA={local_flags} -Wno-unknown-pragmas {extra_flags}".rstrip(),
|
||||||
f"CXX_INCLUDE_FLAGS=-I{cpp_root}",
|
f"LOCAL_CXXFLAGS_EXTRA={extra_cxx}",
|
||||||
|
*([ f"EXTRA_SYS_OBJS={extra_sys_objs}" ] if extra_sys_objs else []),
|
||||||
|
# Linux ld is case-sensitive; vendor makefile uses mixed-case lib names
|
||||||
|
# (lUser32, lOle32, …) that don't exist on disk. Override LIB2 with
|
||||||
|
# fully-expanded lowercase equivalents.
|
||||||
|
"LIB2=-loleaut32 -luuid -ladvapi32 -luser32 -lole32 -lgdi32 -lcomctl32 -lcomdlg32 -lshell32 -lhtmlhelp",
|
||||||
|
f"CXX_INCLUDE_FLAGS=-I{overlay_inc} -I{cpp_root}",
|
||||||
]
|
]
|
||||||
|
|
||||||
build_mode = "clean build" if clean else "incremental build"
|
build_mode = "clean build" if clean else "incremental build"
|
||||||
@@ -113,32 +248,55 @@ def _build_one(
|
|||||||
if proc.returncode != 0:
|
if proc.returncode != 0:
|
||||||
return proc.returncode
|
return proc.returncode
|
||||||
|
|
||||||
built = bundle_dir / out_obj / "nsis7z.dll"
|
built = out_dir / "nsis7z.dll"
|
||||||
if not built.exists():
|
if not built.exists():
|
||||||
print(f"ERROR: expected artifact not found: {built}", file=sys.stderr)
|
print(f"ERROR: expected artifact not found: {built}", file=sys.stderr)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
dest = ROOT / cfg["dest"]
|
rel_dest = cfg["dest"]
|
||||||
|
if dist and rel_dest.startswith("plugins/"):
|
||||||
|
rel_dest = "dist/" + rel_dest[len("plugins/"):]
|
||||||
|
dest = ROOT / rel_dest
|
||||||
dest.parent.mkdir(parents=True, exist_ok=True)
|
dest.parent.mkdir(parents=True, exist_ok=True)
|
||||||
shutil.copy2(built, dest)
|
shutil.copy2(built, dest)
|
||||||
|
|
||||||
if cleanup_artifacts:
|
if cleanup_artifacts:
|
||||||
shutil.rmtree(bundle_dir / out_obj, ignore_errors=True)
|
shutil.rmtree(out_dir, ignore_errors=True)
|
||||||
|
|
||||||
if verbose:
|
if verbose:
|
||||||
print(f"[linux] Copied -> {dest}")
|
print(f"[linux] Copied -> {dest}")
|
||||||
if cleanup_artifacts:
|
if cleanup_artifacts:
|
||||||
print(f"[linux] Cleaned build artifacts -> {bundle_dir / out_obj}")
|
print(f"[linux] Cleaned build artifacts -> {out_dir}")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
def _print_timing(
|
||||||
|
order: list[str],
|
||||||
|
codes: dict[str, int],
|
||||||
|
durations: dict[str, float],
|
||||||
|
wall: float,
|
||||||
|
) -> None:
|
||||||
|
"""Per-config + total wall-clock timing summary."""
|
||||||
|
print("\n" + "=" * 50)
|
||||||
|
print("[linux] Build timing")
|
||||||
|
print("-" * 50)
|
||||||
|
for cfg in order:
|
||||||
|
status = "OK " if codes.get(cfg) == 0 else "FAIL"
|
||||||
|
secs = durations.get(cfg)
|
||||||
|
secs_s = f"{secs:6.1f}s" if secs is not None else " N/A"
|
||||||
|
print(f" {status} {cfg:<13} {secs_s}")
|
||||||
|
print("-" * 50)
|
||||||
|
print(f" TOTAL wall clock {wall:6.1f}s")
|
||||||
|
print("=" * 50)
|
||||||
|
|
||||||
|
|
||||||
def main() -> int:
|
def main() -> int:
|
||||||
parser = argparse.ArgumentParser(description="Linux build path for nsis7z")
|
parser = argparse.ArgumentParser(description="Linux build path for nsis7z")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--7zip-version",
|
"--7zip-version",
|
||||||
dest="zip_version",
|
dest="zip_version",
|
||||||
choices=["19.00", "25.01", "26.00", "zstd"],
|
choices=sorted(SUPPORTED),
|
||||||
default="26.00",
|
default="26.01",
|
||||||
help="7-Zip version to build",
|
help="7-Zip version to build",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
@@ -178,16 +336,26 @@ def main() -> int:
|
|||||||
help="Keep per-config build artifact directories (_o_*)",
|
help="Keep per-config build artifact directories (_o_*)",
|
||||||
)
|
)
|
||||||
parser.add_argument("--verbose", action="store_true", help="Verbose output")
|
parser.add_argument("--verbose", action="store_true", help="Verbose output")
|
||||||
|
parser.add_argument(
|
||||||
|
"--dist",
|
||||||
|
action="store_true",
|
||||||
|
help="Copy built DLLs to <repo>/dist/<config> instead of "
|
||||||
|
"<repo>/plugins/<config>",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--parallel",
|
||||||
|
action="store_true",
|
||||||
|
default=True,
|
||||||
|
help="Build configs concurrently (default: True)",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--no-parallel",
|
||||||
|
action="store_false",
|
||||||
|
dest="parallel",
|
||||||
|
help="Build configs one at a time",
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.zip_version not in SUPPORTED:
|
|
||||||
print(
|
|
||||||
"ERROR: Linux local build is currently supported only for 26.00. "
|
|
||||||
f"Requested: {args.zip_version}",
|
|
||||||
file=sys.stderr,
|
|
||||||
)
|
|
||||||
return 2
|
|
||||||
|
|
||||||
_require_tool("make")
|
_require_tool("make")
|
||||||
for cfg in CONFIGS.values():
|
for cfg in CONFIGS.values():
|
||||||
_require_tool(f"{cfg['triplet']}-gcc")
|
_require_tool(f"{cfg['triplet']}-gcc")
|
||||||
@@ -202,17 +370,61 @@ def main() -> int:
|
|||||||
|
|
||||||
wanted = list(CONFIGS.keys()) if "all" in args.configs else args.configs
|
wanted = list(CONFIGS.keys()) if "all" in args.configs else args.configs
|
||||||
|
|
||||||
for cfg_name in wanted:
|
if args.parallel and len(wanted) > 1:
|
||||||
code = _build_one(
|
# Each config gets the FULL make -j (no //nconfigs split). The
|
||||||
args.zip_version,
|
# configs are independent; mild CPU oversubscription is handled
|
||||||
cfg_name,
|
# by the scheduler and is still far faster than serial — this is
|
||||||
args.verbose,
|
# exactly what the Windows (MSBuild) parallel build does, which
|
||||||
jobs,
|
# finishes in ~2min on the same vCPU/RAM. Splitting -j across
|
||||||
args.clean,
|
# configs neutered intra-config parallelism (on a 4-vCPU VM it
|
||||||
args.cleanup_artifacts,
|
# became make -j1) and gave no speedup.
|
||||||
|
per_jobs = jobs
|
||||||
|
print(
|
||||||
|
f"[linux] Building {len(wanted)} configs in parallel "
|
||||||
|
f"(make -j{per_jobs} each)"
|
||||||
)
|
)
|
||||||
if code != 0:
|
codes: dict[str, int] = {}
|
||||||
return code
|
durations: dict[str, float] = {}
|
||||||
|
|
||||||
|
def _timed(cfg: str, jb: int) -> None:
|
||||||
|
t0 = time.perf_counter()
|
||||||
|
codes[cfg] = _build_one(
|
||||||
|
args.zip_version, cfg, args.verbose, jb,
|
||||||
|
args.clean, args.cleanup_artifacts, args.dist,
|
||||||
|
)
|
||||||
|
durations[cfg] = time.perf_counter() - t0
|
||||||
|
|
||||||
|
wall0 = time.perf_counter()
|
||||||
|
with ThreadPoolExecutor(max_workers=len(wanted)) as ex:
|
||||||
|
futs = [ex.submit(_timed, c, per_jobs) for c in wanted]
|
||||||
|
for fut in futs:
|
||||||
|
fut.result()
|
||||||
|
wall = time.perf_counter() - wall0
|
||||||
|
_print_timing(wanted, codes, durations, wall)
|
||||||
|
for name in wanted:
|
||||||
|
if codes[name] != 0:
|
||||||
|
return codes[name]
|
||||||
|
else:
|
||||||
|
codes = {}
|
||||||
|
durations = {}
|
||||||
|
wall0 = time.perf_counter()
|
||||||
|
for cfg_name in wanted:
|
||||||
|
t0 = time.perf_counter()
|
||||||
|
codes[cfg_name] = _build_one(
|
||||||
|
args.zip_version,
|
||||||
|
cfg_name,
|
||||||
|
args.verbose,
|
||||||
|
jobs,
|
||||||
|
args.clean,
|
||||||
|
args.cleanup_artifacts,
|
||||||
|
args.dist,
|
||||||
|
)
|
||||||
|
durations[cfg_name] = time.perf_counter() - t0
|
||||||
|
if codes[cfg_name] != 0:
|
||||||
|
_print_timing(wanted, codes, durations,
|
||||||
|
time.perf_counter() - wall0)
|
||||||
|
return codes[cfg_name]
|
||||||
|
_print_timing(wanted, codes, durations, time.perf_counter() - wall0)
|
||||||
|
|
||||||
print("[linux] Build completed")
|
print("[linux] Build completed")
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
/* Linux/MinGW cross-build shim: CommCtrl.h → commctrl.h
|
||||||
|
* Uses #include_next so this shim is skipped on the recursive search,
|
||||||
|
* forwarding to the real MinGW system commctrl.h without infinite recursion. */
|
||||||
|
#pragma GCC system_header
|
||||||
|
#include_next <commctrl.h>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
/* Linux/MinGW cross-build shim: MAPI.h → mapi.h
|
||||||
|
* Uses #include_next so this shim is skipped on the recursive search,
|
||||||
|
* forwarding to the real MinGW system mapi.h without infinite recursion. */
|
||||||
|
#pragma GCC system_header
|
||||||
|
#include_next <mapi.h>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
/* Linux/MinGW cross-build shim: NTSecAPI.h → ntsecapi.h
|
||||||
|
* Uses #include_next so this shim is skipped on the recursive search,
|
||||||
|
* forwarding to the real MinGW system ntsecapi.h without infinite recursion. */
|
||||||
|
#pragma GCC system_header
|
||||||
|
#include_next <ntsecapi.h>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
/* Linux/MinGW cross-build shim: Psapi.h → psapi.h
|
||||||
|
* Uses #include_next so this shim is skipped on the recursive search,
|
||||||
|
* forwarding to the real MinGW system psapi.h without infinite recursion. */
|
||||||
|
#pragma GCC system_header
|
||||||
|
#include_next <psapi.h>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
/* Linux/MinGW cross-build shim: ShlObj.h → shlobj.h
|
||||||
|
* Uses #include_next so this shim is skipped on the recursive search,
|
||||||
|
* forwarding to the real MinGW system shlobj.h without infinite recursion. */
|
||||||
|
#pragma GCC system_header
|
||||||
|
#include_next <shlobj.h>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
/* Linux/MinGW cross-build shim: Windows.h → windows.h
|
||||||
|
* Uses #include_next so this shim is skipped on the recursive search,
|
||||||
|
* forwarding to the real MinGW system windows.h without infinite recursion. */
|
||||||
|
#pragma GCC system_header
|
||||||
|
#include_next <windows.h>
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
#pragma GCC system_header
|
||||||
|
/*
|
||||||
|
* Linux/MinGW cross-build shim for 7-zip 25.01 UI/NSIS sources.
|
||||||
|
*
|
||||||
|
* In 25.01, IDecl.h defines Z7_COM7F_E as throw(). Under GCC/C++17,
|
||||||
|
* throw() is treated as noexcept, causing a hard "different exception
|
||||||
|
* specifier" error when STDMETHODIMP out-of-class definitions (which carry
|
||||||
|
* no exception spec) are compiled against class declarations that used the
|
||||||
|
* noexcept-bearing Z7_COM7F_IMF macro.
|
||||||
|
*
|
||||||
|
* Strategy (no vendor files modified):
|
||||||
|
* 1. Include IDecl.h now so its include guard (ZIP7_INC_IDECL_H) is set.
|
||||||
|
* Subsequent indirect includes of IDecl.h from the source file will be
|
||||||
|
* no-ops.
|
||||||
|
* 2. Immediately undefine Z7_COM7F_E and redefine it as empty.
|
||||||
|
* Because the preprocessor expands macros lazily (at use site, not at
|
||||||
|
* definition site), all Z7_COM7F_IMF / Z7_COM7F_EO usages that follow
|
||||||
|
* will pick up the empty definition, producing declarations with no
|
||||||
|
* exception specifier — matching the STDMETHODIMP definitions.
|
||||||
|
*/
|
||||||
|
#include "7zip/IDecl.h" /* searched via -I$(CPP_ROOT); resolves to versions/<ver>/CPP/7zip/IDecl.h */
|
||||||
|
|
||||||
|
#undef Z7_COM7F_E
|
||||||
|
#define Z7_COM7F_E /* empty – no exception specifier */
|
||||||
|
|
||||||
|
/* Cascade: Z7_COM7F_EO and Z7_COM7F_EOF reference Z7_COM7F_E by name,
|
||||||
|
* so they pick it up automatically. Redefine them explicitly to avoid
|
||||||
|
* "macro redefined" warnings if they were already expanded anywhere. */
|
||||||
|
#undef Z7_COM7F_EO
|
||||||
|
#define Z7_COM7F_EO Z7_COM7F_E Z7_override
|
||||||
|
|
||||||
|
#undef Z7_COM7F_EOF
|
||||||
|
#define Z7_COM7F_EOF Z7_COM7F_EO Z7_final
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
PROG = nsis7z
|
||||||
|
|
||||||
|
# Path to the vendor CPP/7zip tree. Override from the command line for
|
||||||
|
# out-of-tree builds (e.g. zstd variant whose sources live in a separate
|
||||||
|
# submodule directory):
|
||||||
|
# make -f .../overlay/makefile.gcc VENDOR_7ZIP=/abs/path/7-zip-zstd/CPP/7zip
|
||||||
|
VENDOR_7ZIP ?= ../..
|
||||||
|
|
||||||
|
# Path to the UI/NSIS source directory. For versions where NSIS files live
|
||||||
|
# in the vendor tree this defaults to $(VENDOR_7ZIP)/UI/NSIS. Override for
|
||||||
|
# bundle-based builds (zstd, 26.01) where UI/NSIS lives in our wrapper dir.
|
||||||
|
NSIS_DIR ?= $(VENDOR_7ZIP)/UI/NSIS
|
||||||
|
|
||||||
|
# DEF file path – may be overridden to an absolute path so that this
|
||||||
|
# makefile can be used with -f without writing anything into the vendor tree.
|
||||||
|
DEF_FILE ?= Nsis7z.def
|
||||||
|
|
||||||
|
include $(VENDOR_7ZIP)/Bundles/Format7zF/Arc_gcc.mak
|
||||||
|
|
||||||
|
ifdef IS_MINGW
|
||||||
|
LOCAL_FLAGS_SYS = -DZ7_DEVICE_FILE
|
||||||
|
SYS_OBJS = \
|
||||||
|
$O/DLL.o \
|
||||||
|
$O/DllSecur.o \
|
||||||
|
$O/resource.o \
|
||||||
|
|
||||||
|
else
|
||||||
|
SYS_OBJS = \
|
||||||
|
$O/MyWindows.o \
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
LOCAL_FLAGS += \
|
||||||
|
$(LOCAL_FLAGS_SYS) \
|
||||||
|
$(LOCAL_FLAGS_EXTRA) \
|
||||||
|
|
||||||
|
# C++-only extra flags (e.g. -fpermissive for MSVC-only code).
|
||||||
|
# Appended to CXXFLAGS_EXTRA which is used exclusively by the C++ compiler.
|
||||||
|
CXXFLAGS_EXTRA += $(LOCAL_CXXFLAGS_EXTRA)
|
||||||
|
|
||||||
|
NSIS_UI_OBJS = \
|
||||||
|
$O/NsisMain.o \
|
||||||
|
$O/NsisMainAr.o \
|
||||||
|
$O/NsisBreak.o \
|
||||||
|
$O/NsisExtractCallbackConsole.o \
|
||||||
|
$O/NsisUserInputUtils2.o \
|
||||||
|
$O/ConsoleOpenCallbackConsole.o \
|
||||||
|
$O/ConsolePercentPrinter.o \
|
||||||
|
$O/ConsoleClose.o \
|
||||||
|
$O/ConsoleUserInputUtils.o \
|
||||||
|
$O/Extract.o \
|
||||||
|
$O/HashCalc.o \
|
||||||
|
$O/OpenArchive.o \
|
||||||
|
$O/ArchiveExtractCallback.o \
|
||||||
|
$O/ArchiveOpenCallback.o \
|
||||||
|
$O/DefaultName.o \
|
||||||
|
$O/EnumDirItems.o \
|
||||||
|
$O/ExtractingFilePath.o \
|
||||||
|
$O/LoadCodecs.o \
|
||||||
|
$O/SetProperties.o \
|
||||||
|
$O/FileStreams.o \
|
||||||
|
$O/FileSystem.o \
|
||||||
|
$O/ErrorMsg.o \
|
||||||
|
$O/FileLink.o \
|
||||||
|
$O/FilePathAutoRename.o \
|
||||||
|
$O/SortUtils.o \
|
||||||
|
$O/PropIDUtils.o \
|
||||||
|
|
||||||
|
CURRENT_OBJS = \
|
||||||
|
$O/StdInStream.o \
|
||||||
|
$O/StdOutStream.o \
|
||||||
|
$O/StdAfx2.o \
|
||||||
|
$O/pluginapi.o \
|
||||||
|
$O/nsis7z.o \
|
||||||
|
|
||||||
|
# Optional extra system objects – pass from the command line when the vendor
|
||||||
|
# requires additional translation units that are normally excluded for mingw
|
||||||
|
# (e.g. MyWindows.o for the 7-zip-zstd variant).
|
||||||
|
EXTRA_SYS_OBJS ?=
|
||||||
|
|
||||||
|
OBJS = \
|
||||||
|
$(ARC_OBJS) \
|
||||||
|
$(SYS_OBJS) \
|
||||||
|
$(EXTRA_SYS_OBJS) \
|
||||||
|
$(NSIS_UI_OBJS) \
|
||||||
|
$(CURRENT_OBJS) \
|
||||||
|
|
||||||
|
include $(VENDOR_7ZIP)/7zip_gcc.mak
|
||||||
|
|
||||||
|
$O/NsisMain.o: $(NSIS_DIR)/Main.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) $<
|
||||||
|
|
||||||
|
$O/NsisMainAr.o: $(NSIS_DIR)/MainAr.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) $<
|
||||||
|
|
||||||
|
$O/NsisBreak.o: $(NSIS_DIR)/NSISBreak.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) $<
|
||||||
|
|
||||||
|
$O/NsisExtractCallbackConsole.o: $(NSIS_DIR)/ExtractCallbackConsole.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) -include z7_idecl_noexcept_strip.h $<
|
||||||
|
|
||||||
|
$O/NsisUserInputUtils2.o: $(NSIS_DIR)/UserInputUtils2.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) $<
|
||||||
|
|
||||||
|
$O/ConsoleOpenCallbackConsole.o: $(VENDOR_7ZIP)/UI/Console/OpenCallbackConsole.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) $<
|
||||||
|
|
||||||
|
$O/ConsolePercentPrinter.o: $(VENDOR_7ZIP)/UI/Console/PercentPrinter.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) $<
|
||||||
|
|
||||||
|
$O/ConsoleUserInputUtils.o: $(VENDOR_7ZIP)/UI/Console/UserInputUtils.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) $<
|
||||||
|
|
||||||
|
$O/StdAfx2.o: StdAfx2.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) $<
|
||||||
|
|
||||||
|
$O/pluginapi.o: pluginapi.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) $<
|
||||||
|
|
||||||
|
$O/nsis7z.o: nsis7z.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) $<
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Thin wrapper — delegates to setup_bundle_symlinks.py for version 25.01."""
|
||||||
|
import subprocess, sys, pathlib
|
||||||
|
script = pathlib.Path(__file__).parent / "setup_bundle_symlinks.py"
|
||||||
|
sys.exit(subprocess.call([sys.executable, str(script), "25.01"]))
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Thin wrapper — delegates to setup_bundle_symlinks.py for version 26.00."""
|
||||||
|
import subprocess, sys, pathlib
|
||||||
|
script = pathlib.Path(__file__).parent / "setup_bundle_symlinks.py"
|
||||||
|
sys.exit(subprocess.call([sys.executable, str(script), "26.00"]))
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Thin wrapper — delegates to setup_bundle_symlinks.py for version 26.01."""
|
||||||
|
import subprocess, sys, pathlib
|
||||||
|
script = pathlib.Path(__file__).parent / "setup_bundle_symlinks.py"
|
||||||
|
sys.exit(subprocess.call([sys.executable, str(script), "26.01"]))
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Creates symlinks in versions/<VERSION>-bundle to mirror vendor directory structure.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
python3 setup_bundle_symlinks.py <version>
|
||||||
|
|
||||||
|
Example:
|
||||||
|
python3 setup_bundle_symlinks.py 25.01
|
||||||
|
python3 setup_bundle_symlinks.py 26.00
|
||||||
|
python3 setup_bundle_symlinks.py 26.01
|
||||||
|
python3 setup_bundle_symlinks.py zstd
|
||||||
|
"""
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
print(f"Usage: {sys.argv[0]} <version>", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
version = sys.argv[1]
|
||||||
|
|
||||||
|
# For versions where the vendor directory name differs from the bundle version key.
|
||||||
|
VENDOR_DIR = {
|
||||||
|
"zstd": "7-zip-zstd",
|
||||||
|
}
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[2]
|
||||||
|
bundle_root = ROOT / f"versions/{version}-bundle"
|
||||||
|
vendor_root = ROOT / "versions" / VENDOR_DIR.get(version, version)
|
||||||
|
|
||||||
|
if not vendor_root.exists():
|
||||||
|
print(f"Error: vendor directory not found: {vendor_root}", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
if not bundle_root.exists():
|
||||||
|
print(f"Error: bundle directory not found: {bundle_root}", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
bundle_7zip = bundle_root / "CPP/7zip"
|
||||||
|
vendor_7zip = vendor_root / "CPP/7zip"
|
||||||
|
bundle_cpp = bundle_root / "CPP"
|
||||||
|
vendor_cpp = vendor_root / "CPP"
|
||||||
|
|
||||||
|
# Root-level symlinks: C and Asm
|
||||||
|
for name in ("C", "Asm"):
|
||||||
|
target = bundle_root / name
|
||||||
|
if not target.exists() and not target.is_symlink():
|
||||||
|
rel = os.path.relpath(vendor_root / name, bundle_root)
|
||||||
|
os.symlink(rel, target)
|
||||||
|
print(f" symlink: {target.relative_to(ROOT)} -> {rel}")
|
||||||
|
|
||||||
|
for item in vendor_7zip.iterdir():
|
||||||
|
target = bundle_7zip / item.name
|
||||||
|
if not target.exists() and not target.is_symlink():
|
||||||
|
rel = os.path.relpath(item, bundle_7zip)
|
||||||
|
os.symlink(rel, target)
|
||||||
|
print(f" symlink: {target.relative_to(ROOT)} -> {rel}")
|
||||||
|
|
||||||
|
bundle_ui = bundle_7zip / "UI"
|
||||||
|
vendor_ui = vendor_7zip / "UI"
|
||||||
|
bundle_ui.mkdir(exist_ok=True)
|
||||||
|
for item in vendor_ui.iterdir():
|
||||||
|
target = bundle_ui / item.name
|
||||||
|
if not target.exists() and not target.is_symlink():
|
||||||
|
rel = os.path.relpath(item, bundle_ui)
|
||||||
|
os.symlink(rel, target)
|
||||||
|
print(f" symlink: {target.relative_to(ROOT)} -> {rel}")
|
||||||
|
|
||||||
|
for item in vendor_cpp.iterdir():
|
||||||
|
if item.name == "7zip":
|
||||||
|
continue
|
||||||
|
target = bundle_cpp / item.name
|
||||||
|
if not target.exists() and not target.is_symlink():
|
||||||
|
rel = os.path.relpath(item, bundle_cpp)
|
||||||
|
os.symlink(rel, target)
|
||||||
|
print(f" symlink: {target.relative_to(ROOT)} -> {rel}")
|
||||||
|
|
||||||
|
print("Done")
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
# update_gitea_releases.py
|
||||||
|
|
||||||
|
Script one-shot per aggiornare il body delle release Gitea esistenti con il testo del CHANGELOG.
|
||||||
|
|
||||||
|
## Quando usarlo
|
||||||
|
|
||||||
|
Il workflow `release.yml` aggiorna automaticamente il body delle release **nuove** su Gitea.
|
||||||
|
Questo script serve per le release **giĂ esistenti**, create prima che quella funzionalitĂ fosse aggiunta.
|
||||||
|
|
||||||
|
## Prerequisiti
|
||||||
|
|
||||||
|
- Python 3.8+
|
||||||
|
- Un Gitea API token con permesso **Repository → Read and Write**
|
||||||
|
|
||||||
|
### Creare il token su Gitea
|
||||||
|
|
||||||
|
1. Gitea → avatar → **Settings** → **Applications**
|
||||||
|
2. Sezione **"Manage Access Tokens"** → nome a piacere (es. `release-body-update`)
|
||||||
|
3. Permission: **Repository** → `Read and Write`
|
||||||
|
4. **Generate Token** → copia il valore (mostrato una sola volta)
|
||||||
|
|
||||||
|
## Uso
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Tramite variabile d'ambiente
|
||||||
|
GITEA_TOKEN=<token> python3 tools/update_gitea_releases.py
|
||||||
|
|
||||||
|
# Tramite argomento
|
||||||
|
python3 tools/update_gitea_releases.py --token <token>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output atteso
|
||||||
|
|
||||||
|
```
|
||||||
|
[v2.0.0] recupero release... id=1, aggiorno body... OK
|
||||||
|
[v2.0.1] recupero release... id=2, aggiorno body... OK
|
||||||
|
[v2.1.0] recupero release... id=3, aggiorno body... OK
|
||||||
|
[v2.2.0] recupero release... id=4, aggiorno body... OK
|
||||||
|
[v2.2.1] recupero release... id=5, aggiorno body... OK
|
||||||
|
```
|
||||||
|
|
||||||
|
Se una release non esiste su Gitea per quel tag, la riga mostra `SALTATO`.
|
||||||
|
|
||||||
|
## Come funziona
|
||||||
|
|
||||||
|
Per ogni file `tools/release-notes/vX.Y.Z.md`:
|
||||||
|
|
||||||
|
1. Chiama `GET /api/v1/repos/{owner}/{repo}/releases/tags/vX.Y.Z` per ottenere l'ID
|
||||||
|
2. Chiama `PATCH /api/v1/repos/{owner}/{repo}/releases/{id}` con il body del file `.md`
|
||||||
|
|
||||||
|
## Aggiungere nuove versioni
|
||||||
|
|
||||||
|
Crea un file `tools/release-notes/vX.Y.Z.md` con il contenuto desiderato, poi riesegui lo script.
|
||||||
|
Per le release future il workflow lo fa automaticamente — questo script non è necessario.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
### Added
|
||||||
|
- Prima release come repository indipendente
|
||||||
|
- Build script unificato (`build_plugin.py`) con CLI canonica
|
||||||
|
- CI/CD via GitHub Actions (mirror automatico Gitea → GitHub)
|
||||||
|
- Documentazione completa (README, CONTRIBUTING, SECURITY)
|
||||||
|
|
||||||
|
--
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
### Fixed
|
||||||
|
- Restored `tools/legacy/` build scripts lost from repository
|
||||||
|
- Fixed `UnicodeEncodeError` on CI: replaced Unicode checkmarks with ASCII OK/FAIL in build summary
|
||||||
|
- Fixed MSB8020 toolset error on GitHub Actions: `build_plugin_2600_vs2026.py` now detects the installed VS toolset dynamically (falls back to v143 on VS2022 runners)
|
||||||
|
- Build script for 26.00 selects `Nsis7z_vs2026.vcxproj` (v145) or `Nsis7z.vcxproj` (v143) based on detected toolset
|
||||||
|
|
||||||
|
--
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
### Added
|
||||||
|
- NSIS plugin API (`pluginapi.cpp`/`pluginapi.h`) for 7-Zip zstd build
|
||||||
|
- `ExtractCallbackConsole` class for extraction progress and user input
|
||||||
|
- Main extraction logic (`Main.cpp`, `MainAr.cpp`) for the zstd bundle
|
||||||
|
- User input utilities (`UserInputUtils2`) for password handling and prompts
|
||||||
|
- Break signal handling (`NSISBreak`) for graceful interruption
|
||||||
|
- `Nsis7z_vs2026.vcxproj` (v145 toolset) for Visual Studio 2026 builds
|
||||||
|
- `tools/fix_vcxproj.py` helper for project file patching
|
||||||
|
- `versions/7-zip-zstd` submodule added
|
||||||
|
- `build_zstd.cmd` top-level build script for the zstd variant
|
||||||
|
|
||||||
|
--
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
### Added
|
||||||
|
- Linux MinGW-w64 cross-build support in `build_plugin.py` via `--host linux`
|
||||||
|
- `tools/linux/build_plugin_linux.py` for standalone Linux builds
|
||||||
|
- Color output and progress spinner in all legacy build scripts
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- `build_plugin.py` now supports both Windows (MSBuild) and Linux (MinGW-w64) targets
|
||||||
|
- Windows build-script f-string fixes
|
||||||
|
|
||||||
|
--
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
### Added
|
||||||
|
- Linux CI jobs for the GitHub `build` and `release` workflows using the MinGW-w64 cross-build path
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- GitHub Actions workflows now opt into Node 24 for JavaScript-based actions to avoid Node 20 deprecation warnings
|
||||||
|
|
||||||
|
--
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
### Added
|
||||||
|
- `tools/update_gitea_releases.py`: one-shot script to backfill Gitea release bodies with CHANGELOG content via the Gitea API
|
||||||
|
- `tools/release-notes/`: per-version Markdown snippets used by the backfill script
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Release workflow now extracts the relevant CHANGELOG section and uses it as the GitHub Release body (`body_path`)
|
||||||
|
- Release workflow adds a step to update the corresponding Gitea release body via API (`GITEA_TOKEN` secret)
|
||||||
|
- All GitHub Actions upgraded to node24-native major versions (no more Node 20 deprecation warnings)
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
### Added
|
||||||
|
- Auto-recreation of bundle POSIX symlinks on Linux if missing after a fresh clone (`_ensure_bundle_symlinks()` in `tools/linux/build_plugin_linux.py`)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Default 7-zip version changed from `26.00` to `26.01` in `build_plugin.py` and `tools/linux/build_plugin_linux.py`
|
||||||
|
- Renamed `versions/zstd` → `versions/zstd-bundle` for naming consistency with the other bundle directories
|
||||||
|
- Auto-generated bundle symlinks are now excluded from git tracking (`.gitignore`)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Windows build error `C1083: Cannot open include file` for `Common/Common.h`, `IPassword.h`, `C/Alloc.h` and other vendor headers: added `versions/VER/CPP/7zip/UI/Common/` to `AdditionalIncludeDirectories` in all five bundle vcxproj files (25.01, 26.00, 26.01)
|
||||||
|
- f-string nested-quote syntax errors in all `tools/legacy/` build scripts (patterns `{"="*60}`, `{"-"*50}`, `{'Rebuild' if ...}`): replaced with Python 3.10/3.11-compatible equivalents
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- One-shot `tools/fix_bundle_vcxproj_paths.py` helper (no longer needed)
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
### Added
|
||||||
|
- `tools/update_github_releases.py`: one-shot script to sync GitHub Release bodies via API using local `tools/release-notes/` snippets
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Linux overlay shims (`tools/linux/overlay/include/`) now use `#include_next` instead of `#include` to forward to the real MinGW system header, avoiding infinite preprocessor recursion on Linux/WSL (GCC 12+)
|
||||||
|
- Removed stale prebuilt `plugins/*/nsis7z.dll` binaries from the repository
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
Script: sincronizza le release Gitea con i file in tools/release-notes/.
|
||||||
|
- Se la release esiste → aggiorna il body
|
||||||
|
- Se la release non esiste → la crea (richiede che il tag git esista già )
|
||||||
|
|
||||||
|
Uso:
|
||||||
|
GITEA_TOKEN=<token> python3 tools/update_gitea_releases.py
|
||||||
|
oppure:
|
||||||
|
python3 tools/update_gitea_releases.py --token <token>
|
||||||
|
"""
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import urllib.request
|
||||||
|
import urllib.error
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
GITEA_BASE = "https://gitea.emulab.it/api/v1"
|
||||||
|
REPO = "Simone/nsis-plugin-ns7zip"
|
||||||
|
NOTES_DIR = Path(__file__).parent / "release-notes"
|
||||||
|
|
||||||
|
|
||||||
|
def api(method: str, path: str, token: str, data: dict | None = None) -> dict:
|
||||||
|
url = f"{GITEA_BASE}{path}"
|
||||||
|
body = json.dumps(data).encode() if data else None
|
||||||
|
req = urllib.request.Request(
|
||||||
|
url,
|
||||||
|
data=body,
|
||||||
|
method=method,
|
||||||
|
headers={
|
||||||
|
"Authorization": f"token {token}",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Accept": "application/json",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
with urllib.request.urlopen(req) as resp:
|
||||||
|
return json.loads(resp.read())
|
||||||
|
except urllib.error.HTTPError as e:
|
||||||
|
print(f" HTTP {e.code} {e.reason} — {e.read().decode()}", file=sys.stderr)
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
parser = argparse.ArgumentParser(description="Update Gitea release bodies")
|
||||||
|
parser.add_argument("--token", default=os.environ.get("GITEA_TOKEN"), help="Gitea API token")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if not args.token:
|
||||||
|
sys.exit("Errore: token mancante. Usa --token oppure imposta GITEA_TOKEN.")
|
||||||
|
|
||||||
|
print("Recupero lista release da Gitea...", flush=True)
|
||||||
|
try:
|
||||||
|
releases = api("GET", f"/repos/{REPO}/releases?limit=50", args.token)
|
||||||
|
except urllib.error.HTTPError:
|
||||||
|
sys.exit("Errore nel recupero delle release.")
|
||||||
|
|
||||||
|
existing = {r["tag_name"]: r["id"] for r in releases}
|
||||||
|
|
||||||
|
note_files = sorted(NOTES_DIR.glob("v*.md"))
|
||||||
|
if not note_files:
|
||||||
|
sys.exit(f"Nessun file trovato in {NOTES_DIR}")
|
||||||
|
|
||||||
|
for note_path in note_files:
|
||||||
|
tag = note_path.stem
|
||||||
|
body = note_path.read_text(encoding="utf-8").strip()
|
||||||
|
|
||||||
|
if tag in existing:
|
||||||
|
release_id = existing[tag]
|
||||||
|
print(f"[{tag}] id={release_id}, aggiorno body...", end=" ", flush=True)
|
||||||
|
try:
|
||||||
|
api("PATCH", f"/repos/{REPO}/releases/{release_id}", args.token, {"body": body})
|
||||||
|
print("OK")
|
||||||
|
except urllib.error.HTTPError:
|
||||||
|
print("FALLITO")
|
||||||
|
else:
|
||||||
|
print(f"[{tag}] release non trovata, creo...", end=" ", flush=True)
|
||||||
|
try:
|
||||||
|
result = api("POST", f"/repos/{REPO}/releases", args.token, {
|
||||||
|
"tag_name": tag,
|
||||||
|
"name": tag,
|
||||||
|
"body": body,
|
||||||
|
"draft": False,
|
||||||
|
"prerelease": False,
|
||||||
|
})
|
||||||
|
print(f"OK (id={result['id']})")
|
||||||
|
except urllib.error.HTTPError:
|
||||||
|
print("FALLITO (il tag git esiste su Gitea?)")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
Script: sincronizza i body delle release GitHub con i file in tools/release-notes/.
|
||||||
|
- Se la release esiste → aggiorna il body
|
||||||
|
- Se la release non esiste → la salta (le release GitHub vengono create dal workflow CI)
|
||||||
|
|
||||||
|
Uso:
|
||||||
|
GITHUB_TOKEN=<token> python3 tools/update_github_releases.py
|
||||||
|
oppure:
|
||||||
|
python3 tools/update_github_releases.py --token <token>
|
||||||
|
|
||||||
|
Richiede un PAT GitHub con permesso 'contents: write' sul repo.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import urllib.request
|
||||||
|
import urllib.error
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
GITHUB_BASE = "https://api.github.com"
|
||||||
|
REPO = "systempal/nsis-plugin-ns7zip"
|
||||||
|
NOTES_DIR = Path(__file__).parent / "release-notes"
|
||||||
|
|
||||||
|
|
||||||
|
def api(method: str, path: str, token: str, data: dict | None = None) -> dict:
|
||||||
|
url = f"{GITHUB_BASE}{path}"
|
||||||
|
body = json.dumps(data).encode() if data else None
|
||||||
|
req = urllib.request.Request(
|
||||||
|
url,
|
||||||
|
data=body,
|
||||||
|
method=method,
|
||||||
|
headers={
|
||||||
|
"Authorization": f"token {token}",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Accept": "application/vnd.github+json",
|
||||||
|
"X-GitHub-Api-Version": "2022-11-28",
|
||||||
|
"User-Agent": "update_github_releases/1.0",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
with urllib.request.urlopen(req) as resp:
|
||||||
|
return json.loads(resp.read())
|
||||||
|
except urllib.error.HTTPError as e:
|
||||||
|
print(f" HTTP {e.code} {e.reason} — {e.read().decode()}", file=sys.stderr)
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
parser = argparse.ArgumentParser(description="Update GitHub release bodies")
|
||||||
|
parser.add_argument("--token", default=os.environ.get("GITHUB_TOKEN"), help="GitHub API token")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if not args.token:
|
||||||
|
sys.exit("Errore: token mancante. Usa --token oppure imposta GITHUB_TOKEN.")
|
||||||
|
|
||||||
|
note_files = sorted(NOTES_DIR.glob("v*.md"))
|
||||||
|
if not note_files:
|
||||||
|
sys.exit(f"Nessun file trovato in {NOTES_DIR}")
|
||||||
|
|
||||||
|
for note_path in note_files:
|
||||||
|
tag = note_path.stem
|
||||||
|
body = note_path.read_text(encoding="utf-8").strip()
|
||||||
|
|
||||||
|
print(f"[{tag}] recupero release...", end=" ", flush=True)
|
||||||
|
try:
|
||||||
|
release = api("GET", f"/repos/{REPO}/releases/tags/{tag}", args.token)
|
||||||
|
except urllib.error.HTTPError as e:
|
||||||
|
if e.code == 404:
|
||||||
|
print("SALTATO (release non trovata su GitHub)")
|
||||||
|
else:
|
||||||
|
print("ERRORE")
|
||||||
|
continue
|
||||||
|
|
||||||
|
release_id = release["id"]
|
||||||
|
print(f"id={release_id}, aggiorno body...", end=" ", flush=True)
|
||||||
|
try:
|
||||||
|
api("PATCH", f"/repos/{REPO}/releases/{release_id}", args.token, {"body": body})
|
||||||
|
print("OK")
|
||||||
|
except urllib.error.HTTPError:
|
||||||
|
print("FALLITO")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
Submodule
+1
Submodule versions/25.01 added at 5e96a82794
@@ -0,0 +1,929 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="15.0"
|
||||||
|
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug Unicode|Win32">
|
||||||
|
<Configuration>Debug Unicode</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug Unicode|x64">
|
||||||
|
<Configuration>Debug Unicode</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release Unicode|Win32">
|
||||||
|
<Configuration>Release Unicode</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release Unicode|x64">
|
||||||
|
<Configuration>Release Unicode</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<SccProjectName />
|
||||||
|
<SccLocalPath />
|
||||||
|
<ProjectGuid>{A284C1EF-6CA9-4984-A25F-83B22C85A5EC}</ProjectGuid>
|
||||||
|
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'"
|
||||||
|
Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'"
|
||||||
|
Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'"
|
||||||
|
Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'"
|
||||||
|
Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'"
|
||||||
|
Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'"
|
||||||
|
Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'"
|
||||||
|
Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'"
|
||||||
|
Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<TargetName>nsis7z</TargetName>
|
||||||
|
<OutDir>$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(Configuration)\</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<TargetName>nsis7z</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<TargetName>nsis7z</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<TargetName>nsis7z</TargetName>
|
||||||
|
<OutDir>$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(Configuration)\</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<TargetName>nsis7z</TargetName>
|
||||||
|
<OutDir>$(Platform)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<TargetName>nsis7z</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<Optimization>MinSpace</Optimization>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<AssemblerOutput>AssemblyAndMachineCode</AssemblerOutput>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<DebugInformationFormat>None</DebugInformationFormat>
|
||||||
|
<DisableSpecificWarnings>4100</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\Release\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\Release\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<GenerateDebugInformation>No</GenerateDebugInformation>
|
||||||
|
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<Optimization>MinSpace</Optimization>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<AssemblerOutput>AssemblyAndMachineCode</AssemblerOutput>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\Release\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\Release\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level4</WarningLevel>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;UNICODE;WIN32;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\DebugU\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\DebugU\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level4</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;UNICODE;WIN32;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\DebugU\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\DebugU\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<Optimization>MinSpace</Optimization>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level4</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;UNICODE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<DebugInformationFormat>None</DebugInformationFormat>
|
||||||
|
<DisableSpecificWarnings>4100</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\ReleaseU\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\ReleaseU\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<GenerateDebugInformation>No</GenerateDebugInformation>
|
||||||
|
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<Optimization>MinSpace</Optimization>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level4</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;UNICODE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<DebugInformationFormat>None</DebugInformationFormat>
|
||||||
|
<DisableSpecificWarnings>4100</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\ReleaseU\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\ReleaseU\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<GenerateDebugInformation>No</GenerateDebugInformation>
|
||||||
|
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;WIN32;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\Debug\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\Debug\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;WIN32;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\Debug\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\Debug\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7z.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7zAlloc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7zBuf.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7zCrc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7zFile.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7zTypes.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7zVersion.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Aes.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Alloc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Bcj2.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Bra.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Compiler.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\CpuArch.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Delta.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\LzFind.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\LzFindMt.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\LzHash.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Lzma2Dec.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Lzma2DecMt.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Lzma2Enc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Lzma86.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\LzmaDec.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\LzmaEnc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\LzmaLib.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\MtCoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\MtDec.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Ppmd.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Ppmd7.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Precomp.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\RotateDefs.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Sha256.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Sort.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Threads.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Xz.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\XzCrc64.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\XzEnc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\COM.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\CommonDialog.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\ErrorMsg.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\FileSystem.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\NtCheck.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\PropVariantConv.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Registry.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\ResourceString.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\SecurityUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Shell.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\TimeUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Window.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zCompressionMode.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zDecode.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zEncode.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zFolderInStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zHandler.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zHeader.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zIn.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zItem.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zOut.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zProperties.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zSpecStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zUpdate.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\CoderMixer2.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\DummyOutStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\HandlerOut.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\InStreamWithCRC.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\ItemNameUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\MultiStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\OutStreamWithCRC.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\ParseProperties.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\CreateCoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\CWrappers.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\FilePathAutoRename.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\FileStreams.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\FilterCoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\InBuffer.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\InOutTempBuffer.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\LimitedStreams.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\LockedStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\MethodId.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\MethodProps.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\OffsetStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\OutBuffer.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\ProgressUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\RegisterArc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\RegisterCodec.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\StreamBinder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\StreamObjects.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\StreamUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\UniqBlocks.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\VirtThread.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Bcj2Coder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BcjCoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BranchMisc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\CopyCoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Lzma2Decoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Lzma2Encoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzmaDecoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzmaEncoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\XzDecoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\XzEncoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveName.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\DirItem.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ExitCode.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ExtractMode.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\HashCalc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\IFileExtractCallback.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ZipRegistry.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\ConsoleClose.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\OpenCallbackConsole.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\PercentPrinter.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\UserInputUtils.h" />
|
||||||
|
<ClInclude Include="..\..\UI\NSIS\ExtractCallbackConsole.h" />
|
||||||
|
<ClInclude Include="..\..\UI\NSIS\NSISBreak.h" />
|
||||||
|
<ClInclude Include="..\..\UI\NSIS\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\UI\NSIS\UserInputUtils2.h" />
|
||||||
|
<ClInclude Include="api.h" />
|
||||||
|
<ClInclude Include="nsis_tchar.h" />
|
||||||
|
<ClInclude Include="pluginapi.h" />
|
||||||
|
<ClInclude Include="resource.h" />
|
||||||
|
<ClInclude Include="StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\AutoPtr.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\CommandLineParser.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\ComTry.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\Defs.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\DynamicBuffer.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\IntToString.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\ListFileUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyCom.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyException.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyGuidDef.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyInitGuid.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyString.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyUnknown.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyVector.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\NewHandler.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\StdInStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\StdOutStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\StringConvert.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\StringToInt.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\UTFConvert.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\Wildcard.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Defs.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\DLL.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\FileDir.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\FileFind.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\FileIO.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\FileMapping.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\FileName.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Handle.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\MemoryLock.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\PropVariant.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Synchronization.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\System.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Thread.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveCommandLine.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveExtractCallback.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveOpenCallback.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Bench.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\DefaultName.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\EnumDirItems.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Extract.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ExtractingFilePath.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\LoadCodecs.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\OpenArchive.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Property.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\PropIDUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\SetProperties.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\SortUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\TempFiles.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Update.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdateAction.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdateCallback.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdatePair.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdateProduce.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\ICoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\IMyUnknown.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\IPassword.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\IProgress.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\IStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\PropID.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zAlloc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zArcIn.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zBuf.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zBuf2.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zCrc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zCrcOpt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zDec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zFile.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zStream.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Aes.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\AesOpt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Alloc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Bcj2.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Bcj2Enc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Bra.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Bra86.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\BraIA64.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\CpuArch.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Delta.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\LzFind.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\LzFindMt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\LzFindOpt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Lzma2Dec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Lzma2DecMt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Lzma2Enc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Lzma86Dec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Lzma86Enc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\LzmaDec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\LzmaEnc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\LzmaLib.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\MtCoder.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\MtDec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Ppmd7.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Ppmd7Dec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Ppmd7Enc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Ppmd8.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Ppmd8Dec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Ppmd8Enc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Sha256.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Sha256Opt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Sha1.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Sha1Opt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Sort.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\SwapBytes.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Threads.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Xz.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\XzCrc64.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\XzCrc64Opt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\XzDec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\XzEnc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\XzIn.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\ZstdDec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Xxh64.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\HuffEnc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\CommonDialog.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\ErrorMsg.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileLink.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileMapping.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileSystem.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\PropVariantConv.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\PropVariantUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\Registry.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\ResourceString.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\SecurityUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\Shell.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\TimeUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\Window.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zCompressionMode.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zDecode.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zEncode.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zExtract.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zFolderInStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zHandlerOut.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zHeader.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zIn.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zOut.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zProperties.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zSpecStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zUpdate.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\StdAfx.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\CoderMixer2.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\DummyOutStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\HandlerOut.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\InStreamWithCRC.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\ItemNameUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\MultiStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\OutStreamWithCRC.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\ParseProperties.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\CreateCoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\CWrappers.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\FilePathAutoRename.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\FileStreams.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\FilterCoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\InBuffer.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\InOutTempBuffer.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\LimitedStreams.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\LockedStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\MethodId.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\MethodProps.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\MultiOutStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\OffsetStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\OutBuffer.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\ProgressUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\PropId.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\StreamBinder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\StreamObjects.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\StreamUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\UniqBlocks.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\VirtThread.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\MemBlocks.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\ProgressMt.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\OutMemStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Bcj2Coder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Bcj2Register.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BcjCoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BcjRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BranchMisc.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BranchRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\ByteSwap.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\CopyCoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\CopyRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\DeflateDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\DeflateEncoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Deflate64Register.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\DeflateRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\DeltaFilter.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BitlDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\ImplodeDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\ImplodeHuffmanDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzfseDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzOutWindow.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Lzma2Decoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Lzma2Encoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Lzma2Register.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzmaDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzmaEncoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzmaRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\XzDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\XzEncoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\PpmdDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\PpmdZip.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\ShrinkDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BZip2Crc.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BZip2Decoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\ZstdDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveName.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\HashCalc.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\ConsoleClose.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\OpenCallbackConsole.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\PercentPrinter.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\UserInputUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\UI\NSIS\ExtractCallbackConsole.cpp" />
|
||||||
|
<ClCompile Include="..\..\UI\NSIS\Main.cpp" />
|
||||||
|
<ClCompile Include="..\..\UI\NSIS\MainAr.cpp" />
|
||||||
|
<ClCompile Include="..\..\UI\NSIS\NSISBreak.cpp" />
|
||||||
|
<ClCompile Include="..\..\UI\NSIS\UserInputUtils2.cpp" />
|
||||||
|
<ClCompile Include="nsis7z.cpp" />
|
||||||
|
<ClCompile Include="pluginapi.cpp" />
|
||||||
|
<ClCompile Include="StdAfx2.cpp">
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
|
||||||
|
StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
|
||||||
|
StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
|
||||||
|
StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
|
||||||
|
StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\CommandLineParser.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\CRC.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\DynLimBuf.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\IntToString.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\ListFileUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\MyString.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\MyVector.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\NewHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\StdInStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\StdOutStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\StringConvert.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\StringToInt.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\UTFConvert.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\Wildcard.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\HmacSha1.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\HmacSha256.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\MyAes.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\Pbkdf2HmacSha1.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\RandGen.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\WzAes.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\ZipCrypto.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\ZipStrong.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\DLL.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileDir.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileFind.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileIO.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileName.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\MemoryLock.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\PropVariant.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\Synchronization.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\System.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\SystemInfo.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\LzmaHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\SplitHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\XzHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipHandlerOut.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipIn.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipItem.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipOut.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipAddCommon.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipUpdate.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Nsis\NsisDecode.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Nsis\NsisHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Nsis\NsisIn.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Nsis\NsisRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveCommandLine.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveExtractCallback.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveOpenCallback.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Bench.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\DefaultName.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\EnumDirItems.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Extract.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ExtractingFilePath.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\LoadCodecs.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\OpenArchive.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\PropIDUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\SetProperties.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\SortUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\TempFiles.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Update.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdateAction.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdateCallback.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdatePair.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdateProduce.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="..\..\..\..\C\7zVersion.rc" />
|
||||||
|
<ResourceCompile Include="resource.rc" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,929 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="15.0"
|
||||||
|
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug Unicode|Win32">
|
||||||
|
<Configuration>Debug Unicode</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug Unicode|x64">
|
||||||
|
<Configuration>Debug Unicode</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release Unicode|Win32">
|
||||||
|
<Configuration>Release Unicode</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release Unicode|x64">
|
||||||
|
<Configuration>Release Unicode</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<SccProjectName />
|
||||||
|
<SccLocalPath />
|
||||||
|
<ProjectGuid>{A284C1EF-6CA9-4984-A25F-83B22C85A5EC}</ProjectGuid>
|
||||||
|
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v145</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v145</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'"
|
||||||
|
Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v145</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'"
|
||||||
|
Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v145</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'"
|
||||||
|
Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v145</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'"
|
||||||
|
Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v145</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v145</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v145</PlatformToolset>
|
||||||
|
<UseOfMfc>false</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'"
|
||||||
|
Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'"
|
||||||
|
Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'"
|
||||||
|
Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'"
|
||||||
|
Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||||
|
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
|
||||||
|
Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<TargetName>nsis7z</TargetName>
|
||||||
|
<OutDir>$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(Configuration)\</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<TargetName>nsis7z</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<TargetName>nsis7z</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<TargetName>nsis7z</TargetName>
|
||||||
|
<OutDir>$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(Configuration)\</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<TargetName>nsis7z</TargetName>
|
||||||
|
<OutDir>$(Platform)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<TargetName>nsis7z</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<Optimization>MinSpace</Optimization>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<AssemblerOutput>AssemblyAndMachineCode</AssemblerOutput>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<DebugInformationFormat>None</DebugInformationFormat>
|
||||||
|
<DisableSpecificWarnings>4100</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\Release\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\Release\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<GenerateDebugInformation>No</GenerateDebugInformation>
|
||||||
|
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<Optimization>MinSpace</Optimization>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<AssemblerOutput>AssemblyAndMachineCode</AssemblerOutput>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\Release\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\Release\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level4</WarningLevel>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;UNICODE;WIN32;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\DebugU\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\DebugU\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level4</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;UNICODE;WIN32;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\DebugU\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\DebugU\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<Optimization>MinSpace</Optimization>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level4</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;UNICODE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<DebugInformationFormat>None</DebugInformationFormat>
|
||||||
|
<DisableSpecificWarnings>4100</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\ReleaseU\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\ReleaseU\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<GenerateDebugInformation>No</GenerateDebugInformation>
|
||||||
|
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<Optimization>MinSpace</Optimization>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level4</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;UNICODE;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<DebugInformationFormat>None</DebugInformationFormat>
|
||||||
|
<DisableSpecificWarnings>4100</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\ReleaseU\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\ReleaseU\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<GenerateDebugInformation>No</GenerateDebugInformation>
|
||||||
|
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;WIN32;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\Debug\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\Debug\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
|
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<AdditionalIncludeDirectories>..\..\..\..\..\25.01\CPP\7zip\UI\Common\;..\..\..\..\..\25.01\CPP\;..\..\..\..\..\25.01\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;WIN32;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<CallingConvention>FastCall</CallingConvention>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
</ClCompile>
|
||||||
|
<Midl>
|
||||||
|
<TypeLibraryName>.\Debug\Alone.tlb</TypeLibraryName>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0419</Culture>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ResourceCompile>
|
||||||
|
<Bscmake>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<OutputFile>.\Debug\Alone.bsc</OutputFile>
|
||||||
|
</Bscmake>
|
||||||
|
<Link>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7z.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7zAlloc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7zBuf.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7zCrc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7zFile.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7zTypes.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\7zVersion.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Aes.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Alloc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Bcj2.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Bra.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Compiler.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\CpuArch.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Delta.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\LzFind.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\LzFindMt.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\LzHash.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Lzma2Dec.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Lzma2DecMt.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Lzma2Enc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Lzma86.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\LzmaDec.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\LzmaEnc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\LzmaLib.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\MtCoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\MtDec.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Ppmd.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Ppmd7.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Precomp.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\RotateDefs.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Sha256.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Sort.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Threads.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\Xz.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\XzCrc64.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\C\XzEnc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\COM.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\CommonDialog.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\ErrorMsg.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\FileSystem.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\NtCheck.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\PropVariantConv.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Registry.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\ResourceString.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\SecurityUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Shell.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\TimeUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Window.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zCompressionMode.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zDecode.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zEncode.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zFolderInStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zHandler.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zHeader.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zIn.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zItem.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zOut.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zProperties.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zSpecStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zUpdate.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\CoderMixer2.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\DummyOutStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\HandlerOut.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\InStreamWithCRC.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\ItemNameUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\MultiStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\OutStreamWithCRC.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\ParseProperties.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\CreateCoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\CWrappers.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\FilePathAutoRename.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\FileStreams.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\FilterCoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\InBuffer.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\InOutTempBuffer.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\LimitedStreams.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\LockedStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\MethodId.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\MethodProps.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\OffsetStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\OutBuffer.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\ProgressUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\RegisterArc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\RegisterCodec.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\StreamBinder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\StreamObjects.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\StreamUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\UniqBlocks.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Common\VirtThread.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Bcj2Coder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BcjCoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BranchMisc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\CopyCoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Lzma2Decoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Lzma2Encoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzmaDecoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzmaEncoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\XzDecoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\Compress\XzEncoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveName.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\DirItem.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ExitCode.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ExtractMode.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\HashCalc.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\IFileExtractCallback.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ZipRegistry.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\ConsoleClose.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\OpenCallbackConsole.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\PercentPrinter.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\UserInputUtils.h" />
|
||||||
|
<ClInclude Include="..\..\UI\NSIS\ExtractCallbackConsole.h" />
|
||||||
|
<ClInclude Include="..\..\UI\NSIS\NSISBreak.h" />
|
||||||
|
<ClInclude Include="..\..\UI\NSIS\StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\UI\NSIS\UserInputUtils2.h" />
|
||||||
|
<ClInclude Include="api.h" />
|
||||||
|
<ClInclude Include="nsis_tchar.h" />
|
||||||
|
<ClInclude Include="pluginapi.h" />
|
||||||
|
<ClInclude Include="resource.h" />
|
||||||
|
<ClInclude Include="StdAfx.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\AutoPtr.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\CommandLineParser.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\ComTry.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\Defs.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\DynamicBuffer.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\IntToString.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\ListFileUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyCom.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyException.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyGuidDef.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyInitGuid.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyString.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyUnknown.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\MyVector.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\NewHandler.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\StdInStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\StdOutStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\StringConvert.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\StringToInt.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\UTFConvert.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Common\Wildcard.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Defs.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\DLL.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\FileDir.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\FileFind.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\FileIO.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\FileMapping.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\FileName.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Handle.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\MemoryLock.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\PropVariant.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Synchronization.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\System.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\Windows\Thread.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveCommandLine.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveExtractCallback.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveOpenCallback.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Bench.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\DefaultName.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\EnumDirItems.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Extract.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ExtractingFilePath.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\LoadCodecs.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\OpenArchive.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Property.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\PropIDUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\SetProperties.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\SortUtils.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\TempFiles.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Update.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdateAction.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdateCallback.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdatePair.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdateProduce.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\ICoder.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\IMyUnknown.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\IPassword.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\IProgress.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\IStream.h" />
|
||||||
|
<ClInclude Include="..\..\..\..\..\25.01\CPP\7zip\PropID.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zAlloc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zArcIn.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zBuf.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zBuf2.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zCrc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zCrcOpt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zDec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zFile.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\7zStream.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Aes.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\AesOpt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Alloc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Bcj2.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Bcj2Enc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Bra.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Bra86.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\BraIA64.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\CpuArch.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Delta.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\LzFind.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\LzFindMt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\LzFindOpt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Lzma2Dec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Lzma2DecMt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Lzma2Enc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Lzma86Dec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Lzma86Enc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\LzmaDec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\LzmaEnc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\LzmaLib.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\MtCoder.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\MtDec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Ppmd7.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Ppmd7Dec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Ppmd7Enc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Ppmd8.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Ppmd8Dec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Ppmd8Enc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Sha256.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Sha256Opt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Sha1.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Sha1Opt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Sort.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\SwapBytes.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Threads.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Xz.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\XzCrc64.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\XzCrc64Opt.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\XzDec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\XzEnc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\XzIn.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\ZstdDec.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\Xxh64.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\C\HuffEnc.c" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\CommonDialog.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\ErrorMsg.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileLink.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileMapping.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileSystem.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\PropVariantConv.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\PropVariantUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\Registry.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\ResourceString.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\SecurityUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\Shell.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\TimeUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\Window.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zCompressionMode.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zDecode.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zEncode.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zExtract.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zFolderInStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zHandlerOut.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zHeader.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zIn.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zOut.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zProperties.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zSpecStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\7zUpdate.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\7z\StdAfx.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\CoderMixer2.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\DummyOutStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\HandlerOut.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\InStreamWithCRC.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\ItemNameUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\MultiStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\OutStreamWithCRC.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Common\ParseProperties.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\CreateCoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\CWrappers.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\FilePathAutoRename.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\FileStreams.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\FilterCoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\InBuffer.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\InOutTempBuffer.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\LimitedStreams.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\LockedStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\MethodId.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\MethodProps.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\MultiOutStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\OffsetStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\OutBuffer.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\ProgressUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\PropId.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\StreamBinder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\StreamObjects.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\StreamUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\UniqBlocks.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\VirtThread.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\MemBlocks.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\ProgressMt.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Common\OutMemStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Bcj2Coder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Bcj2Register.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BcjCoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BcjRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BranchMisc.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BranchRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\ByteSwap.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\CopyCoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\CopyRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\DeflateDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\DeflateEncoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Deflate64Register.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\DeflateRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\DeltaFilter.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BitlDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\ImplodeDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\ImplodeHuffmanDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzfseDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzOutWindow.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Lzma2Decoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Lzma2Encoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\Lzma2Register.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzmaDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzmaEncoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\LzmaRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\XzDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\XzEncoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\PpmdDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\PpmdZip.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\ShrinkDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BZip2Crc.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\BZip2Decoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Compress\ZstdDecoder.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveName.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\HashCalc.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\ConsoleClose.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\OpenCallbackConsole.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\PercentPrinter.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Console\UserInputUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\UI\NSIS\ExtractCallbackConsole.cpp" />
|
||||||
|
<ClCompile Include="..\..\UI\NSIS\Main.cpp" />
|
||||||
|
<ClCompile Include="..\..\UI\NSIS\MainAr.cpp" />
|
||||||
|
<ClCompile Include="..\..\UI\NSIS\NSISBreak.cpp" />
|
||||||
|
<ClCompile Include="..\..\UI\NSIS\UserInputUtils2.cpp" />
|
||||||
|
<ClCompile Include="nsis7z.cpp" />
|
||||||
|
<ClCompile Include="pluginapi.cpp" />
|
||||||
|
<ClCompile Include="StdAfx2.cpp">
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
|
||||||
|
StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
|
||||||
|
StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
|
||||||
|
StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
|
||||||
|
StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">StdAfx.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\CommandLineParser.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\CRC.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\DynLimBuf.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\IntToString.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\ListFileUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\MyString.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\MyVector.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\NewHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\StdInStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\StdOutStream.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\StringConvert.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\StringToInt.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\UTFConvert.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Common\Wildcard.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\HmacSha1.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\HmacSha256.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\MyAes.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\Pbkdf2HmacSha1.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\RandGen.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\WzAes.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\ZipCrypto.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Crypto\ZipStrong.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\DLL.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileDir.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileFind.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileIO.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\FileName.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\MemoryLock.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\PropVariant.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\Synchronization.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\System.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\Windows\SystemInfo.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\LzmaHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\SplitHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\XzHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipHandlerOut.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipIn.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipItem.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipOut.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipAddCommon.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipUpdate.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Zip\ZipRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Nsis\NsisDecode.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Nsis\NsisHandler.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Nsis\NsisIn.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\Archive\Nsis\NsisRegister.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveCommandLine.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveExtractCallback.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ArchiveOpenCallback.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Bench.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\DefaultName.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\EnumDirItems.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Extract.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\ExtractingFilePath.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\LoadCodecs.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\OpenArchive.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\PropIDUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\SetProperties.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\SortUtils.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\TempFiles.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\Update.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdateAction.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdateCallback.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdatePair.cpp" />
|
||||||
|
<ClCompile Include="..\..\..\..\..\25.01\CPP\7zip\UI\Common\UpdateProduce.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="..\..\..\..\C\7zVersion.rc" />
|
||||||
|
<ResourceCompile Include="resource.rc" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# Forwarding stub: Arc_gcc.mak includes ../../LzmaDec_gcc.mak relative to make's CWD.
|
||||||
|
# When building from versions/25.01-bundle/CPP/7zip/Bundles/Nsis7z, the CWD-relative
|
||||||
|
# ../../LzmaDec_gcc.mak resolves here. Forward to the real file in the vendor tree.
|
||||||
|
include $(VENDOR_7ZIP)/LzmaDec_gcc.mak
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
CODE32
|
|
||||||
|
|
||||||
EXPORT |CrcUpdateT4@16|
|
|
||||||
|
|
||||||
AREA |.text|, CODE, ARM
|
|
||||||
|
|
||||||
MACRO
|
|
||||||
CRC32_STEP_1
|
|
||||||
|
|
||||||
ldrb r4, [r1], #1
|
|
||||||
subs r2, r2, #1
|
|
||||||
eor r4, r4, r0
|
|
||||||
and r4, r4, #0xFF
|
|
||||||
ldr r4, [r3, +r4, lsl #2]
|
|
||||||
eor r0, r4, r0, lsr #8
|
|
||||||
|
|
||||||
MEND
|
|
||||||
|
|
||||||
|
|
||||||
MACRO
|
|
||||||
CRC32_STEP_4 $STREAM_WORD
|
|
||||||
|
|
||||||
eor r7, r7, r8
|
|
||||||
eor r7, r7, r9
|
|
||||||
eor r0, r0, r7
|
|
||||||
eor r0, r0, $STREAM_WORD
|
|
||||||
ldr $STREAM_WORD, [r1], #4
|
|
||||||
|
|
||||||
and r7, r0, #0xFF
|
|
||||||
and r8, r0, #0xFF00
|
|
||||||
and r9, r0, #0xFF0000
|
|
||||||
and r0, r0, #0xFF000000
|
|
||||||
|
|
||||||
ldr r7, [r6, +r7, lsl #2]
|
|
||||||
ldr r8, [r5, +r8, lsr #6]
|
|
||||||
ldr r9, [r4, +r9, lsr #14]
|
|
||||||
ldr r0, [r3, +r0, lsr #22]
|
|
||||||
|
|
||||||
MEND
|
|
||||||
|
|
||||||
|
|
||||||
|CrcUpdateT4@16| PROC
|
|
||||||
|
|
||||||
stmdb sp!, {r4-r11, lr}
|
|
||||||
cmp r2, #0
|
|
||||||
beq |$fin|
|
|
||||||
|
|
||||||
|$v1|
|
|
||||||
tst r1, #7
|
|
||||||
beq |$v2|
|
|
||||||
CRC32_STEP_1
|
|
||||||
bne |$v1|
|
|
||||||
|
|
||||||
|$v2|
|
|
||||||
cmp r2, #16
|
|
||||||
blo |$v3|
|
|
||||||
|
|
||||||
ldr r10, [r1], #4
|
|
||||||
ldr r11, [r1], #4
|
|
||||||
|
|
||||||
add r4, r3, #0x400
|
|
||||||
add r5, r3, #0x800
|
|
||||||
add r6, r3, #0xC00
|
|
||||||
|
|
||||||
mov r7, #0
|
|
||||||
mov r8, #0
|
|
||||||
mov r9, #0
|
|
||||||
|
|
||||||
sub r2, r2, #16
|
|
||||||
|
|
||||||
|$loop|
|
|
||||||
; pld [r1, #0x40]
|
|
||||||
|
|
||||||
CRC32_STEP_4 r10
|
|
||||||
CRC32_STEP_4 r11
|
|
||||||
|
|
||||||
subs r2, r2, #8
|
|
||||||
bhs |$loop|
|
|
||||||
|
|
||||||
sub r1, r1, #8
|
|
||||||
add r2, r2, #16
|
|
||||||
|
|
||||||
eor r7, r7, r8
|
|
||||||
eor r7, r7, r9
|
|
||||||
eor r0, r0, r7
|
|
||||||
|
|
||||||
|$v3|
|
|
||||||
cmp r2, #0
|
|
||||||
beq |$fin|
|
|
||||||
|
|
||||||
|$v4|
|
|
||||||
CRC32_STEP_1
|
|
||||||
bne |$v4|
|
|
||||||
|
|
||||||
|$fin|
|
|
||||||
ldmia sp!, {r4-r11, pc}
|
|
||||||
|
|
||||||
|CrcUpdateT4@16| ENDP
|
|
||||||
|
|
||||||
END
|
|
||||||
@@ -1,181 +0,0 @@
|
|||||||
// 7zAsm.S -- ASM macros for arm64
|
|
||||||
// 2021-04-25 : Igor Pavlov : Public domain
|
|
||||||
|
|
||||||
#define r0 x0
|
|
||||||
#define r1 x1
|
|
||||||
#define r2 x2
|
|
||||||
#define r3 x3
|
|
||||||
#define r4 x4
|
|
||||||
#define r5 x5
|
|
||||||
#define r6 x6
|
|
||||||
#define r7 x7
|
|
||||||
#define r8 x8
|
|
||||||
#define r9 x9
|
|
||||||
#define r10 x10
|
|
||||||
#define r11 x11
|
|
||||||
#define r12 x12
|
|
||||||
#define r13 x13
|
|
||||||
#define r14 x14
|
|
||||||
#define r15 x15
|
|
||||||
#define r16 x16
|
|
||||||
#define r17 x17
|
|
||||||
#define r18 x18
|
|
||||||
#define r19 x19
|
|
||||||
#define r20 x20
|
|
||||||
#define r21 x21
|
|
||||||
#define r22 x22
|
|
||||||
#define r23 x23
|
|
||||||
#define r24 x24
|
|
||||||
#define r25 x25
|
|
||||||
#define r26 x26
|
|
||||||
#define r27 x27
|
|
||||||
#define r28 x28
|
|
||||||
#define r29 x29
|
|
||||||
#define r30 x30
|
|
||||||
|
|
||||||
#define REG_ABI_PARAM_0 r0
|
|
||||||
#define REG_ABI_PARAM_1 r1
|
|
||||||
#define REG_ABI_PARAM_2 r2
|
|
||||||
|
|
||||||
|
|
||||||
.macro p2_add reg:req, param:req
|
|
||||||
add \reg, \reg, \param
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro p2_sub reg:req, param:req
|
|
||||||
sub \reg, \reg, \param
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro p2_sub_s reg:req, param:req
|
|
||||||
subs \reg, \reg, \param
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro p2_and reg:req, param:req
|
|
||||||
and \reg, \reg, \param
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro xor reg:req, param:req
|
|
||||||
eor \reg, \reg, \param
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro or reg:req, param:req
|
|
||||||
orr \reg, \reg, \param
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro shl reg:req, param:req
|
|
||||||
lsl \reg, \reg, \param
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro shr reg:req, param:req
|
|
||||||
lsr \reg, \reg, \param
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro sar reg:req, param:req
|
|
||||||
asr \reg, \reg, \param
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro p1_neg reg:req
|
|
||||||
neg \reg, \reg
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro dec reg:req
|
|
||||||
sub \reg, \reg, 1
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro dec_s reg:req
|
|
||||||
subs \reg, \reg, 1
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro inc reg:req
|
|
||||||
add \reg, \reg, 1
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro inc_s reg:req
|
|
||||||
adds \reg, \reg, 1
|
|
||||||
.endm
|
|
||||||
|
|
||||||
|
|
||||||
.macro imul reg:req, param:req
|
|
||||||
mul \reg, \reg, \param
|
|
||||||
.endm
|
|
||||||
|
|
||||||
/*
|
|
||||||
arm64 and arm use reverted c flag after subs/cmp instructions:
|
|
||||||
arm64-arm : x86
|
|
||||||
b.lo / b.cc : jb / jc
|
|
||||||
b.hs / b.cs : jae / jnc
|
|
||||||
*/
|
|
||||||
|
|
||||||
.macro jmp lab:req
|
|
||||||
b \lab
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro je lab:req
|
|
||||||
b.eq \lab
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro jz lab:req
|
|
||||||
b.eq \lab
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro jnz lab:req
|
|
||||||
b.ne \lab
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro jne lab:req
|
|
||||||
b.ne \lab
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro jb lab:req
|
|
||||||
b.lo \lab
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro jbe lab:req
|
|
||||||
b.ls \lab
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro ja lab:req
|
|
||||||
b.hi \lab
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro jae lab:req
|
|
||||||
b.hs \lab
|
|
||||||
.endm
|
|
||||||
|
|
||||||
|
|
||||||
.macro cmove dest:req, srcTrue:req
|
|
||||||
csel \dest, \srcTrue, \dest, eq
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro cmovne dest:req, srcTrue:req
|
|
||||||
csel \dest, \srcTrue, \dest, ne
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro cmovs dest:req, srcTrue:req
|
|
||||||
csel \dest, \srcTrue, \dest, mi
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro cmovns dest:req, srcTrue:req
|
|
||||||
csel \dest, \srcTrue, \dest, pl
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro cmovb dest:req, srcTrue:req
|
|
||||||
csel \dest, \srcTrue, \dest, lo
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro cmovae dest:req, srcTrue:req
|
|
||||||
csel \dest, \srcTrue, \dest, hs
|
|
||||||
.endm
|
|
||||||
|
|
||||||
|
|
||||||
.macro MY_ALIGN_16 macro
|
|
||||||
.p2align 4,, (1 << 4) - 1
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro MY_ALIGN_32 macro
|
|
||||||
.p2align 5,, (1 << 5) - 1
|
|
||||||
.endm
|
|
||||||
|
|
||||||
.macro MY_ALIGN_64 macro
|
|
||||||
.p2align 6,, (1 << 6) - 1
|
|
||||||
.endm
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,341 +0,0 @@
|
|||||||
; 7zAsm.asm -- ASM macros
|
|
||||||
; 2023-12-08 : Igor Pavlov : Public domain
|
|
||||||
|
|
||||||
|
|
||||||
; UASM can require these changes
|
|
||||||
; OPTION FRAMEPRESERVEFLAGS:ON
|
|
||||||
; OPTION PROLOGUE:NONE
|
|
||||||
; OPTION EPILOGUE:NONE
|
|
||||||
|
|
||||||
ifdef @wordsize
|
|
||||||
; @wordsize is defined only in JWASM and ASMC and is not defined in MASM
|
|
||||||
; @wordsize eq 8 for 64-bit x64
|
|
||||||
; @wordsize eq 2 for 32-bit x86
|
|
||||||
if @wordsize eq 8
|
|
||||||
x64 equ 1
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
ifdef RAX
|
|
||||||
x64 equ 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
IS_X64 equ 1
|
|
||||||
else
|
|
||||||
IS_X64 equ 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef ABI_LINUX
|
|
||||||
IS_LINUX equ 1
|
|
||||||
else
|
|
||||||
IS_LINUX equ 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef x64
|
|
||||||
; Use ABI_CDECL for x86 (32-bit) only
|
|
||||||
; if ABI_CDECL is not defined, we use fastcall abi
|
|
||||||
ifdef ABI_CDECL
|
|
||||||
IS_CDECL equ 1
|
|
||||||
else
|
|
||||||
IS_CDECL equ 0
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
OPTION PROLOGUE:NONE
|
|
||||||
OPTION EPILOGUE:NONE
|
|
||||||
|
|
||||||
MY_ASM_START macro
|
|
||||||
ifdef x64
|
|
||||||
.code
|
|
||||||
else
|
|
||||||
.386
|
|
||||||
.model flat
|
|
||||||
_TEXT$00 SEGMENT PARA PUBLIC 'CODE'
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_PROC macro name:req, numParams:req
|
|
||||||
align 16
|
|
||||||
proc_numParams = numParams
|
|
||||||
if (IS_X64 gt 0)
|
|
||||||
proc_name equ name
|
|
||||||
elseif (IS_LINUX gt 0)
|
|
||||||
proc_name equ name
|
|
||||||
elseif (IS_CDECL gt 0)
|
|
||||||
proc_name equ @CatStr(_,name)
|
|
||||||
else
|
|
||||||
proc_name equ @CatStr(@,name,@, %numParams * 4)
|
|
||||||
endif
|
|
||||||
proc_name PROC
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_ENDP macro
|
|
||||||
if (IS_X64 gt 0)
|
|
||||||
ret
|
|
||||||
elseif (IS_CDECL gt 0)
|
|
||||||
ret
|
|
||||||
elseif (proc_numParams LT 3)
|
|
||||||
ret
|
|
||||||
else
|
|
||||||
ret (proc_numParams - 2) * 4
|
|
||||||
endif
|
|
||||||
proc_name ENDP
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
REG_SIZE equ 8
|
|
||||||
REG_LOGAR_SIZE equ 3
|
|
||||||
else
|
|
||||||
REG_SIZE equ 4
|
|
||||||
REG_LOGAR_SIZE equ 2
|
|
||||||
endif
|
|
||||||
|
|
||||||
x0 equ EAX
|
|
||||||
x1 equ ECX
|
|
||||||
x2 equ EDX
|
|
||||||
x3 equ EBX
|
|
||||||
x4 equ ESP
|
|
||||||
x5 equ EBP
|
|
||||||
x6 equ ESI
|
|
||||||
x7 equ EDI
|
|
||||||
|
|
||||||
x0_W equ AX
|
|
||||||
x1_W equ CX
|
|
||||||
x2_W equ DX
|
|
||||||
x3_W equ BX
|
|
||||||
|
|
||||||
x5_W equ BP
|
|
||||||
x6_W equ SI
|
|
||||||
x7_W equ DI
|
|
||||||
|
|
||||||
x0_L equ AL
|
|
||||||
x1_L equ CL
|
|
||||||
x2_L equ DL
|
|
||||||
x3_L equ BL
|
|
||||||
|
|
||||||
x0_H equ AH
|
|
||||||
x1_H equ CH
|
|
||||||
x2_H equ DH
|
|
||||||
x3_H equ BH
|
|
||||||
|
|
||||||
; r0_L equ AL
|
|
||||||
; r1_L equ CL
|
|
||||||
; r2_L equ DL
|
|
||||||
; r3_L equ BL
|
|
||||||
|
|
||||||
; r0_H equ AH
|
|
||||||
; r1_H equ CH
|
|
||||||
; r2_H equ DH
|
|
||||||
; r3_H equ BH
|
|
||||||
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
x5_L equ BPL
|
|
||||||
x6_L equ SIL
|
|
||||||
x7_L equ DIL
|
|
||||||
x8_L equ r8b
|
|
||||||
x9_L equ r9b
|
|
||||||
x10_L equ r10b
|
|
||||||
x11_L equ r11b
|
|
||||||
x12_L equ r12b
|
|
||||||
x13_L equ r13b
|
|
||||||
x14_L equ r14b
|
|
||||||
x15_L equ r15b
|
|
||||||
|
|
||||||
r0 equ RAX
|
|
||||||
r1 equ RCX
|
|
||||||
r2 equ RDX
|
|
||||||
r3 equ RBX
|
|
||||||
r4 equ RSP
|
|
||||||
r5 equ RBP
|
|
||||||
r6 equ RSI
|
|
||||||
r7 equ RDI
|
|
||||||
x8 equ r8d
|
|
||||||
x9 equ r9d
|
|
||||||
x10 equ r10d
|
|
||||||
x11 equ r11d
|
|
||||||
x12 equ r12d
|
|
||||||
x13 equ r13d
|
|
||||||
x14 equ r14d
|
|
||||||
x15 equ r15d
|
|
||||||
else
|
|
||||||
r0 equ x0
|
|
||||||
r1 equ x1
|
|
||||||
r2 equ x2
|
|
||||||
r3 equ x3
|
|
||||||
r4 equ x4
|
|
||||||
r5 equ x5
|
|
||||||
r6 equ x6
|
|
||||||
r7 equ x7
|
|
||||||
endif
|
|
||||||
|
|
||||||
x0_R equ r0
|
|
||||||
x1_R equ r1
|
|
||||||
x2_R equ r2
|
|
||||||
x3_R equ r3
|
|
||||||
x4_R equ r4
|
|
||||||
x5_R equ r5
|
|
||||||
x6_R equ r6
|
|
||||||
x7_R equ r7
|
|
||||||
x8_R equ r8
|
|
||||||
x9_R equ r9
|
|
||||||
x10_R equ r10
|
|
||||||
x11_R equ r11
|
|
||||||
x12_R equ r12
|
|
||||||
x13_R equ r13
|
|
||||||
x14_R equ r14
|
|
||||||
x15_R equ r15
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
ifdef ABI_LINUX
|
|
||||||
|
|
||||||
MY_PUSH_2_REGS macro
|
|
||||||
push r3
|
|
||||||
push r5
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_POP_2_REGS macro
|
|
||||||
pop r5
|
|
||||||
pop r3
|
|
||||||
endm
|
|
||||||
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
MY_PUSH_4_REGS macro
|
|
||||||
push r3
|
|
||||||
push r5
|
|
||||||
push r6
|
|
||||||
push r7
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_POP_4_REGS macro
|
|
||||||
pop r7
|
|
||||||
pop r6
|
|
||||||
pop r5
|
|
||||||
pop r3
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
; for fastcall and for WIN-x64
|
|
||||||
REG_PARAM_0_x equ x1
|
|
||||||
REG_PARAM_0 equ r1
|
|
||||||
REG_PARAM_1_x equ x2
|
|
||||||
REG_PARAM_1 equ r2
|
|
||||||
|
|
||||||
ifndef x64
|
|
||||||
; for x86-fastcall
|
|
||||||
|
|
||||||
REG_ABI_PARAM_0_x equ REG_PARAM_0_x
|
|
||||||
REG_ABI_PARAM_0 equ REG_PARAM_0
|
|
||||||
REG_ABI_PARAM_1_x equ REG_PARAM_1_x
|
|
||||||
REG_ABI_PARAM_1 equ REG_PARAM_1
|
|
||||||
|
|
||||||
MY_PUSH_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11 macro
|
|
||||||
MY_PUSH_4_REGS
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_POP_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11 macro
|
|
||||||
MY_POP_4_REGS
|
|
||||||
endm
|
|
||||||
|
|
||||||
else
|
|
||||||
; x64
|
|
||||||
|
|
||||||
if (IS_LINUX eq 0)
|
|
||||||
|
|
||||||
; for WIN-x64:
|
|
||||||
REG_PARAM_2_x equ x8
|
|
||||||
REG_PARAM_2 equ r8
|
|
||||||
REG_PARAM_3 equ r9
|
|
||||||
|
|
||||||
REG_ABI_PARAM_0_x equ REG_PARAM_0_x
|
|
||||||
REG_ABI_PARAM_0 equ REG_PARAM_0
|
|
||||||
REG_ABI_PARAM_1_x equ REG_PARAM_1_x
|
|
||||||
REG_ABI_PARAM_1 equ REG_PARAM_1
|
|
||||||
REG_ABI_PARAM_2_x equ REG_PARAM_2_x
|
|
||||||
REG_ABI_PARAM_2 equ REG_PARAM_2
|
|
||||||
REG_ABI_PARAM_3 equ REG_PARAM_3
|
|
||||||
|
|
||||||
else
|
|
||||||
; for LINUX-x64:
|
|
||||||
REG_LINUX_PARAM_0_x equ x7
|
|
||||||
REG_LINUX_PARAM_0 equ r7
|
|
||||||
REG_LINUX_PARAM_1_x equ x6
|
|
||||||
REG_LINUX_PARAM_1 equ r6
|
|
||||||
REG_LINUX_PARAM_2 equ r2
|
|
||||||
REG_LINUX_PARAM_3 equ r1
|
|
||||||
REG_LINUX_PARAM_4_x equ x8
|
|
||||||
REG_LINUX_PARAM_4 equ r8
|
|
||||||
REG_LINUX_PARAM_5 equ r9
|
|
||||||
|
|
||||||
REG_ABI_PARAM_0_x equ REG_LINUX_PARAM_0_x
|
|
||||||
REG_ABI_PARAM_0 equ REG_LINUX_PARAM_0
|
|
||||||
REG_ABI_PARAM_1_x equ REG_LINUX_PARAM_1_x
|
|
||||||
REG_ABI_PARAM_1 equ REG_LINUX_PARAM_1
|
|
||||||
REG_ABI_PARAM_2 equ REG_LINUX_PARAM_2
|
|
||||||
REG_ABI_PARAM_3 equ REG_LINUX_PARAM_3
|
|
||||||
REG_ABI_PARAM_4_x equ REG_LINUX_PARAM_4_x
|
|
||||||
REG_ABI_PARAM_4 equ REG_LINUX_PARAM_4
|
|
||||||
REG_ABI_PARAM_5 equ REG_LINUX_PARAM_5
|
|
||||||
|
|
||||||
MY_ABI_LINUX_TO_WIN_2 macro
|
|
||||||
mov r2, r6
|
|
||||||
mov r1, r7
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_ABI_LINUX_TO_WIN_3 macro
|
|
||||||
mov r8, r2
|
|
||||||
mov r2, r6
|
|
||||||
mov r1, r7
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_ABI_LINUX_TO_WIN_4 macro
|
|
||||||
mov r9, r1
|
|
||||||
mov r8, r2
|
|
||||||
mov r2, r6
|
|
||||||
mov r1, r7
|
|
||||||
endm
|
|
||||||
|
|
||||||
endif ; IS_LINUX
|
|
||||||
|
|
||||||
|
|
||||||
MY_PUSH_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11 macro
|
|
||||||
if (IS_LINUX gt 0)
|
|
||||||
MY_PUSH_2_REGS
|
|
||||||
else
|
|
||||||
MY_PUSH_4_REGS
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_POP_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11 macro
|
|
||||||
if (IS_LINUX gt 0)
|
|
||||||
MY_POP_2_REGS
|
|
||||||
else
|
|
||||||
MY_POP_4_REGS
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
MY_PUSH_PRESERVED_ABI_REGS macro
|
|
||||||
MY_PUSH_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11
|
|
||||||
push r12
|
|
||||||
push r13
|
|
||||||
push r14
|
|
||||||
push r15
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
MY_POP_PRESERVED_ABI_REGS macro
|
|
||||||
pop r15
|
|
||||||
pop r14
|
|
||||||
pop r13
|
|
||||||
pop r12
|
|
||||||
MY_POP_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11
|
|
||||||
endm
|
|
||||||
|
|
||||||
endif ; x64
|
|
||||||
@@ -1,258 +0,0 @@
|
|||||||
; 7zCrcOpt.asm -- CRC32 calculation : optimized version
|
|
||||||
; 2023-12-08 : Igor Pavlov : Public domain
|
|
||||||
|
|
||||||
include 7zAsm.asm
|
|
||||||
|
|
||||||
MY_ASM_START
|
|
||||||
|
|
||||||
NUM_WORDS equ 3
|
|
||||||
UNROLL_CNT equ 2
|
|
||||||
|
|
||||||
if (NUM_WORDS lt 1) or (NUM_WORDS gt 64)
|
|
||||||
.err <NUM_WORDS_IS_INCORRECT>
|
|
||||||
endif
|
|
||||||
if (UNROLL_CNT lt 1)
|
|
||||||
.err <UNROLL_CNT_IS_INCORRECT>
|
|
||||||
endif
|
|
||||||
|
|
||||||
rD equ r2
|
|
||||||
rD_x equ x2
|
|
||||||
rN equ r7
|
|
||||||
rT equ r5
|
|
||||||
|
|
||||||
ifndef x64
|
|
||||||
if (IS_CDECL gt 0)
|
|
||||||
crc_OFFS equ (REG_SIZE * 5)
|
|
||||||
data_OFFS equ (REG_SIZE + crc_OFFS)
|
|
||||||
size_OFFS equ (REG_SIZE + data_OFFS)
|
|
||||||
else
|
|
||||||
size_OFFS equ (REG_SIZE * 5)
|
|
||||||
endif
|
|
||||||
table_OFFS equ (REG_SIZE + size_OFFS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
; rN + rD is same speed as rD, but we reduce one instruction in loop
|
|
||||||
SRCDAT_1 equ rN + rD * 1 + 1 *
|
|
||||||
SRCDAT_4 equ rN + rD * 1 + 4 *
|
|
||||||
|
|
||||||
CRC macro op:req, dest:req, src:req, t:req
|
|
||||||
op dest, dword ptr [rT + @CatStr(src, _R) * 4 + 0400h * (t)]
|
|
||||||
endm
|
|
||||||
|
|
||||||
CRC_XOR macro dest:req, src:req, t:req
|
|
||||||
CRC xor, dest, src, t
|
|
||||||
endm
|
|
||||||
|
|
||||||
CRC_MOV macro dest:req, src:req, t:req
|
|
||||||
CRC mov, dest, src, t
|
|
||||||
endm
|
|
||||||
|
|
||||||
MOVZXLO macro dest:req, src:req
|
|
||||||
movzx dest, @CatStr(src, _L)
|
|
||||||
endm
|
|
||||||
|
|
||||||
MOVZXHI macro dest:req, src:req
|
|
||||||
movzx dest, @CatStr(src, _H)
|
|
||||||
endm
|
|
||||||
|
|
||||||
; movzx x0, x0_L - is slow in some cpus (ivb), if same register for src and dest
|
|
||||||
; movzx x3, x0_L sometimes is 0 cycles latency (not always)
|
|
||||||
; movzx x3, x0_L sometimes is 0.5 cycles latency
|
|
||||||
; movzx x3, x0_H is 2 cycles latency in some cpus
|
|
||||||
|
|
||||||
CRC1b macro
|
|
||||||
movzx x6, byte ptr [rD]
|
|
||||||
MOVZXLO x3, x0
|
|
||||||
inc rD
|
|
||||||
shr x0, 8
|
|
||||||
xor x6, x3
|
|
||||||
CRC_XOR x0, x6, 0
|
|
||||||
dec rN
|
|
||||||
endm
|
|
||||||
|
|
||||||
LOAD_1 macro dest:req, t:req, iter:req, index:req
|
|
||||||
movzx dest, byte ptr [SRCDAT_1 (4 * (NUM_WORDS - 1 - t + iter * NUM_WORDS) + index)]
|
|
||||||
endm
|
|
||||||
|
|
||||||
LOAD_2 macro dest:req, t:req, iter:req, index:req
|
|
||||||
movzx dest, word ptr [SRCDAT_1 (4 * (NUM_WORDS - 1 - t + iter * NUM_WORDS) + index)]
|
|
||||||
endm
|
|
||||||
|
|
||||||
CRC_QUAD macro nn, t:req, iter:req
|
|
||||||
ifdef x64
|
|
||||||
; paired memory loads give 1-3% speed gain, but it uses more registers
|
|
||||||
LOAD_2 x3, t, iter, 0
|
|
||||||
LOAD_2 x9, t, iter, 2
|
|
||||||
MOVZXLO x6, x3
|
|
||||||
shr x3, 8
|
|
||||||
CRC_XOR nn, x6, t * 4 + 3
|
|
||||||
MOVZXLO x6, x9
|
|
||||||
shr x9, 8
|
|
||||||
CRC_XOR nn, x3, t * 4 + 2
|
|
||||||
CRC_XOR nn, x6, t * 4 + 1
|
|
||||||
CRC_XOR nn, x9, t * 4 + 0
|
|
||||||
elseif 0
|
|
||||||
LOAD_2 x3, t, iter, 0
|
|
||||||
MOVZXLO x6, x3
|
|
||||||
shr x3, 8
|
|
||||||
CRC_XOR nn, x6, t * 4 + 3
|
|
||||||
CRC_XOR nn, x3, t * 4 + 2
|
|
||||||
LOAD_2 x3, t, iter, 2
|
|
||||||
MOVZXLO x6, x3
|
|
||||||
shr x3, 8
|
|
||||||
CRC_XOR nn, x6, t * 4 + 1
|
|
||||||
CRC_XOR nn, x3, t * 4 + 0
|
|
||||||
elseif 0
|
|
||||||
LOAD_1 x3, t, iter, 0
|
|
||||||
LOAD_1 x6, t, iter, 1
|
|
||||||
CRC_XOR nn, x3, t * 4 + 3
|
|
||||||
CRC_XOR nn, x6, t * 4 + 2
|
|
||||||
LOAD_1 x3, t, iter, 2
|
|
||||||
LOAD_1 x6, t, iter, 3
|
|
||||||
CRC_XOR nn, x3, t * 4 + 1
|
|
||||||
CRC_XOR nn, x6, t * 4 + 0
|
|
||||||
else
|
|
||||||
; 32-bit load is better if there is only one read port (core2)
|
|
||||||
; but that code can be slower if there are 2 read ports (snb)
|
|
||||||
mov x3, dword ptr [SRCDAT_1 (4 * (NUM_WORDS - 1 - t + iter * NUM_WORDS) + 0)]
|
|
||||||
MOVZXLO x6, x3
|
|
||||||
CRC_XOR nn, x6, t * 4 + 3
|
|
||||||
MOVZXHI x6, x3
|
|
||||||
shr x3, 16
|
|
||||||
CRC_XOR nn, x6, t * 4 + 2
|
|
||||||
MOVZXLO x6, x3
|
|
||||||
shr x3, 8
|
|
||||||
CRC_XOR nn, x6, t * 4 + 1
|
|
||||||
CRC_XOR nn, x3, t * 4 + 0
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
LAST equ (4 * (NUM_WORDS - 1))
|
|
||||||
|
|
||||||
CRC_ITER macro qq, nn, iter
|
|
||||||
mov nn, [SRCDAT_4 (NUM_WORDS * (1 + iter))]
|
|
||||||
|
|
||||||
i = 0
|
|
||||||
rept NUM_WORDS - 1
|
|
||||||
CRC_QUAD nn, i, iter
|
|
||||||
i = i + 1
|
|
||||||
endm
|
|
||||||
|
|
||||||
MOVZXLO x6, qq
|
|
||||||
mov x3, qq
|
|
||||||
shr x3, 24
|
|
||||||
CRC_XOR nn, x6, LAST + 3
|
|
||||||
CRC_XOR nn, x3, LAST + 0
|
|
||||||
ror qq, 16
|
|
||||||
MOVZXLO x6, qq
|
|
||||||
shr qq, 24
|
|
||||||
CRC_XOR nn, x6, LAST + 1
|
|
||||||
if ((UNROLL_CNT and 1) eq 1) and (iter eq (UNROLL_CNT - 1))
|
|
||||||
CRC_MOV qq, qq, LAST + 2
|
|
||||||
xor qq, nn
|
|
||||||
else
|
|
||||||
CRC_XOR nn, qq, LAST + 2
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
; + 4 for prefetching next 4-bytes after current iteration
|
|
||||||
NUM_BYTES_LIMIT equ (NUM_WORDS * 4 * UNROLL_CNT + 4)
|
|
||||||
ALIGN_MASK equ 3
|
|
||||||
|
|
||||||
|
|
||||||
; MY_PROC @CatStr(CrcUpdateT, 12), 4
|
|
||||||
MY_PROC @CatStr(CrcUpdateT, %(NUM_WORDS * 4)), 4
|
|
||||||
MY_PUSH_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11
|
|
||||||
ifdef x64
|
|
||||||
mov x0, REG_ABI_PARAM_0_x ; x0 = x1(win) / x7(linux)
|
|
||||||
mov rT, REG_ABI_PARAM_3 ; r5 = r9(win) / x1(linux)
|
|
||||||
mov rN, REG_ABI_PARAM_2 ; r7 = r8(win) / r2(linux)
|
|
||||||
; mov rD, REG_ABI_PARAM_1 ; r2 = r2(win)
|
|
||||||
if (IS_LINUX gt 0)
|
|
||||||
mov rD, REG_ABI_PARAM_1 ; r2 = r6
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
if (IS_CDECL gt 0)
|
|
||||||
mov x0, [r4 + crc_OFFS]
|
|
||||||
mov rD, [r4 + data_OFFS]
|
|
||||||
else
|
|
||||||
mov x0, REG_ABI_PARAM_0_x
|
|
||||||
endif
|
|
||||||
mov rN, [r4 + size_OFFS]
|
|
||||||
mov rT, [r4 + table_OFFS]
|
|
||||||
endif
|
|
||||||
|
|
||||||
cmp rN, NUM_BYTES_LIMIT + ALIGN_MASK
|
|
||||||
jb crc_end
|
|
||||||
@@:
|
|
||||||
test rD_x, ALIGN_MASK ; test rD, ALIGN_MASK
|
|
||||||
jz @F
|
|
||||||
CRC1b
|
|
||||||
jmp @B
|
|
||||||
@@:
|
|
||||||
xor x0, dword ptr [rD]
|
|
||||||
lea rN, [rD + rN * 1 - (NUM_BYTES_LIMIT - 1)]
|
|
||||||
sub rD, rN
|
|
||||||
|
|
||||||
align 16
|
|
||||||
@@:
|
|
||||||
unr_index = 0
|
|
||||||
while unr_index lt UNROLL_CNT
|
|
||||||
if (unr_index and 1) eq 0
|
|
||||||
CRC_ITER x0, x1, unr_index
|
|
||||||
else
|
|
||||||
CRC_ITER x1, x0, unr_index
|
|
||||||
endif
|
|
||||||
unr_index = unr_index + 1
|
|
||||||
endm
|
|
||||||
|
|
||||||
add rD, NUM_WORDS * 4 * UNROLL_CNT
|
|
||||||
jnc @B
|
|
||||||
|
|
||||||
if 0
|
|
||||||
; byte verson
|
|
||||||
add rD, rN
|
|
||||||
xor x0, dword ptr [rD]
|
|
||||||
add rN, NUM_BYTES_LIMIT - 1
|
|
||||||
else
|
|
||||||
; 4-byte version
|
|
||||||
add rN, 4 * NUM_WORDS * UNROLL_CNT
|
|
||||||
sub rD, 4 * NUM_WORDS * UNROLL_CNT
|
|
||||||
@@:
|
|
||||||
MOVZXLO x3, x0
|
|
||||||
MOVZXHI x1, x0
|
|
||||||
shr x0, 16
|
|
||||||
MOVZXLO x6, x0
|
|
||||||
shr x0, 8
|
|
||||||
CRC_MOV x0, x0, 0
|
|
||||||
CRC_XOR x0, x3, 3
|
|
||||||
CRC_XOR x0, x1, 2
|
|
||||||
CRC_XOR x0, x6, 1
|
|
||||||
|
|
||||||
add rD, 4
|
|
||||||
if (NUM_WORDS * UNROLL_CNT) ne 1
|
|
||||||
jc @F
|
|
||||||
xor x0, [SRCDAT_4 0]
|
|
||||||
jmp @B
|
|
||||||
@@:
|
|
||||||
endif
|
|
||||||
add rD, rN
|
|
||||||
add rN, 4 - 1
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
sub rN, rD
|
|
||||||
crc_end:
|
|
||||||
test rN, rN
|
|
||||||
jz func_end
|
|
||||||
@@:
|
|
||||||
CRC1b
|
|
||||||
jnz @B
|
|
||||||
|
|
||||||
func_end:
|
|
||||||
MY_POP_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11
|
|
||||||
MY_ENDP
|
|
||||||
|
|
||||||
end
|
|
||||||
@@ -1,742 +0,0 @@
|
|||||||
; AesOpt.asm -- AES optimized code for x86 AES hardware instructions
|
|
||||||
; 2021-12-25 : Igor Pavlov : Public domain
|
|
||||||
|
|
||||||
include 7zAsm.asm
|
|
||||||
|
|
||||||
ifdef __ASMC__
|
|
||||||
use_vaes_256 equ 1
|
|
||||||
else
|
|
||||||
ifdef ymm0
|
|
||||||
use_vaes_256 equ 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
ifdef use_vaes_256
|
|
||||||
ECHO "++ VAES 256"
|
|
||||||
else
|
|
||||||
ECHO "-- NO VAES 256"
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
ECHO "x86-64"
|
|
||||||
else
|
|
||||||
ECHO "x86"
|
|
||||||
if (IS_CDECL gt 0)
|
|
||||||
ECHO "ABI : CDECL"
|
|
||||||
else
|
|
||||||
ECHO "ABI : no CDECL : FASTCALL"
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if (IS_LINUX gt 0)
|
|
||||||
ECHO "ABI : LINUX"
|
|
||||||
else
|
|
||||||
ECHO "ABI : WINDOWS"
|
|
||||||
endif
|
|
||||||
|
|
||||||
MY_ASM_START
|
|
||||||
|
|
||||||
ifndef x64
|
|
||||||
.686
|
|
||||||
.xmm
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
; MY_ALIGN EQU ALIGN(64)
|
|
||||||
MY_ALIGN EQU
|
|
||||||
|
|
||||||
SEG_ALIGN EQU MY_ALIGN
|
|
||||||
|
|
||||||
MY_SEG_PROC macro name:req, numParams:req
|
|
||||||
; seg_name equ @CatStr(_TEXT$, name)
|
|
||||||
; seg_name SEGMENT SEG_ALIGN 'CODE'
|
|
||||||
MY_PROC name, numParams
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_SEG_ENDP macro
|
|
||||||
; seg_name ENDS
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
NUM_AES_KEYS_MAX equ 15
|
|
||||||
|
|
||||||
; the number of push operators in function PROLOG
|
|
||||||
if (IS_LINUX eq 0) or (IS_X64 eq 0)
|
|
||||||
num_regs_push equ 2
|
|
||||||
stack_param_offset equ (REG_SIZE * (1 + num_regs_push))
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
num_param equ REG_ABI_PARAM_2
|
|
||||||
else
|
|
||||||
if (IS_CDECL gt 0)
|
|
||||||
; size_t size
|
|
||||||
; void * data
|
|
||||||
; UInt32 * aes
|
|
||||||
; ret-ip <- (r4)
|
|
||||||
aes_OFFS equ (stack_param_offset)
|
|
||||||
data_OFFS equ (REG_SIZE + aes_OFFS)
|
|
||||||
size_OFFS equ (REG_SIZE + data_OFFS)
|
|
||||||
num_param equ [r4 + size_OFFS]
|
|
||||||
else
|
|
||||||
num_param equ [r4 + stack_param_offset]
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
keys equ REG_PARAM_0 ; r1
|
|
||||||
rD equ REG_PARAM_1 ; r2
|
|
||||||
rN equ r0
|
|
||||||
|
|
||||||
koffs_x equ x7
|
|
||||||
koffs_r equ r7
|
|
||||||
|
|
||||||
ksize_x equ x6
|
|
||||||
ksize_r equ r6
|
|
||||||
|
|
||||||
keys2 equ r3
|
|
||||||
|
|
||||||
state equ xmm0
|
|
||||||
key equ xmm0
|
|
||||||
key_ymm equ ymm0
|
|
||||||
key_ymm_n equ 0
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
ways = 11
|
|
||||||
else
|
|
||||||
ways = 4
|
|
||||||
endif
|
|
||||||
|
|
||||||
ways_start_reg equ 1
|
|
||||||
|
|
||||||
iv equ @CatStr(xmm, %(ways_start_reg + ways))
|
|
||||||
iv_ymm equ @CatStr(ymm, %(ways_start_reg + ways))
|
|
||||||
|
|
||||||
|
|
||||||
WOP macro op, op2
|
|
||||||
i = 0
|
|
||||||
rept ways
|
|
||||||
op @CatStr(xmm, %(ways_start_reg + i)), op2
|
|
||||||
i = i + 1
|
|
||||||
endm
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
ifndef ABI_LINUX
|
|
||||||
ifdef x64
|
|
||||||
|
|
||||||
; we use 32 bytes of home space in stack in WIN64-x64
|
|
||||||
NUM_HOME_MM_REGS equ (32 / 16)
|
|
||||||
; we preserve xmm registers starting from xmm6 in WIN64-x64
|
|
||||||
MM_START_SAVE_REG equ 6
|
|
||||||
|
|
||||||
SAVE_XMM macro num_used_mm_regs:req
|
|
||||||
num_save_mm_regs = num_used_mm_regs - MM_START_SAVE_REG
|
|
||||||
if num_save_mm_regs GT 0
|
|
||||||
num_save_mm_regs2 = num_save_mm_regs - NUM_HOME_MM_REGS
|
|
||||||
; RSP is (16*x + 8) after entering the function in WIN64-x64
|
|
||||||
stack_offset = 16 * num_save_mm_regs2 + (stack_param_offset mod 16)
|
|
||||||
|
|
||||||
i = 0
|
|
||||||
rept num_save_mm_regs
|
|
||||||
|
|
||||||
if i eq NUM_HOME_MM_REGS
|
|
||||||
sub r4, stack_offset
|
|
||||||
endif
|
|
||||||
|
|
||||||
if i lt NUM_HOME_MM_REGS
|
|
||||||
movdqa [r4 + stack_param_offset + i * 16], @CatStr(xmm, %(MM_START_SAVE_REG + i))
|
|
||||||
else
|
|
||||||
movdqa [r4 + (i - NUM_HOME_MM_REGS) * 16], @CatStr(xmm, %(MM_START_SAVE_REG + i))
|
|
||||||
endif
|
|
||||||
|
|
||||||
i = i + 1
|
|
||||||
endm
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
RESTORE_XMM macro num_used_mm_regs:req
|
|
||||||
if num_save_mm_regs GT 0
|
|
||||||
i = 0
|
|
||||||
if num_save_mm_regs2 GT 0
|
|
||||||
rept num_save_mm_regs2
|
|
||||||
movdqa @CatStr(xmm, %(MM_START_SAVE_REG + NUM_HOME_MM_REGS + i)), [r4 + i * 16]
|
|
||||||
i = i + 1
|
|
||||||
endm
|
|
||||||
add r4, stack_offset
|
|
||||||
endif
|
|
||||||
|
|
||||||
num_low_regs = num_save_mm_regs - i
|
|
||||||
i = 0
|
|
||||||
rept num_low_regs
|
|
||||||
movdqa @CatStr(xmm, %(MM_START_SAVE_REG + i)), [r4 + stack_param_offset + i * 16]
|
|
||||||
i = i + 1
|
|
||||||
endm
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
endif ; x64
|
|
||||||
endif ; ABI_LINUX
|
|
||||||
|
|
||||||
|
|
||||||
MY_PROLOG macro num_used_mm_regs:req
|
|
||||||
; num_regs_push: must be equal to the number of push operators
|
|
||||||
; push r3
|
|
||||||
; push r5
|
|
||||||
if (IS_LINUX eq 0) or (IS_X64 eq 0)
|
|
||||||
push r6
|
|
||||||
push r7
|
|
||||||
endif
|
|
||||||
|
|
||||||
mov rN, num_param ; don't move it; num_param can use stack pointer (r4)
|
|
||||||
|
|
||||||
if (IS_X64 eq 0)
|
|
||||||
if (IS_CDECL gt 0)
|
|
||||||
mov rD, [r4 + data_OFFS]
|
|
||||||
mov keys, [r4 + aes_OFFS]
|
|
||||||
endif
|
|
||||||
elseif (IS_LINUX gt 0)
|
|
||||||
MY_ABI_LINUX_TO_WIN_2
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
ifndef ABI_LINUX
|
|
||||||
ifdef x64
|
|
||||||
SAVE_XMM num_used_mm_regs
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
mov ksize_x, [keys + 16]
|
|
||||||
shl ksize_x, 5
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
MY_EPILOG macro
|
|
||||||
ifndef ABI_LINUX
|
|
||||||
ifdef x64
|
|
||||||
RESTORE_XMM num_save_mm_regs
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if (IS_LINUX eq 0) or (IS_X64 eq 0)
|
|
||||||
pop r7
|
|
||||||
pop r6
|
|
||||||
endif
|
|
||||||
; pop r5
|
|
||||||
; pop r3
|
|
||||||
MY_ENDP
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
OP_KEY macro op:req, offs:req
|
|
||||||
op state, [keys + offs]
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
WOP_KEY macro op:req, offs:req
|
|
||||||
movdqa key, [keys + offs]
|
|
||||||
WOP op, key
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
; ---------- AES-CBC Decode ----------
|
|
||||||
|
|
||||||
|
|
||||||
XOR_WITH_DATA macro reg, _ppp_
|
|
||||||
pxor reg, [rD + i * 16]
|
|
||||||
endm
|
|
||||||
|
|
||||||
WRITE_TO_DATA macro reg, _ppp_
|
|
||||||
movdqa [rD + i * 16], reg
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
; state0 equ @CatStr(xmm, %(ways_start_reg))
|
|
||||||
|
|
||||||
key0 equ @CatStr(xmm, %(ways_start_reg + ways + 1))
|
|
||||||
key0_ymm equ @CatStr(ymm, %(ways_start_reg + ways + 1))
|
|
||||||
|
|
||||||
key_last equ @CatStr(xmm, %(ways_start_reg + ways + 2))
|
|
||||||
key_last_ymm equ @CatStr(ymm, %(ways_start_reg + ways + 2))
|
|
||||||
key_last_ymm_n equ (ways_start_reg + ways + 2)
|
|
||||||
|
|
||||||
NUM_CBC_REGS equ (ways_start_reg + ways + 3)
|
|
||||||
|
|
||||||
|
|
||||||
MY_SEG_PROC AesCbc_Decode_HW, 3
|
|
||||||
|
|
||||||
AesCbc_Decode_HW_start::
|
|
||||||
MY_PROLOG NUM_CBC_REGS
|
|
||||||
|
|
||||||
AesCbc_Decode_HW_start_2::
|
|
||||||
movdqa iv, [keys]
|
|
||||||
add keys, 32
|
|
||||||
|
|
||||||
movdqa key0, [keys + 1 * ksize_r]
|
|
||||||
movdqa key_last, [keys]
|
|
||||||
sub ksize_x, 16
|
|
||||||
|
|
||||||
jmp check2
|
|
||||||
align 16
|
|
||||||
nextBlocks2:
|
|
||||||
WOP movdqa, [rD + i * 16]
|
|
||||||
mov koffs_x, ksize_x
|
|
||||||
; WOP_KEY pxor, ksize_r + 16
|
|
||||||
WOP pxor, key0
|
|
||||||
; align 16
|
|
||||||
@@:
|
|
||||||
WOP_KEY aesdec, 1 * koffs_r
|
|
||||||
sub koffs_r, 16
|
|
||||||
jnz @B
|
|
||||||
; WOP_KEY aesdeclast, 0
|
|
||||||
WOP aesdeclast, key_last
|
|
||||||
|
|
||||||
pxor @CatStr(xmm, %(ways_start_reg)), iv
|
|
||||||
i = 1
|
|
||||||
rept ways - 1
|
|
||||||
pxor @CatStr(xmm, %(ways_start_reg + i)), [rD + i * 16 - 16]
|
|
||||||
i = i + 1
|
|
||||||
endm
|
|
||||||
movdqa iv, [rD + ways * 16 - 16]
|
|
||||||
WOP WRITE_TO_DATA
|
|
||||||
|
|
||||||
add rD, ways * 16
|
|
||||||
AesCbc_Decode_HW_start_3::
|
|
||||||
check2:
|
|
||||||
sub rN, ways
|
|
||||||
jnc nextBlocks2
|
|
||||||
add rN, ways
|
|
||||||
|
|
||||||
sub ksize_x, 16
|
|
||||||
|
|
||||||
jmp check
|
|
||||||
nextBlock:
|
|
||||||
movdqa state, [rD]
|
|
||||||
mov koffs_x, ksize_x
|
|
||||||
; OP_KEY pxor, 1 * ksize_r + 32
|
|
||||||
pxor state, key0
|
|
||||||
; movdqa state0, [rD]
|
|
||||||
; movdqa state, key0
|
|
||||||
; pxor state, state0
|
|
||||||
@@:
|
|
||||||
OP_KEY aesdec, 1 * koffs_r + 16
|
|
||||||
OP_KEY aesdec, 1 * koffs_r
|
|
||||||
sub koffs_r, 32
|
|
||||||
jnz @B
|
|
||||||
OP_KEY aesdec, 16
|
|
||||||
; OP_KEY aesdeclast, 0
|
|
||||||
aesdeclast state, key_last
|
|
||||||
|
|
||||||
pxor state, iv
|
|
||||||
movdqa iv, [rD]
|
|
||||||
; movdqa iv, state0
|
|
||||||
movdqa [rD], state
|
|
||||||
|
|
||||||
add rD, 16
|
|
||||||
check:
|
|
||||||
sub rN, 1
|
|
||||||
jnc nextBlock
|
|
||||||
|
|
||||||
movdqa [keys - 32], iv
|
|
||||||
MY_EPILOG
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------- AVX ----------
|
|
||||||
|
|
||||||
|
|
||||||
AVX__WOP_n macro op
|
|
||||||
i = 0
|
|
||||||
rept ways
|
|
||||||
op (ways_start_reg + i)
|
|
||||||
i = i + 1
|
|
||||||
endm
|
|
||||||
endm
|
|
||||||
|
|
||||||
AVX__WOP macro op
|
|
||||||
i = 0
|
|
||||||
rept ways
|
|
||||||
op @CatStr(ymm, %(ways_start_reg + i))
|
|
||||||
i = i + 1
|
|
||||||
endm
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
AVX__WOP_KEY macro op:req, offs:req
|
|
||||||
vmovdqa key_ymm, ymmword ptr [keys2 + offs]
|
|
||||||
AVX__WOP_n op
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
AVX__CBC_START macro reg
|
|
||||||
; vpxor reg, key_ymm, ymmword ptr [rD + 32 * i]
|
|
||||||
vpxor reg, key0_ymm, ymmword ptr [rD + 32 * i]
|
|
||||||
endm
|
|
||||||
|
|
||||||
AVX__CBC_END macro reg
|
|
||||||
if i eq 0
|
|
||||||
vpxor reg, reg, iv_ymm
|
|
||||||
else
|
|
||||||
vpxor reg, reg, ymmword ptr [rD + i * 32 - 16]
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
AVX__WRITE_TO_DATA macro reg
|
|
||||||
vmovdqu ymmword ptr [rD + 32 * i], reg
|
|
||||||
endm
|
|
||||||
|
|
||||||
AVX__XOR_WITH_DATA macro reg
|
|
||||||
vpxor reg, reg, ymmword ptr [rD + 32 * i]
|
|
||||||
endm
|
|
||||||
|
|
||||||
AVX__CTR_START macro reg
|
|
||||||
vpaddq iv_ymm, iv_ymm, one_ymm
|
|
||||||
; vpxor reg, iv_ymm, key_ymm
|
|
||||||
vpxor reg, iv_ymm, key0_ymm
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
MY_VAES_INSTR_2 macro cmd, dest, a1, a2
|
|
||||||
db 0c4H
|
|
||||||
db 2 + 040H + 020h * (1 - (a2) / 8) + 080h * (1 - (dest) / 8)
|
|
||||||
db 5 + 8 * ((not (a1)) and 15)
|
|
||||||
db cmd
|
|
||||||
db 0c0H + 8 * ((dest) and 7) + ((a2) and 7)
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_VAES_INSTR macro cmd, dest, a
|
|
||||||
MY_VAES_INSTR_2 cmd, dest, dest, a
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_vaesenc macro dest, a
|
|
||||||
MY_VAES_INSTR 0dcH, dest, a
|
|
||||||
endm
|
|
||||||
MY_vaesenclast macro dest, a
|
|
||||||
MY_VAES_INSTR 0ddH, dest, a
|
|
||||||
endm
|
|
||||||
MY_vaesdec macro dest, a
|
|
||||||
MY_VAES_INSTR 0deH, dest, a
|
|
||||||
endm
|
|
||||||
MY_vaesdeclast macro dest, a
|
|
||||||
MY_VAES_INSTR 0dfH, dest, a
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
AVX__VAES_DEC macro reg
|
|
||||||
MY_vaesdec reg, key_ymm_n
|
|
||||||
endm
|
|
||||||
|
|
||||||
AVX__VAES_DEC_LAST_key_last macro reg
|
|
||||||
; MY_vaesdeclast reg, key_ymm_n
|
|
||||||
MY_vaesdeclast reg, key_last_ymm_n
|
|
||||||
endm
|
|
||||||
|
|
||||||
AVX__VAES_ENC macro reg
|
|
||||||
MY_vaesenc reg, key_ymm_n
|
|
||||||
endm
|
|
||||||
|
|
||||||
AVX__VAES_ENC_LAST macro reg
|
|
||||||
MY_vaesenclast reg, key_ymm_n
|
|
||||||
endm
|
|
||||||
|
|
||||||
AVX__vinserti128_TO_HIGH macro dest, src
|
|
||||||
vinserti128 dest, dest, src, 1
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
MY_PROC AesCbc_Decode_HW_256, 3
|
|
||||||
ifdef use_vaes_256
|
|
||||||
MY_PROLOG NUM_CBC_REGS
|
|
||||||
|
|
||||||
cmp rN, ways * 2
|
|
||||||
jb AesCbc_Decode_HW_start_2
|
|
||||||
|
|
||||||
vmovdqa iv, xmmword ptr [keys]
|
|
||||||
add keys, 32
|
|
||||||
|
|
||||||
vbroadcasti128 key0_ymm, xmmword ptr [keys + 1 * ksize_r]
|
|
||||||
vbroadcasti128 key_last_ymm, xmmword ptr [keys]
|
|
||||||
sub ksize_x, 16
|
|
||||||
mov koffs_x, ksize_x
|
|
||||||
add ksize_x, ksize_x
|
|
||||||
|
|
||||||
AVX_STACK_SUB = ((NUM_AES_KEYS_MAX + 1 - 2) * 32)
|
|
||||||
push keys2
|
|
||||||
sub r4, AVX_STACK_SUB
|
|
||||||
; sub r4, 32
|
|
||||||
; sub r4, ksize_r
|
|
||||||
; lea keys2, [r4 + 32]
|
|
||||||
mov keys2, r4
|
|
||||||
and keys2, -32
|
|
||||||
broad:
|
|
||||||
vbroadcasti128 key_ymm, xmmword ptr [keys + 1 * koffs_r]
|
|
||||||
vmovdqa ymmword ptr [keys2 + koffs_r * 2], key_ymm
|
|
||||||
sub koffs_r, 16
|
|
||||||
; jnc broad
|
|
||||||
jnz broad
|
|
||||||
|
|
||||||
sub rN, ways * 2
|
|
||||||
|
|
||||||
align 16
|
|
||||||
avx_cbcdec_nextBlock2:
|
|
||||||
mov koffs_x, ksize_x
|
|
||||||
; AVX__WOP_KEY AVX__CBC_START, 1 * koffs_r + 32
|
|
||||||
AVX__WOP AVX__CBC_START
|
|
||||||
@@:
|
|
||||||
AVX__WOP_KEY AVX__VAES_DEC, 1 * koffs_r
|
|
||||||
sub koffs_r, 32
|
|
||||||
jnz @B
|
|
||||||
; AVX__WOP_KEY AVX__VAES_DEC_LAST, 0
|
|
||||||
AVX__WOP_n AVX__VAES_DEC_LAST_key_last
|
|
||||||
|
|
||||||
AVX__vinserti128_TO_HIGH iv_ymm, xmmword ptr [rD]
|
|
||||||
AVX__WOP AVX__CBC_END
|
|
||||||
|
|
||||||
vmovdqa iv, xmmword ptr [rD + ways * 32 - 16]
|
|
||||||
AVX__WOP AVX__WRITE_TO_DATA
|
|
||||||
|
|
||||||
add rD, ways * 32
|
|
||||||
sub rN, ways * 2
|
|
||||||
jnc avx_cbcdec_nextBlock2
|
|
||||||
add rN, ways * 2
|
|
||||||
|
|
||||||
shr ksize_x, 1
|
|
||||||
|
|
||||||
; lea r4, [r4 + 1 * ksize_r + 32]
|
|
||||||
add r4, AVX_STACK_SUB
|
|
||||||
pop keys2
|
|
||||||
|
|
||||||
vzeroupper
|
|
||||||
jmp AesCbc_Decode_HW_start_3
|
|
||||||
else
|
|
||||||
jmp AesCbc_Decode_HW_start
|
|
||||||
endif
|
|
||||||
MY_ENDP
|
|
||||||
MY_SEG_ENDP
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------- AES-CBC Encode ----------
|
|
||||||
|
|
||||||
e0 equ xmm1
|
|
||||||
|
|
||||||
CENC_START_KEY equ 2
|
|
||||||
CENC_NUM_REG_KEYS equ (3 * 2)
|
|
||||||
; last_key equ @CatStr(xmm, %(CENC_START_KEY + CENC_NUM_REG_KEYS))
|
|
||||||
|
|
||||||
MY_SEG_PROC AesCbc_Encode_HW, 3
|
|
||||||
MY_PROLOG (CENC_START_KEY + CENC_NUM_REG_KEYS + 0)
|
|
||||||
|
|
||||||
movdqa state, [keys]
|
|
||||||
add keys, 32
|
|
||||||
|
|
||||||
i = 0
|
|
||||||
rept CENC_NUM_REG_KEYS
|
|
||||||
movdqa @CatStr(xmm, %(CENC_START_KEY + i)), [keys + i * 16]
|
|
||||||
i = i + 1
|
|
||||||
endm
|
|
||||||
|
|
||||||
add keys, ksize_r
|
|
||||||
neg ksize_r
|
|
||||||
add ksize_r, (16 * CENC_NUM_REG_KEYS)
|
|
||||||
; movdqa last_key, [keys]
|
|
||||||
jmp check_e
|
|
||||||
|
|
||||||
align 16
|
|
||||||
nextBlock_e:
|
|
||||||
movdqa e0, [rD]
|
|
||||||
mov koffs_r, ksize_r
|
|
||||||
pxor e0, @CatStr(xmm, %(CENC_START_KEY))
|
|
||||||
pxor state, e0
|
|
||||||
|
|
||||||
i = 1
|
|
||||||
rept (CENC_NUM_REG_KEYS - 1)
|
|
||||||
aesenc state, @CatStr(xmm, %(CENC_START_KEY + i))
|
|
||||||
i = i + 1
|
|
||||||
endm
|
|
||||||
|
|
||||||
@@:
|
|
||||||
OP_KEY aesenc, 1 * koffs_r
|
|
||||||
OP_KEY aesenc, 1 * koffs_r + 16
|
|
||||||
add koffs_r, 32
|
|
||||||
jnz @B
|
|
||||||
OP_KEY aesenclast, 0
|
|
||||||
; aesenclast state, last_key
|
|
||||||
|
|
||||||
movdqa [rD], state
|
|
||||||
add rD, 16
|
|
||||||
check_e:
|
|
||||||
sub rN, 1
|
|
||||||
jnc nextBlock_e
|
|
||||||
|
|
||||||
; movdqa [keys - 32], state
|
|
||||||
movdqa [keys + 1 * ksize_r - (16 * CENC_NUM_REG_KEYS) - 32], state
|
|
||||||
MY_EPILOG
|
|
||||||
MY_SEG_ENDP
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------- AES-CTR ----------
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
; ways = 11
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
one equ @CatStr(xmm, %(ways_start_reg + ways + 1))
|
|
||||||
one_ymm equ @CatStr(ymm, %(ways_start_reg + ways + 1))
|
|
||||||
key0 equ @CatStr(xmm, %(ways_start_reg + ways + 2))
|
|
||||||
key0_ymm equ @CatStr(ymm, %(ways_start_reg + ways + 2))
|
|
||||||
NUM_CTR_REGS equ (ways_start_reg + ways + 3)
|
|
||||||
|
|
||||||
INIT_CTR macro reg, _ppp_
|
|
||||||
paddq iv, one
|
|
||||||
movdqa reg, iv
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
MY_SEG_PROC AesCtr_Code_HW, 3
|
|
||||||
Ctr_start::
|
|
||||||
MY_PROLOG NUM_CTR_REGS
|
|
||||||
|
|
||||||
Ctr_start_2::
|
|
||||||
movdqa iv, [keys]
|
|
||||||
add keys, 32
|
|
||||||
movdqa key0, [keys]
|
|
||||||
|
|
||||||
add keys, ksize_r
|
|
||||||
neg ksize_r
|
|
||||||
add ksize_r, 16
|
|
||||||
|
|
||||||
Ctr_start_3::
|
|
||||||
mov koffs_x, 1
|
|
||||||
movd one, koffs_x
|
|
||||||
jmp check2_c
|
|
||||||
|
|
||||||
align 16
|
|
||||||
nextBlocks2_c:
|
|
||||||
WOP INIT_CTR, 0
|
|
||||||
mov koffs_r, ksize_r
|
|
||||||
; WOP_KEY pxor, 1 * koffs_r -16
|
|
||||||
WOP pxor, key0
|
|
||||||
@@:
|
|
||||||
WOP_KEY aesenc, 1 * koffs_r
|
|
||||||
add koffs_r, 16
|
|
||||||
jnz @B
|
|
||||||
WOP_KEY aesenclast, 0
|
|
||||||
|
|
||||||
WOP XOR_WITH_DATA
|
|
||||||
WOP WRITE_TO_DATA
|
|
||||||
add rD, ways * 16
|
|
||||||
check2_c:
|
|
||||||
sub rN, ways
|
|
||||||
jnc nextBlocks2_c
|
|
||||||
add rN, ways
|
|
||||||
|
|
||||||
sub keys, 16
|
|
||||||
add ksize_r, 16
|
|
||||||
|
|
||||||
jmp check_c
|
|
||||||
|
|
||||||
; align 16
|
|
||||||
nextBlock_c:
|
|
||||||
paddq iv, one
|
|
||||||
; movdqa state, [keys + 1 * koffs_r - 16]
|
|
||||||
movdqa state, key0
|
|
||||||
mov koffs_r, ksize_r
|
|
||||||
pxor state, iv
|
|
||||||
|
|
||||||
@@:
|
|
||||||
OP_KEY aesenc, 1 * koffs_r
|
|
||||||
OP_KEY aesenc, 1 * koffs_r + 16
|
|
||||||
add koffs_r, 32
|
|
||||||
jnz @B
|
|
||||||
OP_KEY aesenc, 0
|
|
||||||
OP_KEY aesenclast, 16
|
|
||||||
|
|
||||||
pxor state, [rD]
|
|
||||||
movdqa [rD], state
|
|
||||||
add rD, 16
|
|
||||||
check_c:
|
|
||||||
sub rN, 1
|
|
||||||
jnc nextBlock_c
|
|
||||||
|
|
||||||
; movdqa [keys - 32], iv
|
|
||||||
movdqa [keys + 1 * ksize_r - 16 - 32], iv
|
|
||||||
MY_EPILOG
|
|
||||||
|
|
||||||
|
|
||||||
MY_PROC AesCtr_Code_HW_256, 3
|
|
||||||
ifdef use_vaes_256
|
|
||||||
MY_PROLOG NUM_CTR_REGS
|
|
||||||
|
|
||||||
cmp rN, ways * 2
|
|
||||||
jb Ctr_start_2
|
|
||||||
|
|
||||||
vbroadcasti128 iv_ymm, xmmword ptr [keys]
|
|
||||||
add keys, 32
|
|
||||||
vbroadcasti128 key0_ymm, xmmword ptr [keys]
|
|
||||||
mov koffs_x, 1
|
|
||||||
vmovd one, koffs_x
|
|
||||||
vpsubq iv_ymm, iv_ymm, one_ymm
|
|
||||||
vpaddq one, one, one
|
|
||||||
AVX__vinserti128_TO_HIGH one_ymm, one
|
|
||||||
|
|
||||||
add keys, ksize_r
|
|
||||||
sub ksize_x, 16
|
|
||||||
neg ksize_r
|
|
||||||
mov koffs_r, ksize_r
|
|
||||||
add ksize_r, ksize_r
|
|
||||||
|
|
||||||
AVX_STACK_SUB = ((NUM_AES_KEYS_MAX + 1 - 1) * 32)
|
|
||||||
push keys2
|
|
||||||
lea keys2, [r4 - 32]
|
|
||||||
sub r4, AVX_STACK_SUB
|
|
||||||
and keys2, -32
|
|
||||||
vbroadcasti128 key_ymm, xmmword ptr [keys]
|
|
||||||
vmovdqa ymmword ptr [keys2], key_ymm
|
|
||||||
@@:
|
|
||||||
vbroadcasti128 key_ymm, xmmword ptr [keys + 1 * koffs_r]
|
|
||||||
vmovdqa ymmword ptr [keys2 + koffs_r * 2], key_ymm
|
|
||||||
add koffs_r, 16
|
|
||||||
jnz @B
|
|
||||||
|
|
||||||
sub rN, ways * 2
|
|
||||||
|
|
||||||
align 16
|
|
||||||
avx_ctr_nextBlock2:
|
|
||||||
mov koffs_r, ksize_r
|
|
||||||
AVX__WOP AVX__CTR_START
|
|
||||||
; AVX__WOP_KEY AVX__CTR_START, 1 * koffs_r - 32
|
|
||||||
@@:
|
|
||||||
AVX__WOP_KEY AVX__VAES_ENC, 1 * koffs_r
|
|
||||||
add koffs_r, 32
|
|
||||||
jnz @B
|
|
||||||
AVX__WOP_KEY AVX__VAES_ENC_LAST, 0
|
|
||||||
|
|
||||||
AVX__WOP AVX__XOR_WITH_DATA
|
|
||||||
AVX__WOP AVX__WRITE_TO_DATA
|
|
||||||
|
|
||||||
add rD, ways * 32
|
|
||||||
sub rN, ways * 2
|
|
||||||
jnc avx_ctr_nextBlock2
|
|
||||||
add rN, ways * 2
|
|
||||||
|
|
||||||
vextracti128 iv, iv_ymm, 1
|
|
||||||
sar ksize_r, 1
|
|
||||||
|
|
||||||
add r4, AVX_STACK_SUB
|
|
||||||
pop keys2
|
|
||||||
|
|
||||||
vzeroupper
|
|
||||||
jmp Ctr_start_3
|
|
||||||
else
|
|
||||||
jmp Ctr_start
|
|
||||||
endif
|
|
||||||
MY_ENDP
|
|
||||||
MY_SEG_ENDP
|
|
||||||
|
|
||||||
end
|
|
||||||
@@ -1,540 +0,0 @@
|
|||||||
; LzFindOpt.asm -- ASM version of GetMatchesSpecN_2() function
|
|
||||||
; 2024-06-18: Igor Pavlov : Public domain
|
|
||||||
;
|
|
||||||
|
|
||||||
ifndef x64
|
|
||||||
; x64=1
|
|
||||||
; .err <x64_IS_REQUIRED>
|
|
||||||
endif
|
|
||||||
|
|
||||||
include 7zAsm.asm
|
|
||||||
|
|
||||||
MY_ASM_START
|
|
||||||
|
|
||||||
ifndef Z7_LZ_FIND_OPT_ASM_USE_SEGMENT
|
|
||||||
if (IS_LINUX gt 0)
|
|
||||||
Z7_LZ_FIND_OPT_ASM_USE_SEGMENT equ 1
|
|
||||||
else
|
|
||||||
Z7_LZ_FIND_OPT_ASM_USE_SEGMENT equ 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef Z7_LZ_FIND_OPT_ASM_USE_SEGMENT
|
|
||||||
_TEXT$LZFINDOPT SEGMENT ALIGN(64) 'CODE'
|
|
||||||
MY_ALIGN macro num:req
|
|
||||||
align num
|
|
||||||
; align 16
|
|
||||||
endm
|
|
||||||
else
|
|
||||||
MY_ALIGN macro num:req
|
|
||||||
; We expect that ".text" is aligned for 16-bytes.
|
|
||||||
; So we don't need large alignment inside our function.
|
|
||||||
align 16
|
|
||||||
endm
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
MY_ALIGN_16 macro
|
|
||||||
MY_ALIGN 16
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_ALIGN_32 macro
|
|
||||||
MY_ALIGN 32
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_ALIGN_64 macro
|
|
||||||
MY_ALIGN 64
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
t0_L equ x0_L
|
|
||||||
t0_x equ x0
|
|
||||||
t0 equ r0
|
|
||||||
t1_x equ x3
|
|
||||||
t1 equ r3
|
|
||||||
|
|
||||||
cp_x equ t1_x
|
|
||||||
cp_r equ t1
|
|
||||||
m equ x5
|
|
||||||
m_r equ r5
|
|
||||||
len_x equ x6
|
|
||||||
len equ r6
|
|
||||||
diff_x equ x7
|
|
||||||
diff equ r7
|
|
||||||
len0 equ r10
|
|
||||||
len1_x equ x11
|
|
||||||
len1 equ r11
|
|
||||||
maxLen_x equ x12
|
|
||||||
maxLen equ r12
|
|
||||||
d equ r13
|
|
||||||
ptr0 equ r14
|
|
||||||
ptr1 equ r15
|
|
||||||
|
|
||||||
d_lim equ m_r
|
|
||||||
cycSize equ len_x
|
|
||||||
hash_lim equ len0
|
|
||||||
delta1_x equ len1_x
|
|
||||||
delta1_r equ len1
|
|
||||||
delta_x equ maxLen_x
|
|
||||||
delta_r equ maxLen
|
|
||||||
hash equ ptr0
|
|
||||||
src equ ptr1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (IS_LINUX gt 0)
|
|
||||||
|
|
||||||
; r1 r2 r8 r9 : win32
|
|
||||||
; r7 r6 r2 r1 r8 r9 : linux
|
|
||||||
|
|
||||||
lenLimit equ r8
|
|
||||||
lenLimit_x equ x8
|
|
||||||
; pos_r equ r2
|
|
||||||
pos equ x2
|
|
||||||
cur equ r1
|
|
||||||
son equ r9
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
lenLimit equ REG_ABI_PARAM_2
|
|
||||||
lenLimit_x equ REG_ABI_PARAM_2_x
|
|
||||||
pos equ REG_ABI_PARAM_1_x
|
|
||||||
cur equ REG_ABI_PARAM_0
|
|
||||||
son equ REG_ABI_PARAM_3
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
if (IS_LINUX gt 0)
|
|
||||||
maxLen_OFFS equ (REG_SIZE * (6 + 1))
|
|
||||||
else
|
|
||||||
cutValue_OFFS equ (REG_SIZE * (8 + 1 + 4))
|
|
||||||
d_OFFS equ (REG_SIZE + cutValue_OFFS)
|
|
||||||
maxLen_OFFS equ (REG_SIZE + d_OFFS)
|
|
||||||
endif
|
|
||||||
hash_OFFS equ (REG_SIZE + maxLen_OFFS)
|
|
||||||
limit_OFFS equ (REG_SIZE + hash_OFFS)
|
|
||||||
size_OFFS equ (REG_SIZE + limit_OFFS)
|
|
||||||
cycPos_OFFS equ (REG_SIZE + size_OFFS)
|
|
||||||
cycSize_OFFS equ (REG_SIZE + cycPos_OFFS)
|
|
||||||
posRes_OFFS equ (REG_SIZE + cycSize_OFFS)
|
|
||||||
|
|
||||||
if (IS_LINUX gt 0)
|
|
||||||
else
|
|
||||||
cutValue_PAR equ [r0 + cutValue_OFFS]
|
|
||||||
d_PAR equ [r0 + d_OFFS]
|
|
||||||
endif
|
|
||||||
maxLen_PAR equ [r0 + maxLen_OFFS]
|
|
||||||
hash_PAR equ [r0 + hash_OFFS]
|
|
||||||
limit_PAR equ [r0 + limit_OFFS]
|
|
||||||
size_PAR equ [r0 + size_OFFS]
|
|
||||||
cycPos_PAR equ [r0 + cycPos_OFFS]
|
|
||||||
cycSize_PAR equ [r0 + cycSize_OFFS]
|
|
||||||
posRes_PAR equ [r0 + posRes_OFFS]
|
|
||||||
|
|
||||||
|
|
||||||
cutValue_VAR equ DWORD PTR [r4 + 8 * 0]
|
|
||||||
cutValueCur_VAR equ DWORD PTR [r4 + 8 * 0 + 4]
|
|
||||||
cycPos_VAR equ DWORD PTR [r4 + 8 * 1 + 0]
|
|
||||||
cycSize_VAR equ DWORD PTR [r4 + 8 * 1 + 4]
|
|
||||||
hash_VAR equ QWORD PTR [r4 + 8 * 2]
|
|
||||||
limit_VAR equ QWORD PTR [r4 + 8 * 3]
|
|
||||||
size_VAR equ QWORD PTR [r4 + 8 * 4]
|
|
||||||
distances equ QWORD PTR [r4 + 8 * 5]
|
|
||||||
maxLen_VAR equ QWORD PTR [r4 + 8 * 6]
|
|
||||||
|
|
||||||
Old_RSP equ QWORD PTR [r4 + 8 * 7]
|
|
||||||
LOCAL_SIZE equ 8 * 8
|
|
||||||
|
|
||||||
COPY_VAR_32 macro dest_var, src_var
|
|
||||||
mov x3, src_var
|
|
||||||
mov dest_var, x3
|
|
||||||
endm
|
|
||||||
|
|
||||||
COPY_VAR_64 macro dest_var, src_var
|
|
||||||
mov r3, src_var
|
|
||||||
mov dest_var, r3
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
ifdef Z7_LZ_FIND_OPT_ASM_USE_SEGMENT
|
|
||||||
; MY_ALIGN_64
|
|
||||||
else
|
|
||||||
MY_ALIGN_16
|
|
||||||
endif
|
|
||||||
MY_PROC GetMatchesSpecN_2, 13
|
|
||||||
MY_PUSH_PRESERVED_ABI_REGS
|
|
||||||
mov r0, RSP
|
|
||||||
lea r3, [r0 - LOCAL_SIZE]
|
|
||||||
and r3, -64
|
|
||||||
mov RSP, r3
|
|
||||||
mov Old_RSP, r0
|
|
||||||
|
|
||||||
if (IS_LINUX gt 0)
|
|
||||||
mov d, REG_ABI_PARAM_5 ; r13 = r9
|
|
||||||
mov cutValue_VAR, REG_ABI_PARAM_4_x ; = r8
|
|
||||||
mov son, REG_ABI_PARAM_3 ; r9 = r1
|
|
||||||
mov r8, REG_ABI_PARAM_2 ; r8 = r2
|
|
||||||
mov pos, REG_ABI_PARAM_1_x ; r2 = x6
|
|
||||||
mov r1, REG_ABI_PARAM_0 ; r1 = r7
|
|
||||||
else
|
|
||||||
COPY_VAR_32 cutValue_VAR, cutValue_PAR
|
|
||||||
mov d, d_PAR
|
|
||||||
endif
|
|
||||||
|
|
||||||
COPY_VAR_64 limit_VAR, limit_PAR
|
|
||||||
|
|
||||||
mov hash_lim, size_PAR
|
|
||||||
mov size_VAR, hash_lim
|
|
||||||
|
|
||||||
mov cp_x, cycPos_PAR
|
|
||||||
mov hash, hash_PAR
|
|
||||||
|
|
||||||
mov cycSize, cycSize_PAR
|
|
||||||
mov cycSize_VAR, cycSize
|
|
||||||
|
|
||||||
; we want cur in (rcx). So we change the cur and lenLimit variables
|
|
||||||
sub lenLimit, cur
|
|
||||||
neg lenLimit_x
|
|
||||||
inc lenLimit_x
|
|
||||||
|
|
||||||
mov t0_x, maxLen_PAR
|
|
||||||
sub t0, lenLimit
|
|
||||||
mov maxLen_VAR, t0
|
|
||||||
|
|
||||||
jmp main_loop
|
|
||||||
|
|
||||||
MY_ALIGN_64
|
|
||||||
fill_empty:
|
|
||||||
; ptr0 = *ptr1 = kEmptyHashValue;
|
|
||||||
mov QWORD PTR [ptr1], 0
|
|
||||||
inc pos
|
|
||||||
inc cp_x
|
|
||||||
mov DWORD PTR [d - 4], 0
|
|
||||||
cmp d, limit_VAR
|
|
||||||
jae fin
|
|
||||||
cmp hash, hash_lim
|
|
||||||
je fin
|
|
||||||
|
|
||||||
; MY_ALIGN_64
|
|
||||||
main_loop:
|
|
||||||
; UInt32 delta = *hash++;
|
|
||||||
mov diff_x, [hash] ; delta
|
|
||||||
add hash, 4
|
|
||||||
; mov cycPos_VAR, cp_x
|
|
||||||
|
|
||||||
inc cur
|
|
||||||
add d, 4
|
|
||||||
mov m, pos
|
|
||||||
sub m, diff_x; ; matchPos
|
|
||||||
|
|
||||||
; CLzRef *ptr1 = son + ((size_t)(pos) << 1) - CYC_TO_POS_OFFSET * 2;
|
|
||||||
lea ptr1, [son + 8 * cp_r]
|
|
||||||
; mov cycSize, cycSize_VAR
|
|
||||||
cmp pos, cycSize
|
|
||||||
jb directMode ; if (pos < cycSize_VAR)
|
|
||||||
|
|
||||||
; CYC MODE
|
|
||||||
|
|
||||||
cmp diff_x, cycSize
|
|
||||||
jae fill_empty ; if (delta >= cycSize_VAR)
|
|
||||||
|
|
||||||
xor t0_x, t0_x
|
|
||||||
mov cycPos_VAR, cp_x
|
|
||||||
sub cp_x, diff_x
|
|
||||||
; jae prepare_for_tree_loop
|
|
||||||
; add cp_x, cycSize
|
|
||||||
cmovb t0_x, cycSize
|
|
||||||
add cp_x, t0_x ; cp_x += (cycPos < delta ? cycSize : 0)
|
|
||||||
jmp prepare_for_tree_loop
|
|
||||||
|
|
||||||
|
|
||||||
directMode:
|
|
||||||
cmp diff_x, pos
|
|
||||||
je fill_empty ; if (delta == pos)
|
|
||||||
jae fin_error ; if (delta >= pos)
|
|
||||||
|
|
||||||
mov cycPos_VAR, cp_x
|
|
||||||
mov cp_x, m
|
|
||||||
|
|
||||||
prepare_for_tree_loop:
|
|
||||||
mov len0, lenLimit
|
|
||||||
mov hash_VAR, hash
|
|
||||||
; CLzRef *ptr0 = son + ((size_t)(pos) << 1) - CYC_TO_POS_OFFSET * 2 + 1;
|
|
||||||
lea ptr0, [ptr1 + 4]
|
|
||||||
; UInt32 *_distances = ++d;
|
|
||||||
mov distances, d
|
|
||||||
|
|
||||||
neg len0
|
|
||||||
mov len1, len0
|
|
||||||
|
|
||||||
mov t0_x, cutValue_VAR
|
|
||||||
mov maxLen, maxLen_VAR
|
|
||||||
mov cutValueCur_VAR, t0_x
|
|
||||||
|
|
||||||
MY_ALIGN_32
|
|
||||||
tree_loop:
|
|
||||||
neg diff
|
|
||||||
mov len, len0
|
|
||||||
cmp len1, len0
|
|
||||||
cmovb len, len1 ; len = (len1 < len0 ? len1 : len0);
|
|
||||||
add diff, cur
|
|
||||||
|
|
||||||
mov t0_x, [son + cp_r * 8] ; prefetch
|
|
||||||
movzx t0_x, BYTE PTR [diff + 1 * len]
|
|
||||||
lea cp_r, [son + cp_r * 8]
|
|
||||||
cmp [cur + 1 * len], t0_L
|
|
||||||
je matched_1
|
|
||||||
|
|
||||||
jb left_0
|
|
||||||
|
|
||||||
mov [ptr1], m
|
|
||||||
mov m, [cp_r + 4]
|
|
||||||
lea ptr1, [cp_r + 4]
|
|
||||||
sub diff, cur ; FIX32
|
|
||||||
jmp next_node
|
|
||||||
|
|
||||||
MY_ALIGN_32
|
|
||||||
left_0:
|
|
||||||
mov [ptr0], m
|
|
||||||
mov m, [cp_r]
|
|
||||||
mov ptr0, cp_r
|
|
||||||
sub diff, cur ; FIX32
|
|
||||||
; jmp next_node
|
|
||||||
|
|
||||||
; ------------ NEXT NODE ------------
|
|
||||||
; MY_ALIGN_32
|
|
||||||
next_node:
|
|
||||||
mov cycSize, cycSize_VAR
|
|
||||||
dec cutValueCur_VAR
|
|
||||||
je finish_tree
|
|
||||||
|
|
||||||
add diff_x, pos ; prev_match = pos + diff
|
|
||||||
cmp m, diff_x
|
|
||||||
jae fin_error ; if (new_match >= prev_match)
|
|
||||||
|
|
||||||
mov diff_x, pos
|
|
||||||
sub diff_x, m ; delta = pos - new_match
|
|
||||||
cmp pos, cycSize
|
|
||||||
jae cyc_mode_2 ; if (pos >= cycSize)
|
|
||||||
|
|
||||||
mov cp_x, m
|
|
||||||
test m, m
|
|
||||||
jne tree_loop ; if (m != 0)
|
|
||||||
|
|
||||||
finish_tree:
|
|
||||||
; ptr0 = *ptr1 = kEmptyHashValue;
|
|
||||||
mov DWORD PTR [ptr0], 0
|
|
||||||
mov DWORD PTR [ptr1], 0
|
|
||||||
|
|
||||||
inc pos
|
|
||||||
|
|
||||||
; _distances[-1] = (UInt32)(d - _distances);
|
|
||||||
mov t0, distances
|
|
||||||
mov t1, d
|
|
||||||
sub t1, t0
|
|
||||||
shr t1_x, 2
|
|
||||||
mov [t0 - 4], t1_x
|
|
||||||
|
|
||||||
cmp d, limit_VAR
|
|
||||||
jae fin ; if (d >= limit)
|
|
||||||
|
|
||||||
mov cp_x, cycPos_VAR
|
|
||||||
mov hash, hash_VAR
|
|
||||||
mov hash_lim, size_VAR
|
|
||||||
inc cp_x
|
|
||||||
cmp hash, hash_lim
|
|
||||||
jne main_loop ; if (hash != size)
|
|
||||||
jmp fin
|
|
||||||
|
|
||||||
|
|
||||||
MY_ALIGN_32
|
|
||||||
cyc_mode_2:
|
|
||||||
cmp diff_x, cycSize
|
|
||||||
jae finish_tree ; if (delta >= cycSize)
|
|
||||||
|
|
||||||
mov cp_x, cycPos_VAR
|
|
||||||
xor t0_x, t0_x
|
|
||||||
sub cp_x, diff_x ; cp_x = cycPos - delta
|
|
||||||
cmovb t0_x, cycSize
|
|
||||||
add cp_x, t0_x ; cp_x += (cycPos < delta ? cycSize : 0)
|
|
||||||
jmp tree_loop
|
|
||||||
|
|
||||||
|
|
||||||
MY_ALIGN_32
|
|
||||||
matched_1:
|
|
||||||
|
|
||||||
inc len
|
|
||||||
; cmp len_x, lenLimit_x
|
|
||||||
je short lenLimit_reach
|
|
||||||
movzx t0_x, BYTE PTR [diff + 1 * len]
|
|
||||||
cmp [cur + 1 * len], t0_L
|
|
||||||
jne mismatch
|
|
||||||
|
|
||||||
|
|
||||||
MY_ALIGN_32
|
|
||||||
match_loop:
|
|
||||||
; while (++len != lenLimit) (len[diff] != len[0]) ;
|
|
||||||
|
|
||||||
inc len
|
|
||||||
; cmp len_x, lenLimit_x
|
|
||||||
je short lenLimit_reach
|
|
||||||
movzx t0_x, BYTE PTR [diff + 1 * len]
|
|
||||||
cmp BYTE PTR [cur + 1 * len], t0_L
|
|
||||||
je match_loop
|
|
||||||
|
|
||||||
mismatch:
|
|
||||||
jb left_2
|
|
||||||
|
|
||||||
mov [ptr1], m
|
|
||||||
mov m, [cp_r + 4]
|
|
||||||
lea ptr1, [cp_r + 4]
|
|
||||||
mov len1, len
|
|
||||||
|
|
||||||
jmp max_update
|
|
||||||
|
|
||||||
MY_ALIGN_32
|
|
||||||
left_2:
|
|
||||||
mov [ptr0], m
|
|
||||||
mov m, [cp_r]
|
|
||||||
mov ptr0, cp_r
|
|
||||||
mov len0, len
|
|
||||||
|
|
||||||
max_update:
|
|
||||||
sub diff, cur ; restore diff
|
|
||||||
|
|
||||||
cmp maxLen, len
|
|
||||||
jae next_node
|
|
||||||
|
|
||||||
mov maxLen, len
|
|
||||||
add len, lenLimit
|
|
||||||
mov [d], len_x
|
|
||||||
mov t0_x, diff_x
|
|
||||||
not t0_x
|
|
||||||
mov [d + 4], t0_x
|
|
||||||
add d, 8
|
|
||||||
|
|
||||||
jmp next_node
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MY_ALIGN_32
|
|
||||||
lenLimit_reach:
|
|
||||||
|
|
||||||
mov delta_r, cur
|
|
||||||
sub delta_r, diff
|
|
||||||
lea delta1_r, [delta_r - 1]
|
|
||||||
|
|
||||||
mov t0_x, [cp_r]
|
|
||||||
mov [ptr1], t0_x
|
|
||||||
mov t0_x, [cp_r + 4]
|
|
||||||
mov [ptr0], t0_x
|
|
||||||
|
|
||||||
mov [d], lenLimit_x
|
|
||||||
mov [d + 4], delta1_x
|
|
||||||
add d, 8
|
|
||||||
|
|
||||||
; _distances[-1] = (UInt32)(d - _distances);
|
|
||||||
mov t0, distances
|
|
||||||
mov t1, d
|
|
||||||
sub t1, t0
|
|
||||||
shr t1_x, 2
|
|
||||||
mov [t0 - 4], t1_x
|
|
||||||
|
|
||||||
mov hash, hash_VAR
|
|
||||||
mov hash_lim, size_VAR
|
|
||||||
|
|
||||||
inc pos
|
|
||||||
mov cp_x, cycPos_VAR
|
|
||||||
inc cp_x
|
|
||||||
|
|
||||||
mov d_lim, limit_VAR
|
|
||||||
mov cycSize, cycSize_VAR
|
|
||||||
; if (hash == size || *hash != delta || lenLimit[diff] != lenLimit[0] || d >= limit)
|
|
||||||
; break;
|
|
||||||
cmp hash, hash_lim
|
|
||||||
je fin
|
|
||||||
cmp d, d_lim
|
|
||||||
jae fin
|
|
||||||
cmp delta_x, [hash]
|
|
||||||
jne main_loop
|
|
||||||
movzx t0_x, BYTE PTR [diff]
|
|
||||||
cmp [cur], t0_L
|
|
||||||
jne main_loop
|
|
||||||
|
|
||||||
; jmp main_loop ; bypass for debug
|
|
||||||
|
|
||||||
mov cycPos_VAR, cp_x
|
|
||||||
shl len, 3 ; cycSize * 8
|
|
||||||
sub diff, cur ; restore diff
|
|
||||||
xor t0_x, t0_x
|
|
||||||
cmp cp_x, delta_x ; cmp (cycPos_VAR, delta)
|
|
||||||
lea cp_r, [son + 8 * cp_r] ; dest
|
|
||||||
lea src, [cp_r + 8 * diff]
|
|
||||||
cmovb t0, len ; t0 = (cycPos_VAR < delta ? cycSize * 8 : 0)
|
|
||||||
add src, t0
|
|
||||||
add len, son ; len = son + cycSize * 8
|
|
||||||
|
|
||||||
|
|
||||||
MY_ALIGN_32
|
|
||||||
long_loop:
|
|
||||||
add hash, 4
|
|
||||||
|
|
||||||
; *(UInt64 *)(void *)ptr = ((const UInt64 *)(const void *)ptr)[diff];
|
|
||||||
|
|
||||||
mov t0, [src]
|
|
||||||
add src, 8
|
|
||||||
mov [cp_r], t0
|
|
||||||
add cp_r, 8
|
|
||||||
cmp src, len
|
|
||||||
cmove src, son ; if end of (son) buffer is reached, we wrap to begin
|
|
||||||
|
|
||||||
mov DWORD PTR [d], 2
|
|
||||||
mov [d + 4], lenLimit_x
|
|
||||||
mov [d + 8], delta1_x
|
|
||||||
add d, 12
|
|
||||||
|
|
||||||
inc cur
|
|
||||||
|
|
||||||
cmp hash, hash_lim
|
|
||||||
je long_footer
|
|
||||||
cmp delta_x, [hash]
|
|
||||||
jne long_footer
|
|
||||||
movzx t0_x, BYTE PTR [diff + 1 * cur]
|
|
||||||
cmp [cur], t0_L
|
|
||||||
jne long_footer
|
|
||||||
cmp d, d_lim
|
|
||||||
jb long_loop
|
|
||||||
|
|
||||||
long_footer:
|
|
||||||
sub cp_r, son
|
|
||||||
shr cp_r, 3
|
|
||||||
add pos, cp_x
|
|
||||||
sub pos, cycPos_VAR
|
|
||||||
mov cycSize, cycSize_VAR
|
|
||||||
|
|
||||||
cmp d, d_lim
|
|
||||||
jae fin
|
|
||||||
cmp hash, hash_lim
|
|
||||||
jne main_loop
|
|
||||||
jmp fin
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fin_error:
|
|
||||||
xor d, d
|
|
||||||
|
|
||||||
fin:
|
|
||||||
mov RSP, Old_RSP
|
|
||||||
mov t0, [r4 + posRes_OFFS]
|
|
||||||
mov [t0], pos
|
|
||||||
mov r0, d
|
|
||||||
|
|
||||||
MY_POP_PRESERVED_ABI_REGS
|
|
||||||
MY_ENDP
|
|
||||||
|
|
||||||
ifdef Z7_LZ_FIND_OPT_ASM_USE_SEGMENT
|
|
||||||
_TEXT$LZFINDOPT ENDS
|
|
||||||
endif
|
|
||||||
|
|
||||||
end
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,263 +0,0 @@
|
|||||||
; Sha1Opt.asm -- SHA-1 optimized code for SHA-1 x86 hardware instructions
|
|
||||||
; 2024-06-16 : Igor Pavlov : Public domain
|
|
||||||
|
|
||||||
include 7zAsm.asm
|
|
||||||
|
|
||||||
MY_ASM_START
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CONST SEGMENT READONLY
|
|
||||||
|
|
||||||
align 16
|
|
||||||
Reverse_Endian_Mask db 15,14,13,12, 11,10,9,8, 7,6,5,4, 3,2,1,0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CONST ENDS
|
|
||||||
|
|
||||||
; _TEXT$SHA1OPT SEGMENT 'CODE'
|
|
||||||
|
|
||||||
ifndef x64
|
|
||||||
.686
|
|
||||||
.xmm
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
rNum equ REG_ABI_PARAM_2
|
|
||||||
if (IS_LINUX eq 0)
|
|
||||||
LOCAL_SIZE equ (16 * 2)
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
rNum equ r0
|
|
||||||
LOCAL_SIZE equ (16 * 1)
|
|
||||||
endif
|
|
||||||
|
|
||||||
rState equ REG_ABI_PARAM_0
|
|
||||||
rData equ REG_ABI_PARAM_1
|
|
||||||
|
|
||||||
|
|
||||||
MY_sha1rnds4 macro a1, a2, imm
|
|
||||||
db 0fH, 03aH, 0ccH, (0c0H + a1 * 8 + a2), imm
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_SHA_INSTR macro cmd, a1, a2
|
|
||||||
db 0fH, 038H, cmd, (0c0H + a1 * 8 + a2)
|
|
||||||
endm
|
|
||||||
|
|
||||||
cmd_sha1nexte equ 0c8H
|
|
||||||
cmd_sha1msg1 equ 0c9H
|
|
||||||
cmd_sha1msg2 equ 0caH
|
|
||||||
|
|
||||||
MY_sha1nexte macro a1, a2
|
|
||||||
MY_SHA_INSTR cmd_sha1nexte, a1, a2
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_sha1msg1 macro a1, a2
|
|
||||||
MY_SHA_INSTR cmd_sha1msg1, a1, a2
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_sha1msg2 macro a1, a2
|
|
||||||
MY_SHA_INSTR cmd_sha1msg2, a1, a2
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_PROLOG macro
|
|
||||||
ifdef x64
|
|
||||||
if (IS_LINUX eq 0)
|
|
||||||
movdqa [r4 + 8], xmm6
|
|
||||||
movdqa [r4 + 8 + 16], xmm7
|
|
||||||
sub r4, LOCAL_SIZE + 8
|
|
||||||
movdqa [r4 ], xmm8
|
|
||||||
movdqa [r4 + 16], xmm9
|
|
||||||
endif
|
|
||||||
else ; x86
|
|
||||||
if (IS_CDECL gt 0)
|
|
||||||
mov rState, [r4 + REG_SIZE * 1]
|
|
||||||
mov rData, [r4 + REG_SIZE * 2]
|
|
||||||
mov rNum, [r4 + REG_SIZE * 3]
|
|
||||||
else ; fastcall
|
|
||||||
mov rNum, [r4 + REG_SIZE * 1]
|
|
||||||
endif
|
|
||||||
push r5
|
|
||||||
mov r5, r4
|
|
||||||
and r4, -16
|
|
||||||
sub r4, LOCAL_SIZE
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_EPILOG macro
|
|
||||||
ifdef x64
|
|
||||||
if (IS_LINUX eq 0)
|
|
||||||
movdqa xmm8, [r4]
|
|
||||||
movdqa xmm9, [r4 + 16]
|
|
||||||
add r4, LOCAL_SIZE + 8
|
|
||||||
movdqa xmm6, [r4 + 8]
|
|
||||||
movdqa xmm7, [r4 + 8 + 16]
|
|
||||||
endif
|
|
||||||
else ; x86
|
|
||||||
mov r4, r5
|
|
||||||
pop r5
|
|
||||||
endif
|
|
||||||
MY_ENDP
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
e0_N equ 0
|
|
||||||
e1_N equ 1
|
|
||||||
abcd_N equ 2
|
|
||||||
e0_save_N equ 3
|
|
||||||
w_regs equ 4
|
|
||||||
|
|
||||||
e0 equ @CatStr(xmm, %e0_N)
|
|
||||||
e1 equ @CatStr(xmm, %e1_N)
|
|
||||||
abcd equ @CatStr(xmm, %abcd_N)
|
|
||||||
e0_save equ @CatStr(xmm, %e0_save_N)
|
|
||||||
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
abcd_save equ xmm8
|
|
||||||
mask2 equ xmm9
|
|
||||||
else
|
|
||||||
abcd_save equ [r4]
|
|
||||||
mask2 equ e1
|
|
||||||
endif
|
|
||||||
|
|
||||||
LOAD_MASK macro
|
|
||||||
movdqa mask2, XMMWORD PTR Reverse_Endian_Mask
|
|
||||||
endm
|
|
||||||
|
|
||||||
LOAD_W macro k:req
|
|
||||||
movdqu @CatStr(xmm, %(w_regs + k)), [rData + (16 * (k))]
|
|
||||||
pshufb @CatStr(xmm, %(w_regs + k)), mask2
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
; pre2 can be 2 or 3 (recommended)
|
|
||||||
pre2 equ 3
|
|
||||||
pre1 equ (pre2 + 1)
|
|
||||||
|
|
||||||
NUM_ROUNDS4 equ 20
|
|
||||||
|
|
||||||
RND4 macro k
|
|
||||||
movdqa @CatStr(xmm, %(e0_N + ((k + 1) mod 2))), abcd
|
|
||||||
MY_sha1rnds4 abcd_N, (e0_N + (k mod 2)), k / 5
|
|
||||||
|
|
||||||
nextM = (w_regs + ((k + 1) mod 4))
|
|
||||||
|
|
||||||
if (k EQ NUM_ROUNDS4 - 1)
|
|
||||||
nextM = e0_save_N
|
|
||||||
endif
|
|
||||||
|
|
||||||
MY_sha1nexte (e0_N + ((k + 1) mod 2)), nextM
|
|
||||||
|
|
||||||
if (k GE (4 - pre2)) AND (k LT (NUM_ROUNDS4 - pre2))
|
|
||||||
pxor @CatStr(xmm, %(w_regs + ((k + pre2) mod 4))), @CatStr(xmm, %(w_regs + ((k + pre2 - 2) mod 4)))
|
|
||||||
endif
|
|
||||||
|
|
||||||
if (k GE (4 - pre1)) AND (k LT (NUM_ROUNDS4 - pre1))
|
|
||||||
MY_sha1msg1 (w_regs + ((k + pre1) mod 4)), (w_regs + ((k + pre1 - 3) mod 4))
|
|
||||||
endif
|
|
||||||
|
|
||||||
if (k GE (4 - pre2)) AND (k LT (NUM_ROUNDS4 - pre2))
|
|
||||||
MY_sha1msg2 (w_regs + ((k + pre2) mod 4)), (w_regs + ((k + pre2 - 1) mod 4))
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
REVERSE_STATE macro
|
|
||||||
; abcd ; dcba
|
|
||||||
; e0 ; 000e
|
|
||||||
pshufd abcd, abcd, 01bH ; abcd
|
|
||||||
pshufd e0, e0, 01bH ; e000
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MY_PROC Sha1_UpdateBlocks_HW, 3
|
|
||||||
MY_PROLOG
|
|
||||||
|
|
||||||
cmp rNum, 0
|
|
||||||
je end_c
|
|
||||||
|
|
||||||
movdqu abcd, [rState] ; dcba
|
|
||||||
movd e0, dword ptr [rState + 16] ; 000e
|
|
||||||
|
|
||||||
REVERSE_STATE
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
LOAD_MASK
|
|
||||||
endif
|
|
||||||
|
|
||||||
align 16
|
|
||||||
nextBlock:
|
|
||||||
movdqa abcd_save, abcd
|
|
||||||
movdqa e0_save, e0
|
|
||||||
|
|
||||||
ifndef x64
|
|
||||||
LOAD_MASK
|
|
||||||
endif
|
|
||||||
|
|
||||||
LOAD_W 0
|
|
||||||
LOAD_W 1
|
|
||||||
LOAD_W 2
|
|
||||||
LOAD_W 3
|
|
||||||
|
|
||||||
paddd e0, @CatStr(xmm, %(w_regs))
|
|
||||||
k = 0
|
|
||||||
rept NUM_ROUNDS4
|
|
||||||
RND4 k
|
|
||||||
k = k + 1
|
|
||||||
endm
|
|
||||||
|
|
||||||
paddd abcd, abcd_save
|
|
||||||
|
|
||||||
|
|
||||||
add rData, 64
|
|
||||||
sub rNum, 1
|
|
||||||
jnz nextBlock
|
|
||||||
|
|
||||||
REVERSE_STATE
|
|
||||||
|
|
||||||
movdqu [rState], abcd
|
|
||||||
movd dword ptr [rState + 16], e0
|
|
||||||
|
|
||||||
end_c:
|
|
||||||
MY_EPILOG
|
|
||||||
|
|
||||||
; _TEXT$SHA1OPT ENDS
|
|
||||||
|
|
||||||
end
|
|
||||||
@@ -1,275 +0,0 @@
|
|||||||
; Sha256Opt.asm -- SHA-256 optimized code for SHA-256 x86 hardware instructions
|
|
||||||
; 2024-06-16 : Igor Pavlov : Public domain
|
|
||||||
|
|
||||||
include 7zAsm.asm
|
|
||||||
|
|
||||||
MY_ASM_START
|
|
||||||
|
|
||||||
; .data
|
|
||||||
; public K
|
|
||||||
|
|
||||||
; we can use external SHA256_K_ARRAY defined in Sha256.c
|
|
||||||
; but we must guarantee that SHA256_K_ARRAY is aligned for 16-bytes
|
|
||||||
|
|
||||||
COMMENT @
|
|
||||||
ifdef x64
|
|
||||||
K_CONST equ SHA256_K_ARRAY
|
|
||||||
else
|
|
||||||
K_CONST equ _SHA256_K_ARRAY
|
|
||||||
endif
|
|
||||||
EXTRN K_CONST:xmmword
|
|
||||||
@
|
|
||||||
|
|
||||||
CONST SEGMENT READONLY
|
|
||||||
|
|
||||||
align 16
|
|
||||||
Reverse_Endian_Mask db 3,2,1,0, 7,6,5,4, 11,10,9,8, 15,14,13,12
|
|
||||||
|
|
||||||
; COMMENT @
|
|
||||||
align 16
|
|
||||||
K_CONST \
|
|
||||||
DD 0428a2f98H, 071374491H, 0b5c0fbcfH, 0e9b5dba5H
|
|
||||||
DD 03956c25bH, 059f111f1H, 0923f82a4H, 0ab1c5ed5H
|
|
||||||
DD 0d807aa98H, 012835b01H, 0243185beH, 0550c7dc3H
|
|
||||||
DD 072be5d74H, 080deb1feH, 09bdc06a7H, 0c19bf174H
|
|
||||||
DD 0e49b69c1H, 0efbe4786H, 00fc19dc6H, 0240ca1ccH
|
|
||||||
DD 02de92c6fH, 04a7484aaH, 05cb0a9dcH, 076f988daH
|
|
||||||
DD 0983e5152H, 0a831c66dH, 0b00327c8H, 0bf597fc7H
|
|
||||||
DD 0c6e00bf3H, 0d5a79147H, 006ca6351H, 014292967H
|
|
||||||
DD 027b70a85H, 02e1b2138H, 04d2c6dfcH, 053380d13H
|
|
||||||
DD 0650a7354H, 0766a0abbH, 081c2c92eH, 092722c85H
|
|
||||||
DD 0a2bfe8a1H, 0a81a664bH, 0c24b8b70H, 0c76c51a3H
|
|
||||||
DD 0d192e819H, 0d6990624H, 0f40e3585H, 0106aa070H
|
|
||||||
DD 019a4c116H, 01e376c08H, 02748774cH, 034b0bcb5H
|
|
||||||
DD 0391c0cb3H, 04ed8aa4aH, 05b9cca4fH, 0682e6ff3H
|
|
||||||
DD 0748f82eeH, 078a5636fH, 084c87814H, 08cc70208H
|
|
||||||
DD 090befffaH, 0a4506cebH, 0bef9a3f7H, 0c67178f2H
|
|
||||||
; @
|
|
||||||
|
|
||||||
CONST ENDS
|
|
||||||
|
|
||||||
; _TEXT$SHA256OPT SEGMENT 'CODE'
|
|
||||||
|
|
||||||
ifndef x64
|
|
||||||
.686
|
|
||||||
.xmm
|
|
||||||
endif
|
|
||||||
|
|
||||||
; jwasm-based assemblers for linux and linker from new versions of binutils
|
|
||||||
; can generate incorrect code for load [ARRAY + offset] instructions.
|
|
||||||
; 22.00: we load K_CONST offset to (rTable) register to avoid jwasm+binutils problem
|
|
||||||
rTable equ r0
|
|
||||||
; rTable equ K_CONST
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
rNum equ REG_ABI_PARAM_2
|
|
||||||
if (IS_LINUX eq 0)
|
|
||||||
LOCAL_SIZE equ (16 * 2)
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
rNum equ r3
|
|
||||||
LOCAL_SIZE equ (16 * 1)
|
|
||||||
endif
|
|
||||||
|
|
||||||
rState equ REG_ABI_PARAM_0
|
|
||||||
rData equ REG_ABI_PARAM_1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MY_SHA_INSTR macro cmd, a1, a2
|
|
||||||
db 0fH, 038H, cmd, (0c0H + a1 * 8 + a2)
|
|
||||||
endm
|
|
||||||
|
|
||||||
cmd_sha256rnds2 equ 0cbH
|
|
||||||
cmd_sha256msg1 equ 0ccH
|
|
||||||
cmd_sha256msg2 equ 0cdH
|
|
||||||
|
|
||||||
MY_sha256rnds2 macro a1, a2
|
|
||||||
MY_SHA_INSTR cmd_sha256rnds2, a1, a2
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_sha256msg1 macro a1, a2
|
|
||||||
MY_SHA_INSTR cmd_sha256msg1, a1, a2
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_sha256msg2 macro a1, a2
|
|
||||||
MY_SHA_INSTR cmd_sha256msg2, a1, a2
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_PROLOG macro
|
|
||||||
ifdef x64
|
|
||||||
if (IS_LINUX eq 0)
|
|
||||||
movdqa [r4 + 8], xmm6
|
|
||||||
movdqa [r4 + 8 + 16], xmm7
|
|
||||||
sub r4, LOCAL_SIZE + 8
|
|
||||||
movdqa [r4 ], xmm8
|
|
||||||
movdqa [r4 + 16], xmm9
|
|
||||||
endif
|
|
||||||
else ; x86
|
|
||||||
push r3
|
|
||||||
push r5
|
|
||||||
mov r5, r4
|
|
||||||
NUM_PUSH_REGS equ 2
|
|
||||||
PARAM_OFFSET equ (REG_SIZE * (1 + NUM_PUSH_REGS))
|
|
||||||
if (IS_CDECL gt 0)
|
|
||||||
mov rState, [r4 + PARAM_OFFSET]
|
|
||||||
mov rData, [r4 + PARAM_OFFSET + REG_SIZE * 1]
|
|
||||||
mov rNum, [r4 + PARAM_OFFSET + REG_SIZE * 2]
|
|
||||||
else ; fastcall
|
|
||||||
mov rNum, [r4 + PARAM_OFFSET]
|
|
||||||
endif
|
|
||||||
and r4, -16
|
|
||||||
sub r4, LOCAL_SIZE
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_EPILOG macro
|
|
||||||
ifdef x64
|
|
||||||
if (IS_LINUX eq 0)
|
|
||||||
movdqa xmm8, [r4]
|
|
||||||
movdqa xmm9, [r4 + 16]
|
|
||||||
add r4, LOCAL_SIZE + 8
|
|
||||||
movdqa xmm6, [r4 + 8]
|
|
||||||
movdqa xmm7, [r4 + 8 + 16]
|
|
||||||
endif
|
|
||||||
else ; x86
|
|
||||||
mov r4, r5
|
|
||||||
pop r5
|
|
||||||
pop r3
|
|
||||||
endif
|
|
||||||
MY_ENDP
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
msg equ xmm0
|
|
||||||
tmp equ xmm0
|
|
||||||
state0_N equ 2
|
|
||||||
state1_N equ 3
|
|
||||||
w_regs equ 4
|
|
||||||
|
|
||||||
|
|
||||||
state1_save equ xmm1
|
|
||||||
state0 equ @CatStr(xmm, %state0_N)
|
|
||||||
state1 equ @CatStr(xmm, %state1_N)
|
|
||||||
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
state0_save equ xmm8
|
|
||||||
mask2 equ xmm9
|
|
||||||
else
|
|
||||||
state0_save equ [r4]
|
|
||||||
mask2 equ xmm0
|
|
||||||
endif
|
|
||||||
|
|
||||||
LOAD_MASK macro
|
|
||||||
movdqa mask2, XMMWORD PTR Reverse_Endian_Mask
|
|
||||||
endm
|
|
||||||
|
|
||||||
LOAD_W macro k:req
|
|
||||||
movdqu @CatStr(xmm, %(w_regs + k)), [rData + (16 * (k))]
|
|
||||||
pshufb @CatStr(xmm, %(w_regs + k)), mask2
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
; pre1 <= 4 && pre2 >= 1 && pre1 > pre2 && (pre1 - pre2) <= 1
|
|
||||||
pre1 equ 3
|
|
||||||
pre2 equ 2
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
RND4 macro k
|
|
||||||
movdqa msg, xmmword ptr [rTable + (k) * 16]
|
|
||||||
paddd msg, @CatStr(xmm, %(w_regs + ((k + 0) mod 4)))
|
|
||||||
MY_sha256rnds2 state0_N, state1_N
|
|
||||||
pshufd msg, msg, 0eH
|
|
||||||
|
|
||||||
if (k GE (4 - pre1)) AND (k LT (16 - pre1))
|
|
||||||
; w4[0] = msg1(w4[-4], w4[-3])
|
|
||||||
MY_sha256msg1 (w_regs + ((k + pre1) mod 4)), (w_regs + ((k + pre1 - 3) mod 4))
|
|
||||||
endif
|
|
||||||
|
|
||||||
MY_sha256rnds2 state1_N, state0_N
|
|
||||||
|
|
||||||
if (k GE (4 - pre2)) AND (k LT (16 - pre2))
|
|
||||||
movdqa tmp, @CatStr(xmm, %(w_regs + ((k + pre2 - 1) mod 4)))
|
|
||||||
palignr tmp, @CatStr(xmm, %(w_regs + ((k + pre2 - 2) mod 4))), 4
|
|
||||||
paddd @CatStr(xmm, %(w_regs + ((k + pre2) mod 4))), tmp
|
|
||||||
; w4[0] = msg2(w4[0], w4[-1])
|
|
||||||
MY_sha256msg2 %(w_regs + ((k + pre2) mod 4)), %(w_regs + ((k + pre2 - 1) mod 4))
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
REVERSE_STATE macro
|
|
||||||
; state0 ; dcba
|
|
||||||
; state1 ; hgfe
|
|
||||||
pshufd tmp, state0, 01bH ; abcd
|
|
||||||
pshufd state0, state1, 01bH ; efgh
|
|
||||||
movdqa state1, state0 ; efgh
|
|
||||||
punpcklqdq state0, tmp ; cdgh
|
|
||||||
punpckhqdq state1, tmp ; abef
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
MY_PROC Sha256_UpdateBlocks_HW, 3
|
|
||||||
MY_PROLOG
|
|
||||||
|
|
||||||
lea rTable, [K_CONST]
|
|
||||||
|
|
||||||
cmp rNum, 0
|
|
||||||
je end_c
|
|
||||||
|
|
||||||
movdqu state0, [rState] ; dcba
|
|
||||||
movdqu state1, [rState + 16] ; hgfe
|
|
||||||
|
|
||||||
REVERSE_STATE
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
LOAD_MASK
|
|
||||||
endif
|
|
||||||
|
|
||||||
align 16
|
|
||||||
nextBlock:
|
|
||||||
movdqa state0_save, state0
|
|
||||||
movdqa state1_save, state1
|
|
||||||
|
|
||||||
ifndef x64
|
|
||||||
LOAD_MASK
|
|
||||||
endif
|
|
||||||
|
|
||||||
LOAD_W 0
|
|
||||||
LOAD_W 1
|
|
||||||
LOAD_W 2
|
|
||||||
LOAD_W 3
|
|
||||||
|
|
||||||
|
|
||||||
k = 0
|
|
||||||
rept 16
|
|
||||||
RND4 k
|
|
||||||
k = k + 1
|
|
||||||
endm
|
|
||||||
|
|
||||||
paddd state0, state0_save
|
|
||||||
paddd state1, state1_save
|
|
||||||
|
|
||||||
add rData, 64
|
|
||||||
sub rNum, 1
|
|
||||||
jnz nextBlock
|
|
||||||
|
|
||||||
REVERSE_STATE
|
|
||||||
|
|
||||||
movdqu [rState], state0
|
|
||||||
movdqu [rState + 16], state1
|
|
||||||
|
|
||||||
end_c:
|
|
||||||
MY_EPILOG
|
|
||||||
|
|
||||||
; _TEXT$SHA256OPT ENDS
|
|
||||||
|
|
||||||
end
|
|
||||||
@@ -1,860 +0,0 @@
|
|||||||
; SortTest.asm -- ASM version of HeapSort() function
|
|
||||||
; Igor Pavlov : Public domain
|
|
||||||
|
|
||||||
include ../../../../Asm/x86/7zAsm.asm
|
|
||||||
|
|
||||||
MY_ASM_START
|
|
||||||
|
|
||||||
ifndef Z7_SORT_ASM_USE_SEGMENT
|
|
||||||
if (IS_LINUX gt 0)
|
|
||||||
; Z7_SORT_ASM_USE_SEGMENT equ 1
|
|
||||||
else
|
|
||||||
; Z7_SORT_ASM_USE_SEGMENT equ 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef Z7_SORT_ASM_USE_SEGMENT
|
|
||||||
_TEXT$Z7_SORT SEGMENT ALIGN(64) 'CODE'
|
|
||||||
MY_ALIGN macro num:req
|
|
||||||
align num
|
|
||||||
endm
|
|
||||||
else
|
|
||||||
MY_ALIGN macro num:req
|
|
||||||
; We expect that ".text" is aligned for 16-bytes.
|
|
||||||
; So we don't need large alignment inside our function.
|
|
||||||
align 16
|
|
||||||
endm
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
MY_ALIGN_16 macro
|
|
||||||
MY_ALIGN 16
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_ALIGN_32 macro
|
|
||||||
MY_ALIGN 32
|
|
||||||
endm
|
|
||||||
|
|
||||||
MY_ALIGN_64 macro
|
|
||||||
MY_ALIGN 64
|
|
||||||
endm
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
|
|
||||||
NUM_PREFETCH_LEVELS equ 3 ; to prefetch 1x 64-bytes line (is good for most cases)
|
|
||||||
; NUM_PREFETCH_LEVELS equ 4 ; to prefetch 2x 64-bytes lines (better for big arrays)
|
|
||||||
|
|
||||||
acc equ x0
|
|
||||||
k equ r0
|
|
||||||
k_x equ x0
|
|
||||||
|
|
||||||
p equ r1
|
|
||||||
|
|
||||||
s equ r2
|
|
||||||
s_x equ x2
|
|
||||||
|
|
||||||
a0 equ x3
|
|
||||||
t0 equ a0
|
|
||||||
|
|
||||||
a3 equ x5
|
|
||||||
qq equ a3
|
|
||||||
|
|
||||||
a1 equ x6
|
|
||||||
t1 equ a1
|
|
||||||
t1_r equ r6
|
|
||||||
|
|
||||||
a2 equ x7
|
|
||||||
t2 equ a2
|
|
||||||
|
|
||||||
i equ r8
|
|
||||||
e0 equ x8
|
|
||||||
|
|
||||||
e1 equ x9
|
|
||||||
|
|
||||||
num_last equ r10
|
|
||||||
num_last_x equ x10
|
|
||||||
|
|
||||||
next4_lim equ r11
|
|
||||||
pref_lim equ r12
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SORT_2_WITH_TEMP_REG macro b0, b1, temp_reg
|
|
||||||
mov temp_reg, b0
|
|
||||||
cmp b0, b1
|
|
||||||
cmovae b0, b1 ; min
|
|
||||||
cmovae b1, temp_reg ; max
|
|
||||||
endm
|
|
||||||
|
|
||||||
SORT macro b0, b1
|
|
||||||
SORT_2_WITH_TEMP_REG b0, b1, acc
|
|
||||||
endm
|
|
||||||
|
|
||||||
LOAD macro dest:req, index:req
|
|
||||||
mov dest, [p + 4 * index]
|
|
||||||
endm
|
|
||||||
|
|
||||||
STORE macro reg:req, index:req
|
|
||||||
mov [p + 4 * index], reg
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
if (NUM_PREFETCH_LEVELS gt 3)
|
|
||||||
num_prefetches equ (1 SHL (NUM_PREFETCH_LEVELS - 3))
|
|
||||||
else
|
|
||||||
num_prefetches equ 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
PREFETCH_OP macro offs
|
|
||||||
cur_offset = 7 * 4 ; it's average offset in 64-bytes cache line.
|
|
||||||
; cur_offset = 0 ; we can use zero offset, if we are sure that array is aligned for 64-bytes.
|
|
||||||
rept num_prefetches
|
|
||||||
if 1
|
|
||||||
prefetcht0 byte ptr [p + offs + cur_offset]
|
|
||||||
else
|
|
||||||
mov pref_x, dword ptr [p + offs + cur_offset]
|
|
||||||
endif
|
|
||||||
cur_offset = cur_offset + 64
|
|
||||||
endm
|
|
||||||
endm
|
|
||||||
|
|
||||||
PREFETCH_MY macro
|
|
||||||
if 1
|
|
||||||
if 1
|
|
||||||
shl k, NUM_PREFETCH_LEVELS + 3
|
|
||||||
else
|
|
||||||
; we delay prefetch instruction to improve main loads
|
|
||||||
shl k, NUM_PREFETCH_LEVELS
|
|
||||||
shl k, 3
|
|
||||||
; shl k, 0
|
|
||||||
endif
|
|
||||||
PREFETCH_OP k
|
|
||||||
elseif 1
|
|
||||||
shl k, 3
|
|
||||||
PREFETCH_OP k * (1 SHL NUM_PREFETCH_LEVELS) ; change it
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
STEP_1 macro exit_label, prefetch_macro
|
|
||||||
use_cmov_1 equ 1 ; set 1 for cmov, but it's slower in some cases
|
|
||||||
; set 0 for LOAD after adc s, 0
|
|
||||||
cmp t0, t1
|
|
||||||
if use_cmov_1
|
|
||||||
cmovb t0, t1
|
|
||||||
; STORE t0, k
|
|
||||||
endif
|
|
||||||
adc s, 0
|
|
||||||
if use_cmov_1 eq 0
|
|
||||||
LOAD t0, s
|
|
||||||
endif
|
|
||||||
cmp qq, t0
|
|
||||||
jae exit_label
|
|
||||||
if 1 ; use_cmov_1 eq 0
|
|
||||||
STORE t0, k
|
|
||||||
endif
|
|
||||||
prefetch_macro
|
|
||||||
mov t0, [p + s * 8]
|
|
||||||
mov t1, [p + s * 8 + 4]
|
|
||||||
mov k, s
|
|
||||||
add s, s ; slower for some cpus
|
|
||||||
; lea s, dword ptr [s + s] ; slower for some cpus
|
|
||||||
; shl s, 1 ; faster for some cpus
|
|
||||||
; lea s, dword ptr [s * 2] ; faster for some cpus
|
|
||||||
rept 0 ; 1000 for debug : 0 for normal
|
|
||||||
; number of calls in generate_stage : ~0.6 of number of items
|
|
||||||
shl k, 0
|
|
||||||
endm
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
STEP_2 macro exit_label, prefetch_macro
|
|
||||||
use_cmov_2 equ 0 ; set 1 for cmov, but it's slower in some cases
|
|
||||||
; set 0 for LOAD after adc s, 0
|
|
||||||
cmp t0, t1
|
|
||||||
if use_cmov_2
|
|
||||||
mov t2, t0
|
|
||||||
cmovb t2, t1
|
|
||||||
; STORE t2, k
|
|
||||||
endif
|
|
||||||
mov t0, [p + s * 8]
|
|
||||||
mov t1, [p + s * 8 + 4]
|
|
||||||
cmovb t0, [p + s * 8 + 8]
|
|
||||||
cmovb t1, [p + s * 8 + 12]
|
|
||||||
adc s, 0
|
|
||||||
if use_cmov_2 eq 0
|
|
||||||
LOAD t2, s
|
|
||||||
endif
|
|
||||||
cmp qq, t2
|
|
||||||
jae exit_label
|
|
||||||
if 1 ; use_cmov_2 eq 0
|
|
||||||
STORE t2, k
|
|
||||||
endif
|
|
||||||
prefetch_macro
|
|
||||||
mov k, s
|
|
||||||
; add s, s
|
|
||||||
; lea s, [s + s]
|
|
||||||
shl s, 1
|
|
||||||
; lea s, [s * 2]
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
MOVE_SMALLEST_UP macro STEP, use_prefetch, num_unrolls
|
|
||||||
LOCAL exit_1, exit_2, leaves, opt_loop, last_nodes
|
|
||||||
|
|
||||||
; s == k * 2
|
|
||||||
; t0 == (p)[s]
|
|
||||||
; t1 == (p)[s + 1]
|
|
||||||
cmp k, next4_lim
|
|
||||||
jae leaves
|
|
||||||
|
|
||||||
rept num_unrolls
|
|
||||||
STEP exit_2
|
|
||||||
cmp k, next4_lim
|
|
||||||
jae leaves
|
|
||||||
endm
|
|
||||||
|
|
||||||
if use_prefetch
|
|
||||||
prefetch_macro equ PREFETCH_MY
|
|
||||||
pref_lim_2 equ pref_lim
|
|
||||||
; lea pref_lim, dword ptr [num_last + 1]
|
|
||||||
; shr pref_lim, NUM_PREFETCH_LEVELS + 1
|
|
||||||
cmp k, pref_lim_2
|
|
||||||
jae last_nodes
|
|
||||||
else
|
|
||||||
prefetch_macro equ
|
|
||||||
pref_lim_2 equ next4_lim
|
|
||||||
endif
|
|
||||||
|
|
||||||
MY_ALIGN_16
|
|
||||||
opt_loop:
|
|
||||||
STEP exit_2, prefetch_macro
|
|
||||||
cmp k, pref_lim_2
|
|
||||||
jb opt_loop
|
|
||||||
|
|
||||||
last_nodes:
|
|
||||||
; k >= pref_lim_2
|
|
||||||
; 2 cases are possible:
|
|
||||||
; case-1: num_after_prefetch_levels == 0 && next4_lim = pref_lim_2
|
|
||||||
; case-2: num_after_prefetch_levels == NUM_PREFETCH_LEVELS - 1 &&
|
|
||||||
; next4_lim = pref_lim_2 / (NUM_PREFETCH_LEVELS - 1)
|
|
||||||
if use_prefetch
|
|
||||||
yyy = NUM_PREFETCH_LEVELS - 1
|
|
||||||
while yyy
|
|
||||||
yyy = yyy - 1
|
|
||||||
STEP exit_2
|
|
||||||
if yyy
|
|
||||||
cmp k, next4_lim
|
|
||||||
jae leaves
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
endif
|
|
||||||
|
|
||||||
leaves:
|
|
||||||
; k >= next4_lim == (num_last + 1) / 4 must be provided by previous code.
|
|
||||||
; we have 2 nodes in (s) level : always
|
|
||||||
; we can have some nodes in (s * 2) level : low probability case
|
|
||||||
; we have no nodes in (s * 4) level
|
|
||||||
; s == k * 2
|
|
||||||
; t0 == (p)[s]
|
|
||||||
; t1 == (p)[s + 1]
|
|
||||||
cmp t0, t1
|
|
||||||
cmovb t0, t1
|
|
||||||
adc s, 0
|
|
||||||
STORE t0, k
|
|
||||||
|
|
||||||
; t0 == (p)[s]
|
|
||||||
; s / 2 == k : (s) is index of max item from (p)[k * 2], (p)[k * 2 + 1]
|
|
||||||
; we have 3 possible cases here:
|
|
||||||
; s * 2 > num_last : (s) node has no childs
|
|
||||||
; s * 2 == num_last : (s) node has 1 leaf child that is last item of array
|
|
||||||
; s * 2 < num_last : (s) node has 2 leaf childs. We provide (s * 4 > num_last)
|
|
||||||
; we check for (s * 2 > num_last) before "cmp qq, t0" check, because
|
|
||||||
; we will replace conditional jump with cmov instruction later.
|
|
||||||
lea t1_r, dword ptr [s + s]
|
|
||||||
cmp t1_r, num_last
|
|
||||||
ja exit_1 ; if (s * 2 > num_last), we have no childs : it's high probability branch
|
|
||||||
|
|
||||||
; it's low probability branch
|
|
||||||
; s * 2 <= num_last
|
|
||||||
cmp qq, t0
|
|
||||||
jae exit_2
|
|
||||||
|
|
||||||
; qq < t0, so we go to next level
|
|
||||||
; we check 1 or 2 childs in next level
|
|
||||||
mov t0, [p + s * 8]
|
|
||||||
mov k, s
|
|
||||||
mov s, t1_r
|
|
||||||
cmp t1_r, num_last
|
|
||||||
je @F ; (s == num_last) means that we have single child in tree
|
|
||||||
|
|
||||||
; (s < num_last) : so we must read both childs and select max of them.
|
|
||||||
mov t1, [p + k * 8 + 4]
|
|
||||||
cmp t0, t1
|
|
||||||
cmovb t0, t1
|
|
||||||
adc s, 0
|
|
||||||
@@:
|
|
||||||
STORE t0, k
|
|
||||||
exit_1:
|
|
||||||
; t0 == (p)[s], s / 2 == k : (s) is index of max item from (p)[k * 2], (p)[k * 2 + 1]
|
|
||||||
cmp qq, t0
|
|
||||||
cmovb k, s
|
|
||||||
exit_2:
|
|
||||||
STORE qq, k
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ifdef Z7_SORT_ASM_USE_SEGMENT
|
|
||||||
; MY_ALIGN_64
|
|
||||||
else
|
|
||||||
MY_ALIGN_16
|
|
||||||
endif
|
|
||||||
|
|
||||||
MY_PROC HeapSort, 2
|
|
||||||
|
|
||||||
if (IS_LINUX gt 0)
|
|
||||||
mov p, REG_ABI_PARAM_0 ; r1 <- r7 : linux
|
|
||||||
endif
|
|
||||||
mov num_last, REG_ABI_PARAM_1 ; r10 <- r6 : linux
|
|
||||||
; r10 <- r2 : win64
|
|
||||||
cmp num_last, 2
|
|
||||||
jb end_1
|
|
||||||
|
|
||||||
; MY_PUSH_PRESERVED_ABI_REGS
|
|
||||||
MY_PUSH_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11
|
|
||||||
push r12
|
|
||||||
|
|
||||||
cmp num_last, 4
|
|
||||||
ja sort_5
|
|
||||||
|
|
||||||
LOAD a0, 0
|
|
||||||
LOAD a1, 1
|
|
||||||
SORT a0, a1
|
|
||||||
cmp num_last, 3
|
|
||||||
jb end_2
|
|
||||||
|
|
||||||
LOAD a2, 2
|
|
||||||
je sort_3
|
|
||||||
|
|
||||||
LOAD a3, 3
|
|
||||||
SORT a2, a3
|
|
||||||
SORT a1, a3
|
|
||||||
STORE a3, 3
|
|
||||||
sort_3:
|
|
||||||
SORT a0, a2
|
|
||||||
SORT a1, a2
|
|
||||||
STORE a2, 2
|
|
||||||
jmp end_2
|
|
||||||
|
|
||||||
sort_5:
|
|
||||||
; (num_last > 4) is required here
|
|
||||||
; if (num_last >= 6) : we will use optimized loop for leaf nodes loop_down_1
|
|
||||||
mov next4_lim, num_last
|
|
||||||
shr next4_lim, 2
|
|
||||||
|
|
||||||
dec num_last
|
|
||||||
mov k, num_last
|
|
||||||
shr k, 1
|
|
||||||
mov i, num_last
|
|
||||||
shr i, 2
|
|
||||||
test num_last, 1
|
|
||||||
jnz size_even
|
|
||||||
|
|
||||||
; ODD number of items. So we compare parent with single child
|
|
||||||
LOAD t1, num_last
|
|
||||||
LOAD t0, k
|
|
||||||
SORT_2_WITH_TEMP_REG t1, t0, t2
|
|
||||||
STORE t1, num_last
|
|
||||||
STORE t0, k
|
|
||||||
dec k
|
|
||||||
|
|
||||||
size_even:
|
|
||||||
cmp k, i
|
|
||||||
jbe loop_down ; jump for num_last == 4 case
|
|
||||||
|
|
||||||
if 0 ; 1 for debug
|
|
||||||
mov r15, k
|
|
||||||
mov r14d, 1 ; 100
|
|
||||||
loop_benchmark:
|
|
||||||
endif
|
|
||||||
; optimized loop for leaf nodes:
|
|
||||||
mov t0, [p + k * 8]
|
|
||||||
mov t1, [p + k * 8 + 4]
|
|
||||||
|
|
||||||
MY_ALIGN_16
|
|
||||||
loop_down_1:
|
|
||||||
; we compare parent with max of childs:
|
|
||||||
; lea s, dword ptr [2 * k]
|
|
||||||
mov s, k
|
|
||||||
cmp t0, t1
|
|
||||||
cmovb t0, t1
|
|
||||||
adc s, s
|
|
||||||
LOAD t2, k
|
|
||||||
STORE t0, k
|
|
||||||
cmp t2, t0
|
|
||||||
cmovae s, k
|
|
||||||
dec k
|
|
||||||
; we preload next items before STORE operation for calculated address
|
|
||||||
mov t0, [p + k * 8]
|
|
||||||
mov t1, [p + k * 8 + 4]
|
|
||||||
STORE t2, s
|
|
||||||
cmp k, i
|
|
||||||
jne loop_down_1
|
|
||||||
|
|
||||||
if 0 ; 1 for debug
|
|
||||||
mov k, r15
|
|
||||||
dec r14d
|
|
||||||
jnz loop_benchmark
|
|
||||||
; jmp end_debug
|
|
||||||
endif
|
|
||||||
|
|
||||||
MY_ALIGN_16
|
|
||||||
loop_down:
|
|
||||||
mov t0, [p + i * 8]
|
|
||||||
mov t1, [p + i * 8 + 4]
|
|
||||||
LOAD qq, i
|
|
||||||
mov k, i
|
|
||||||
lea s, dword ptr [i + i]
|
|
||||||
; jmp end_debug
|
|
||||||
DOWN_use_prefetch equ 0
|
|
||||||
DOWN_num_unrolls equ 0
|
|
||||||
MOVE_SMALLEST_UP STEP_1, DOWN_use_prefetch, DOWN_num_unrolls
|
|
||||||
sub i, 1
|
|
||||||
jnb loop_down
|
|
||||||
|
|
||||||
; jmp end_debug
|
|
||||||
LOAD e0, 0
|
|
||||||
LOAD e1, 1
|
|
||||||
|
|
||||||
LEVEL_3_LIMIT equ 8 ; 8 is default, but 7 also can work
|
|
||||||
|
|
||||||
cmp num_last, LEVEL_3_LIMIT + 1
|
|
||||||
jb main_loop_sort_5
|
|
||||||
|
|
||||||
MY_ALIGN_16
|
|
||||||
main_loop_sort:
|
|
||||||
; num_last > LEVEL_3_LIMIT
|
|
||||||
; p[size--] = p[0];
|
|
||||||
LOAD qq, num_last
|
|
||||||
STORE e0, num_last
|
|
||||||
mov e0, e1
|
|
||||||
|
|
||||||
mov next4_lim, num_last
|
|
||||||
shr next4_lim, 2
|
|
||||||
mov pref_lim, num_last
|
|
||||||
shr pref_lim, NUM_PREFETCH_LEVELS + 1
|
|
||||||
|
|
||||||
dec num_last
|
|
||||||
if 0 ; 1 for debug
|
|
||||||
; that optional optimization can improve the performance, if there are identical items in array
|
|
||||||
; 3 times improvement : if all items in array are identical
|
|
||||||
; 20% improvement : if items are different for 1 bit only
|
|
||||||
; 1-10% improvement : if items are different for (2+) bits
|
|
||||||
; no gain : if items are different
|
|
||||||
cmp qq, e1
|
|
||||||
jae next_iter_main
|
|
||||||
endif
|
|
||||||
LOAD e1, 2
|
|
||||||
LOAD t0, 3
|
|
||||||
mov k_x, 2
|
|
||||||
cmp e1, t0
|
|
||||||
cmovb e1, t0
|
|
||||||
mov t0, [p + 4 * (4 + 0)]
|
|
||||||
mov t1, [p + 4 * (4 + 1)]
|
|
||||||
cmovb t0, [p + 4 * (4 + 2)]
|
|
||||||
cmovb t1, [p + 4 * (4 + 3)]
|
|
||||||
adc k_x, 0
|
|
||||||
; (qq <= e1), because the tree is correctly sorted
|
|
||||||
; also here we could check (qq >= e1) or (qq == e1) for faster exit
|
|
||||||
lea s, dword ptr [k + k]
|
|
||||||
MAIN_use_prefetch equ 1
|
|
||||||
MAIN_num_unrolls equ 0
|
|
||||||
MOVE_SMALLEST_UP STEP_2, MAIN_use_prefetch, MAIN_num_unrolls
|
|
||||||
|
|
||||||
next_iter_main:
|
|
||||||
cmp num_last, LEVEL_3_LIMIT
|
|
||||||
jne main_loop_sort
|
|
||||||
|
|
||||||
; num_last == LEVEL_3_LIMIT
|
|
||||||
main_loop_sort_5:
|
|
||||||
; 4 <= num_last <= LEVEL_3_LIMIT
|
|
||||||
; p[size--] = p[0];
|
|
||||||
LOAD qq, num_last
|
|
||||||
STORE e0, num_last
|
|
||||||
mov e0, e1
|
|
||||||
dec num_last_x
|
|
||||||
|
|
||||||
LOAD e1, 2
|
|
||||||
LOAD t0, 3
|
|
||||||
mov k_x, 2
|
|
||||||
cmp e1, t0
|
|
||||||
cmovb e1, t0
|
|
||||||
adc k_x, 0
|
|
||||||
|
|
||||||
lea s_x, dword ptr [k * 2]
|
|
||||||
cmp s_x, num_last_x
|
|
||||||
ja exit_2
|
|
||||||
|
|
||||||
mov t0, [p + k * 8]
|
|
||||||
je exit_1
|
|
||||||
|
|
||||||
; s < num_last
|
|
||||||
mov t1, [p + k * 8 + 4]
|
|
||||||
cmp t0, t1
|
|
||||||
cmovb t0, t1
|
|
||||||
adc s_x, 0
|
|
||||||
exit_1:
|
|
||||||
STORE t0, k
|
|
||||||
cmp qq, t0
|
|
||||||
cmovb k_x, s_x
|
|
||||||
exit_2:
|
|
||||||
STORE qq, k
|
|
||||||
cmp num_last_x, 3
|
|
||||||
jne main_loop_sort_5
|
|
||||||
|
|
||||||
; num_last == 3 (real_size == 4)
|
|
||||||
LOAD a0, 2
|
|
||||||
LOAD a1, 3
|
|
||||||
STORE e1, 2
|
|
||||||
STORE e0, 3
|
|
||||||
SORT a0, a1
|
|
||||||
end_2:
|
|
||||||
STORE a0, 0
|
|
||||||
STORE a1, 1
|
|
||||||
; end_debug:
|
|
||||||
; MY_POP_PRESERVED_ABI_REGS
|
|
||||||
pop r12
|
|
||||||
MY_POP_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11
|
|
||||||
end_1:
|
|
||||||
MY_ENDP
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else
|
|
||||||
; ------------ x86 32-bit ------------
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
IS_CDECL = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
acc equ x0
|
|
||||||
k equ r0
|
|
||||||
k_x equ acc
|
|
||||||
|
|
||||||
p equ r1
|
|
||||||
|
|
||||||
num_last equ r2
|
|
||||||
num_last_x equ x2
|
|
||||||
|
|
||||||
a0 equ x3
|
|
||||||
t0 equ a0
|
|
||||||
|
|
||||||
a3 equ x5
|
|
||||||
i equ r5
|
|
||||||
e0 equ a3
|
|
||||||
|
|
||||||
a1 equ x6
|
|
||||||
qq equ a1
|
|
||||||
|
|
||||||
a2 equ x7
|
|
||||||
s equ r7
|
|
||||||
s_x equ a2
|
|
||||||
|
|
||||||
|
|
||||||
SORT macro b0, b1
|
|
||||||
cmp b1, b0
|
|
||||||
jae @F
|
|
||||||
if 1
|
|
||||||
xchg b0, b1
|
|
||||||
else
|
|
||||||
mov acc, b0
|
|
||||||
mov b0, b1 ; min
|
|
||||||
mov b1, acc ; max
|
|
||||||
endif
|
|
||||||
@@:
|
|
||||||
endm
|
|
||||||
|
|
||||||
LOAD macro dest:req, index:req
|
|
||||||
mov dest, [p + 4 * index]
|
|
||||||
endm
|
|
||||||
|
|
||||||
STORE macro reg:req, index:req
|
|
||||||
mov [p + 4 * index], reg
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
STEP_1 macro exit_label
|
|
||||||
mov t0, [p + k * 8]
|
|
||||||
cmp t0, [p + k * 8 + 4]
|
|
||||||
adc s, 0
|
|
||||||
LOAD t0, s
|
|
||||||
STORE t0, k ; we lookahed stooring for most expected branch
|
|
||||||
cmp qq, t0
|
|
||||||
jae exit_label
|
|
||||||
; STORE t0, k ; use if
|
|
||||||
mov k, s
|
|
||||||
add s, s
|
|
||||||
; lea s, dword ptr [s + s]
|
|
||||||
; shl s, 1
|
|
||||||
; lea s, dword ptr [s * 2]
|
|
||||||
endm
|
|
||||||
|
|
||||||
STEP_BRANCH macro exit_label
|
|
||||||
mov t0, [p + k * 8]
|
|
||||||
cmp t0, [p + k * 8 + 4]
|
|
||||||
jae @F
|
|
||||||
inc s
|
|
||||||
mov t0, [p + k * 8 + 4]
|
|
||||||
@@:
|
|
||||||
cmp qq, t0
|
|
||||||
jae exit_label
|
|
||||||
STORE t0, k
|
|
||||||
mov k, s
|
|
||||||
add s, s
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MOVE_SMALLEST_UP macro STEP, num_unrolls, exit_2
|
|
||||||
LOCAL leaves, opt_loop, single
|
|
||||||
|
|
||||||
; s == k * 2
|
|
||||||
rept num_unrolls
|
|
||||||
cmp s, num_last
|
|
||||||
jae leaves
|
|
||||||
STEP_1 exit_2
|
|
||||||
endm
|
|
||||||
cmp s, num_last
|
|
||||||
jb opt_loop
|
|
||||||
|
|
||||||
leaves:
|
|
||||||
; (s >= num_last)
|
|
||||||
jne exit_2
|
|
||||||
single:
|
|
||||||
; (s == num_last)
|
|
||||||
mov t0, [p + k * 8]
|
|
||||||
cmp qq, t0
|
|
||||||
jae exit_2
|
|
||||||
STORE t0, k
|
|
||||||
mov k, s
|
|
||||||
jmp exit_2
|
|
||||||
|
|
||||||
MY_ALIGN_16
|
|
||||||
opt_loop:
|
|
||||||
STEP exit_2
|
|
||||||
cmp s, num_last
|
|
||||||
jb opt_loop
|
|
||||||
je single
|
|
||||||
exit_2:
|
|
||||||
STORE qq, k
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ifdef Z7_SORT_ASM_USE_SEGMENT
|
|
||||||
; MY_ALIGN_64
|
|
||||||
else
|
|
||||||
MY_ALIGN_16
|
|
||||||
endif
|
|
||||||
|
|
||||||
MY_PROC HeapSort, 2
|
|
||||||
ifdef x64
|
|
||||||
if (IS_LINUX gt 0)
|
|
||||||
mov num_last, REG_ABI_PARAM_1 ; r2 <- r6 : linux
|
|
||||||
mov p, REG_ABI_PARAM_0 ; r1 <- r7 : linux
|
|
||||||
endif
|
|
||||||
elseif (IS_CDECL gt 0)
|
|
||||||
mov num_last, [r4 + REG_SIZE * 2]
|
|
||||||
mov p, [r4 + REG_SIZE * 1]
|
|
||||||
endif
|
|
||||||
cmp num_last, 2
|
|
||||||
jb end_1
|
|
||||||
MY_PUSH_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11
|
|
||||||
|
|
||||||
cmp num_last, 4
|
|
||||||
ja sort_5
|
|
||||||
|
|
||||||
LOAD a0, 0
|
|
||||||
LOAD a1, 1
|
|
||||||
SORT a0, a1
|
|
||||||
cmp num_last, 3
|
|
||||||
jb end_2
|
|
||||||
|
|
||||||
LOAD a2, 2
|
|
||||||
je sort_3
|
|
||||||
|
|
||||||
LOAD a3, 3
|
|
||||||
SORT a2, a3
|
|
||||||
SORT a1, a3
|
|
||||||
STORE a3, 3
|
|
||||||
sort_3:
|
|
||||||
SORT a0, a2
|
|
||||||
SORT a1, a2
|
|
||||||
STORE a2, 2
|
|
||||||
jmp end_2
|
|
||||||
|
|
||||||
sort_5:
|
|
||||||
; num_last > 4
|
|
||||||
lea i, dword ptr [num_last - 2]
|
|
||||||
dec num_last
|
|
||||||
test i, 1
|
|
||||||
jz loop_down
|
|
||||||
|
|
||||||
; single child
|
|
||||||
mov t0, [p + num_last * 4]
|
|
||||||
mov qq, [p + num_last * 2]
|
|
||||||
dec i
|
|
||||||
cmp qq, t0
|
|
||||||
jae loop_down
|
|
||||||
|
|
||||||
mov [p + num_last * 2], t0
|
|
||||||
mov [p + num_last * 4], qq
|
|
||||||
|
|
||||||
MY_ALIGN_16
|
|
||||||
loop_down:
|
|
||||||
mov t0, [p + i * 4]
|
|
||||||
cmp t0, [p + i * 4 + 4]
|
|
||||||
mov k, i
|
|
||||||
mov qq, [p + i * 2]
|
|
||||||
adc k, 0
|
|
||||||
LOAD t0, k
|
|
||||||
cmp qq, t0
|
|
||||||
jae down_next
|
|
||||||
mov [p + i * 2], t0
|
|
||||||
lea s, dword ptr [k + k]
|
|
||||||
|
|
||||||
DOWN_num_unrolls equ 0
|
|
||||||
MOVE_SMALLEST_UP STEP_1, DOWN_num_unrolls, down_exit_label
|
|
||||||
down_next:
|
|
||||||
sub i, 2
|
|
||||||
jnb loop_down
|
|
||||||
; jmp end_debug
|
|
||||||
|
|
||||||
LOAD e0, 0
|
|
||||||
|
|
||||||
MY_ALIGN_16
|
|
||||||
main_loop_sort:
|
|
||||||
; num_last > 3
|
|
||||||
mov t0, [p + 2 * 4]
|
|
||||||
cmp t0, [p + 3 * 4]
|
|
||||||
LOAD qq, num_last
|
|
||||||
STORE e0, num_last
|
|
||||||
LOAD e0, 1
|
|
||||||
mov s_x, 2
|
|
||||||
mov k_x, 1
|
|
||||||
adc s, 0
|
|
||||||
LOAD t0, s
|
|
||||||
dec num_last
|
|
||||||
cmp qq, t0
|
|
||||||
jae main_exit_label
|
|
||||||
STORE t0, 1
|
|
||||||
mov k, s
|
|
||||||
add s, s
|
|
||||||
if 1
|
|
||||||
; for branch data prefetch mode :
|
|
||||||
; it's faster for large arrays : larger than (1 << 13) items.
|
|
||||||
MAIN_num_unrolls equ 10
|
|
||||||
STEP_LOOP equ STEP_BRANCH
|
|
||||||
else
|
|
||||||
MAIN_num_unrolls equ 0
|
|
||||||
STEP_LOOP equ STEP_1
|
|
||||||
endif
|
|
||||||
|
|
||||||
MOVE_SMALLEST_UP STEP_LOOP, MAIN_num_unrolls, main_exit_label
|
|
||||||
|
|
||||||
; jmp end_debug
|
|
||||||
cmp num_last, 3
|
|
||||||
jne main_loop_sort
|
|
||||||
|
|
||||||
; num_last == 3 (real_size == 4)
|
|
||||||
LOAD a0, 2
|
|
||||||
LOAD a1, 3
|
|
||||||
LOAD a2, 1
|
|
||||||
STORE e0, 3 ; e0 is alias for a3
|
|
||||||
STORE a2, 2
|
|
||||||
SORT a0, a1
|
|
||||||
end_2:
|
|
||||||
STORE a0, 0
|
|
||||||
STORE a1, 1
|
|
||||||
; end_debug:
|
|
||||||
MY_POP_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11
|
|
||||||
end_1:
|
|
||||||
MY_ENDP
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef Z7_SORT_ASM_USE_SEGMENT
|
|
||||||
_TEXT$Z7_SORT ENDS
|
|
||||||
endif
|
|
||||||
|
|
||||||
if 0
|
|
||||||
LEA_IS_D8 (R64) [R2 * 4 + 16]
|
|
||||||
Lat : TP
|
|
||||||
2 : 1 : adl-e
|
|
||||||
2 : 3 p056 adl-p
|
|
||||||
1 : 2 : p15 hsw-rocket
|
|
||||||
1 : 2 : p01 snb-ivb
|
|
||||||
1 : 1 : p1 conroe-wsm
|
|
||||||
1 : 4 : zen3,zen4
|
|
||||||
2 : 4 : zen1,zen2
|
|
||||||
|
|
||||||
LEA_B_IS (R64) [R2 + R3 * 4]
|
|
||||||
Lat : TP
|
|
||||||
1 : 1 : adl-e
|
|
||||||
2 : 3 p056 adl-p
|
|
||||||
1 : 2 : p15 hsw-rocket
|
|
||||||
1 : 2 : p01 snb-ivb
|
|
||||||
1 : 1 : p1 nhm-wsm
|
|
||||||
1 : 1 : p0 conroe-wsm
|
|
||||||
1 : 4 : zen3,zen4
|
|
||||||
2 :2,4 : zen1,zen2
|
|
||||||
|
|
||||||
LEA_B_IS_D8 (R64) [R2 + R3 * 4 + 16]
|
|
||||||
Lat : TP
|
|
||||||
2 : 1 : adl-e
|
|
||||||
2 : 3 p056 adl-p
|
|
||||||
1 : 2 : p15 ice-rocket
|
|
||||||
3 : 1 : p1/p15 hsw-rocket
|
|
||||||
3 : 1 : p01 snb-ivb
|
|
||||||
1 : 1 : p1 nhm-wsm
|
|
||||||
1 : 1 : p0 conroe-wsm
|
|
||||||
2,1 : 2 : zen3,zen4
|
|
||||||
2 : 2 : zen1,zen2
|
|
||||||
|
|
||||||
CMOVB (R64, R64)
|
|
||||||
Lat : TP
|
|
||||||
1,2 : 2 : adl-e
|
|
||||||
1 : 2 p06 adl-p
|
|
||||||
1 : 2 : p06 bwd-rocket
|
|
||||||
1,2 : 2 : p0156+p06 hsw
|
|
||||||
1,2 :1.5 : p015+p05 snb-ivb
|
|
||||||
1,2 : 1 : p015+p05 nhm
|
|
||||||
1 : 1 : 2*p015 conroe
|
|
||||||
1 : 2 : zen3,zen4
|
|
||||||
1 : 4 : zen1,zen2
|
|
||||||
|
|
||||||
ADC (R64, 0)
|
|
||||||
Lat : TP
|
|
||||||
1,2 : 2 : adl-e
|
|
||||||
1 : 2 p06 adl-p
|
|
||||||
1 : 2 : p06 bwd-rocket
|
|
||||||
1 :1.5 : p0156+p06 hsw
|
|
||||||
1 :1.5 : p015+p05 snb-ivb
|
|
||||||
2 : 1 : 2*p015 conroe-wstm
|
|
||||||
1 : 2 : zen1,zen2,zen3,zen4
|
|
||||||
|
|
||||||
PREFETCHNTA : fetch data into non-temporal cache close to the processor, minimizing cache pollution.
|
|
||||||
L1 : Pentium3
|
|
||||||
L2 : NetBurst
|
|
||||||
L1, not L2: Core duo, Core 2, Atom processors
|
|
||||||
L1, not L2, may fetch into L3 with fast replacement: Nehalem, Westmere, Sandy Bridge, ...
|
|
||||||
NEHALEM: Fills L1/L3, L1 LRU is not updated
|
|
||||||
L3 with fast replacement: Xeon Processors based on Nehalem, Westmere, Sandy Bridge, ...
|
|
||||||
PREFETCHT0 : fetch data into all cache levels.
|
|
||||||
PREFETCHT1 : fetch data into L2 and L3
|
|
||||||
endif
|
|
||||||
|
|
||||||
end
|
|
||||||
@@ -1,523 +0,0 @@
|
|||||||
; XzCrc64Opt.asm -- CRC64 calculation : optimized version
|
|
||||||
; 2023-12-08 : Igor Pavlov : Public domain
|
|
||||||
|
|
||||||
include 7zAsm.asm
|
|
||||||
|
|
||||||
MY_ASM_START
|
|
||||||
|
|
||||||
NUM_WORDS equ 3
|
|
||||||
|
|
||||||
if (NUM_WORDS lt 1) or (NUM_WORDS gt 64)
|
|
||||||
.err <num_words_IS_INCORRECT>
|
|
||||||
endif
|
|
||||||
|
|
||||||
NUM_SKIP_BYTES equ ((NUM_WORDS - 2) * 4)
|
|
||||||
|
|
||||||
|
|
||||||
MOVZXLO macro dest:req, src:req
|
|
||||||
movzx dest, @CatStr(src, _L)
|
|
||||||
endm
|
|
||||||
|
|
||||||
MOVZXHI macro dest:req, src:req
|
|
||||||
movzx dest, @CatStr(src, _H)
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
|
|
||||||
rD equ r11
|
|
||||||
rN equ r10
|
|
||||||
rT equ r9
|
|
||||||
|
|
||||||
CRC_OP macro op:req, dest:req, src:req, t:req
|
|
||||||
op dest, QWORD PTR [rT + @CatStr(src, _R) * 8 + 0800h * (t)]
|
|
||||||
endm
|
|
||||||
|
|
||||||
CRC_XOR macro dest:req, src:req, t:req
|
|
||||||
CRC_OP xor, dest, src, t
|
|
||||||
endm
|
|
||||||
|
|
||||||
CRC_MOV macro dest:req, src:req, t:req
|
|
||||||
CRC_OP mov, dest, src, t
|
|
||||||
endm
|
|
||||||
|
|
||||||
CRC1b macro
|
|
||||||
movzx x6, BYTE PTR [rD]
|
|
||||||
inc rD
|
|
||||||
MOVZXLO x3, x0
|
|
||||||
xor x6, x3
|
|
||||||
shr r0, 8
|
|
||||||
CRC_XOR r0, x6, 0
|
|
||||||
dec rN
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
; ALIGN_MASK is 3 or 7 bytes alignment:
|
|
||||||
ALIGN_MASK equ (7 - (NUM_WORDS and 1) * 4)
|
|
||||||
|
|
||||||
if NUM_WORDS eq 1
|
|
||||||
|
|
||||||
src_rN_offset equ 4
|
|
||||||
; + 4 for prefetching next 4-bytes after current iteration
|
|
||||||
NUM_BYTES_LIMIT equ (NUM_WORDS * 4 + 4)
|
|
||||||
SRCDAT4 equ DWORD PTR [rN + rD * 1]
|
|
||||||
|
|
||||||
XOR_NEXT macro
|
|
||||||
mov x1, [rD]
|
|
||||||
xor r0, r1
|
|
||||||
endm
|
|
||||||
|
|
||||||
else ; NUM_WORDS > 1
|
|
||||||
|
|
||||||
src_rN_offset equ 8
|
|
||||||
; + 8 for prefetching next 8-bytes after current iteration
|
|
||||||
NUM_BYTES_LIMIT equ (NUM_WORDS * 4 + 8)
|
|
||||||
|
|
||||||
XOR_NEXT macro
|
|
||||||
xor r0, QWORD PTR [rD] ; 64-bit read, can be unaligned
|
|
||||||
endm
|
|
||||||
|
|
||||||
; 32-bit or 64-bit
|
|
||||||
LOAD_SRC_MULT4 macro dest:req, word_index:req
|
|
||||||
mov dest, [rN + rD * 1 + 4 * (word_index) - src_rN_offset];
|
|
||||||
endm
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MY_PROC @CatStr(XzCrc64UpdateT, %(NUM_WORDS * 4)), 4
|
|
||||||
MY_PUSH_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11
|
|
||||||
|
|
||||||
mov r0, REG_ABI_PARAM_0 ; r0 <- r1 / r7
|
|
||||||
mov rD, REG_ABI_PARAM_1 ; r11 <- r2 / r6
|
|
||||||
mov rN, REG_ABI_PARAM_2 ; r10 <- r8 / r2
|
|
||||||
if (IS_LINUX gt 0)
|
|
||||||
mov rT, REG_ABI_PARAM_3 ; r9 <- r9 / r1
|
|
||||||
endif
|
|
||||||
|
|
||||||
cmp rN, NUM_BYTES_LIMIT + ALIGN_MASK
|
|
||||||
jb crc_end
|
|
||||||
@@:
|
|
||||||
test rD, ALIGN_MASK
|
|
||||||
jz @F
|
|
||||||
CRC1b
|
|
||||||
jmp @B
|
|
||||||
@@:
|
|
||||||
XOR_NEXT
|
|
||||||
lea rN, [rD + rN * 1 - (NUM_BYTES_LIMIT - 1)]
|
|
||||||
sub rD, rN
|
|
||||||
add rN, src_rN_offset
|
|
||||||
|
|
||||||
align 16
|
|
||||||
@@:
|
|
||||||
|
|
||||||
if NUM_WORDS eq 1
|
|
||||||
|
|
||||||
mov x1, x0
|
|
||||||
shr x1, 8
|
|
||||||
MOVZXLO x3, x1
|
|
||||||
MOVZXLO x2, x0
|
|
||||||
shr x1, 8
|
|
||||||
shr r0, 32
|
|
||||||
xor x0, SRCDAT4
|
|
||||||
CRC_XOR r0, x2, 3
|
|
||||||
CRC_XOR r0, x3, 2
|
|
||||||
MOVZXLO x2, x1
|
|
||||||
shr x1, 8
|
|
||||||
CRC_XOR r0, x2, 1
|
|
||||||
CRC_XOR r0, x1, 0
|
|
||||||
|
|
||||||
else ; NUM_WORDS > 1
|
|
||||||
|
|
||||||
if NUM_WORDS ne 2
|
|
||||||
k = 2
|
|
||||||
while k lt NUM_WORDS
|
|
||||||
|
|
||||||
LOAD_SRC_MULT4 x1, k
|
|
||||||
crc_op1 textequ <xor>
|
|
||||||
|
|
||||||
if k eq 2
|
|
||||||
if (NUM_WORDS and 1)
|
|
||||||
LOAD_SRC_MULT4 x7, NUM_WORDS ; aligned 32-bit
|
|
||||||
LOAD_SRC_MULT4 x6, NUM_WORDS + 1 ; aligned 32-bit
|
|
||||||
shl r6, 32
|
|
||||||
else
|
|
||||||
LOAD_SRC_MULT4 r6, NUM_WORDS ; aligned 64-bit
|
|
||||||
crc_op1 textequ <mov>
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
table = 4 * (NUM_WORDS - 1 - k)
|
|
||||||
MOVZXLO x3, x1
|
|
||||||
CRC_OP crc_op1, r7, x3, 3 + table
|
|
||||||
MOVZXHI x3, x1
|
|
||||||
shr x1, 16
|
|
||||||
CRC_XOR r6, x3, 2 + table
|
|
||||||
MOVZXLO x3, x1
|
|
||||||
shr x1, 8
|
|
||||||
CRC_XOR r7, x3, 1 + table
|
|
||||||
CRC_XOR r6, x1, 0 + table
|
|
||||||
k = k + 1
|
|
||||||
endm
|
|
||||||
crc_op2 textequ <xor>
|
|
||||||
|
|
||||||
else ; NUM_WORDS == 2
|
|
||||||
LOAD_SRC_MULT4 r6, NUM_WORDS ; aligned 64-bit
|
|
||||||
crc_op2 textequ <mov>
|
|
||||||
endif ; NUM_WORDS == 2
|
|
||||||
|
|
||||||
MOVZXHI x3, x0
|
|
||||||
MOVZXLO x2, x0
|
|
||||||
mov r1, r0
|
|
||||||
shr r1, 32
|
|
||||||
shr x0, 16
|
|
||||||
CRC_XOR r6, x2, NUM_SKIP_BYTES + 7
|
|
||||||
CRC_OP crc_op2, r7, x3, NUM_SKIP_BYTES + 6
|
|
||||||
MOVZXLO x2, x0
|
|
||||||
MOVZXHI x5, x1
|
|
||||||
MOVZXLO x3, x1
|
|
||||||
shr x0, 8
|
|
||||||
shr x1, 16
|
|
||||||
CRC_XOR r7, x2, NUM_SKIP_BYTES + 5
|
|
||||||
CRC_XOR r6, x3, NUM_SKIP_BYTES + 3
|
|
||||||
CRC_XOR r7, x0, NUM_SKIP_BYTES + 4
|
|
||||||
CRC_XOR r6, x5, NUM_SKIP_BYTES + 2
|
|
||||||
MOVZXLO x2, x1
|
|
||||||
shr x1, 8
|
|
||||||
CRC_XOR r7, x2, NUM_SKIP_BYTES + 1
|
|
||||||
CRC_MOV r0, x1, NUM_SKIP_BYTES + 0
|
|
||||||
xor r0, r6
|
|
||||||
xor r0, r7
|
|
||||||
|
|
||||||
endif ; NUM_WORDS > 1
|
|
||||||
add rD, NUM_WORDS * 4
|
|
||||||
jnc @B
|
|
||||||
|
|
||||||
sub rN, src_rN_offset
|
|
||||||
add rD, rN
|
|
||||||
XOR_NEXT
|
|
||||||
add rN, NUM_BYTES_LIMIT - 1
|
|
||||||
sub rN, rD
|
|
||||||
|
|
||||||
crc_end:
|
|
||||||
test rN, rN
|
|
||||||
jz func_end
|
|
||||||
@@:
|
|
||||||
CRC1b
|
|
||||||
jnz @B
|
|
||||||
func_end:
|
|
||||||
MY_POP_PRESERVED_ABI_REGS_UP_TO_INCLUDING_R11
|
|
||||||
MY_ENDP
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else
|
|
||||||
; ==================================================================
|
|
||||||
; x86 (32-bit)
|
|
||||||
|
|
||||||
rD equ r7
|
|
||||||
rN equ r1
|
|
||||||
rT equ r5
|
|
||||||
|
|
||||||
xA equ x6
|
|
||||||
xA_R equ r6
|
|
||||||
|
|
||||||
ifdef x64
|
|
||||||
num_VAR equ r8
|
|
||||||
else
|
|
||||||
|
|
||||||
crc_OFFS equ (REG_SIZE * 5)
|
|
||||||
|
|
||||||
if (IS_CDECL gt 0) or (IS_LINUX gt 0)
|
|
||||||
; cdecl or (GNU fastcall) stack:
|
|
||||||
; (UInt32 *) table
|
|
||||||
; size_t size
|
|
||||||
; void * data
|
|
||||||
; (UInt64) crc
|
|
||||||
; ret-ip <-(r4)
|
|
||||||
data_OFFS equ (8 + crc_OFFS)
|
|
||||||
size_OFFS equ (REG_SIZE + data_OFFS)
|
|
||||||
table_OFFS equ (REG_SIZE + size_OFFS)
|
|
||||||
num_VAR equ [r4 + size_OFFS]
|
|
||||||
table_VAR equ [r4 + table_OFFS]
|
|
||||||
else
|
|
||||||
; Windows fastcall:
|
|
||||||
; r1 = data, r2 = size
|
|
||||||
; stack:
|
|
||||||
; (UInt32 *) table
|
|
||||||
; (UInt64) crc
|
|
||||||
; ret-ip <-(r4)
|
|
||||||
table_OFFS equ (8 + crc_OFFS)
|
|
||||||
table_VAR equ [r4 + table_OFFS]
|
|
||||||
num_VAR equ table_VAR
|
|
||||||
endif
|
|
||||||
endif ; x64
|
|
||||||
|
|
||||||
SRCDAT4 equ DWORD PTR [rN + rD * 1]
|
|
||||||
|
|
||||||
CRC_1 macro op:req, dest:req, src:req, t:req, word_index:req
|
|
||||||
op dest, DWORD PTR [rT + @CatStr(src, _R) * 8 + 0800h * (t) + (word_index) * 4]
|
|
||||||
endm
|
|
||||||
|
|
||||||
CRC macro op0:req, op1:req, dest0:req, dest1:req, src:req, t:req
|
|
||||||
CRC_1 op0, dest0, src, t, 0
|
|
||||||
CRC_1 op1, dest1, src, t, 1
|
|
||||||
endm
|
|
||||||
|
|
||||||
CRC_XOR macro dest0:req, dest1:req, src:req, t:req
|
|
||||||
CRC xor, xor, dest0, dest1, src, t
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
CRC1b macro
|
|
||||||
movzx xA, BYTE PTR [rD]
|
|
||||||
inc rD
|
|
||||||
MOVZXLO x3, x0
|
|
||||||
xor xA, x3
|
|
||||||
shrd x0, x2, 8
|
|
||||||
shr x2, 8
|
|
||||||
CRC_XOR x0, x2, xA, 0
|
|
||||||
dec rN
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
MY_PROLOG_BASE macro
|
|
||||||
MY_PUSH_4_REGS
|
|
||||||
ifdef x64
|
|
||||||
mov r0, REG_ABI_PARAM_0 ; r0 <- r1 / r7
|
|
||||||
mov rT, REG_ABI_PARAM_3 ; r5 <- r9 / r1
|
|
||||||
mov rN, REG_ABI_PARAM_2 ; r1 <- r8 / r2
|
|
||||||
mov rD, REG_ABI_PARAM_1 ; r7 <- r2 / r6
|
|
||||||
mov r2, r0
|
|
||||||
shr r2, 32
|
|
||||||
mov x0, x0
|
|
||||||
else
|
|
||||||
if (IS_CDECL gt 0) or (IS_LINUX gt 0)
|
|
||||||
proc_numParams = proc_numParams + 2 ; for ABI_LINUX
|
|
||||||
mov rN, [r4 + size_OFFS]
|
|
||||||
mov rD, [r4 + data_OFFS]
|
|
||||||
else
|
|
||||||
mov rD, REG_ABI_PARAM_0 ; r7 <- r1 : (data)
|
|
||||||
mov rN, REG_ABI_PARAM_1 ; r1 <- r2 : (size)
|
|
||||||
endif
|
|
||||||
mov x0, [r4 + crc_OFFS]
|
|
||||||
mov x2, [r4 + crc_OFFS + 4]
|
|
||||||
mov rT, table_VAR
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
MY_EPILOG_BASE macro crc_end:req, func_end:req
|
|
||||||
crc_end:
|
|
||||||
test rN, rN
|
|
||||||
jz func_end
|
|
||||||
@@:
|
|
||||||
CRC1b
|
|
||||||
jnz @B
|
|
||||||
func_end:
|
|
||||||
ifdef x64
|
|
||||||
shl r2, 32
|
|
||||||
xor r0, r2
|
|
||||||
endif
|
|
||||||
MY_POP_4_REGS
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
; ALIGN_MASK is 3 or 7 bytes alignment:
|
|
||||||
ALIGN_MASK equ (7 - (NUM_WORDS and 1) * 4)
|
|
||||||
|
|
||||||
if (NUM_WORDS eq 1)
|
|
||||||
|
|
||||||
NUM_BYTES_LIMIT_T4 equ (NUM_WORDS * 4 + 4)
|
|
||||||
|
|
||||||
MY_PROC @CatStr(XzCrc64UpdateT, %(NUM_WORDS * 4)), 5
|
|
||||||
MY_PROLOG_BASE
|
|
||||||
|
|
||||||
cmp rN, NUM_BYTES_LIMIT_T4 + ALIGN_MASK
|
|
||||||
jb crc_end_4
|
|
||||||
@@:
|
|
||||||
test rD, ALIGN_MASK
|
|
||||||
jz @F
|
|
||||||
CRC1b
|
|
||||||
jmp @B
|
|
||||||
@@:
|
|
||||||
xor x0, [rD]
|
|
||||||
lea rN, [rD + rN * 1 - (NUM_BYTES_LIMIT_T4 - 1)]
|
|
||||||
sub rD, rN
|
|
||||||
add rN, 4
|
|
||||||
|
|
||||||
MOVZXLO xA, x0
|
|
||||||
align 16
|
|
||||||
@@:
|
|
||||||
mov x3, SRCDAT4
|
|
||||||
xor x3, x2
|
|
||||||
shr x0, 8
|
|
||||||
CRC xor, mov, x3, x2, xA, 3
|
|
||||||
MOVZXLO xA, x0
|
|
||||||
shr x0, 8
|
|
||||||
; MOVZXHI xA, x0
|
|
||||||
; shr x0, 16
|
|
||||||
CRC_XOR x3, x2, xA, 2
|
|
||||||
|
|
||||||
MOVZXLO xA, x0
|
|
||||||
shr x0, 8
|
|
||||||
CRC_XOR x3, x2, xA, 1
|
|
||||||
CRC_XOR x3, x2, x0, 0
|
|
||||||
MOVZXLO xA, x3
|
|
||||||
mov x0, x3
|
|
||||||
|
|
||||||
add rD, 4
|
|
||||||
jnc @B
|
|
||||||
|
|
||||||
sub rN, 4
|
|
||||||
add rD, rN
|
|
||||||
xor x0, [rD]
|
|
||||||
add rN, NUM_BYTES_LIMIT_T4 - 1
|
|
||||||
sub rN, rD
|
|
||||||
MY_EPILOG_BASE crc_end_4, func_end_4
|
|
||||||
MY_ENDP
|
|
||||||
|
|
||||||
else ; NUM_WORDS > 1
|
|
||||||
|
|
||||||
SHR_X macro x, imm
|
|
||||||
shr x, imm
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
ITER_1 macro v0, v1, a, off
|
|
||||||
MOVZXLO xA, a
|
|
||||||
SHR_X a, 8
|
|
||||||
CRC_XOR v0, v1, xA, off
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
ITER_4 macro v0, v1, a, off
|
|
||||||
if 0 eq 0
|
|
||||||
ITER_1 v0, v1, a, off + 3
|
|
||||||
ITER_1 v0, v1, a, off + 2
|
|
||||||
ITER_1 v0, v1, a, off + 1
|
|
||||||
CRC_XOR v0, v1, a, off
|
|
||||||
elseif 0 eq 0
|
|
||||||
MOVZXLO xA, a
|
|
||||||
CRC_XOR v0, v1, xA, off + 3
|
|
||||||
mov xA, a
|
|
||||||
ror a, 16 ; 32-bit ror
|
|
||||||
shr xA, 24
|
|
||||||
CRC_XOR v0, v1, xA, off
|
|
||||||
MOVZXLO xA, a
|
|
||||||
SHR_X a, 24
|
|
||||||
CRC_XOR v0, v1, xA, off + 1
|
|
||||||
CRC_XOR v0, v1, a, off + 2
|
|
||||||
else
|
|
||||||
; MOVZXHI provides smaller code, but MOVZX_HI_BYTE is not fast instruction
|
|
||||||
MOVZXLO xA, a
|
|
||||||
CRC_XOR v0, v1, xA, off + 3
|
|
||||||
MOVZXHI xA, a
|
|
||||||
SHR_X a, 16
|
|
||||||
CRC_XOR v0, v1, xA, off + 2
|
|
||||||
MOVZXLO xA, a
|
|
||||||
SHR_X a, 8
|
|
||||||
CRC_XOR v0, v1, xA, off + 1
|
|
||||||
CRC_XOR v0, v1, a, off
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ITER_1_PAIR macro v0, v1, a0, a1, off
|
|
||||||
ITER_1 v0, v1, a0, off + 4
|
|
||||||
ITER_1 v0, v1, a1, off
|
|
||||||
endm
|
|
||||||
|
|
||||||
src_rD_offset equ 8
|
|
||||||
STEP_SIZE equ (NUM_WORDS * 4)
|
|
||||||
|
|
||||||
ITER_12_NEXT macro op, index, v0, v1
|
|
||||||
op v0, DWORD PTR [rD + (index + 1) * STEP_SIZE - src_rD_offset]
|
|
||||||
op v1, DWORD PTR [rD + (index + 1) * STEP_SIZE + 4 - src_rD_offset]
|
|
||||||
endm
|
|
||||||
|
|
||||||
ITER_12 macro index, a0, a1, v0, v1
|
|
||||||
|
|
||||||
if NUM_SKIP_BYTES eq 0
|
|
||||||
ITER_12_NEXT mov, index, v0, v1
|
|
||||||
else
|
|
||||||
k = 0
|
|
||||||
while k lt NUM_SKIP_BYTES
|
|
||||||
movzx xA, BYTE PTR [rD + (index) * STEP_SIZE + k + 8 - src_rD_offset]
|
|
||||||
if k eq 0
|
|
||||||
CRC mov, mov, v0, v1, xA, NUM_SKIP_BYTES - 1 - k
|
|
||||||
else
|
|
||||||
CRC_XOR v0, v1, xA, NUM_SKIP_BYTES - 1 - k
|
|
||||||
endif
|
|
||||||
k = k + 1
|
|
||||||
endm
|
|
||||||
ITER_12_NEXT xor, index, v0, v1
|
|
||||||
endif
|
|
||||||
|
|
||||||
if 0 eq 0
|
|
||||||
ITER_4 v0, v1, a0, NUM_SKIP_BYTES + 4
|
|
||||||
ITER_4 v0, v1, a1, NUM_SKIP_BYTES
|
|
||||||
else ; interleave version is faster/slower for different processors
|
|
||||||
ITER_1_PAIR v0, v1, a0, a1, NUM_SKIP_BYTES + 3
|
|
||||||
ITER_1_PAIR v0, v1, a0, a1, NUM_SKIP_BYTES + 2
|
|
||||||
ITER_1_PAIR v0, v1, a0, a1, NUM_SKIP_BYTES + 1
|
|
||||||
CRC_XOR v0, v1, a0, NUM_SKIP_BYTES + 4
|
|
||||||
CRC_XOR v0, v1, a1, NUM_SKIP_BYTES
|
|
||||||
endif
|
|
||||||
endm
|
|
||||||
|
|
||||||
; we use (UNROLL_CNT > 1) to reduce read ports pressure (num_VAR reads)
|
|
||||||
UNROLL_CNT equ (2 * 1)
|
|
||||||
NUM_BYTES_LIMIT equ (STEP_SIZE * UNROLL_CNT + 8)
|
|
||||||
|
|
||||||
MY_PROC @CatStr(XzCrc64UpdateT, %(NUM_WORDS * 4)), 5
|
|
||||||
MY_PROLOG_BASE
|
|
||||||
|
|
||||||
cmp rN, NUM_BYTES_LIMIT + ALIGN_MASK
|
|
||||||
jb crc_end_12
|
|
||||||
@@:
|
|
||||||
test rD, ALIGN_MASK
|
|
||||||
jz @F
|
|
||||||
CRC1b
|
|
||||||
jmp @B
|
|
||||||
@@:
|
|
||||||
xor x0, [rD]
|
|
||||||
xor x2, [rD + 4]
|
|
||||||
add rD, src_rD_offset
|
|
||||||
lea rN, [rD + rN * 1 - (NUM_BYTES_LIMIT - 1)]
|
|
||||||
mov num_VAR, rN
|
|
||||||
|
|
||||||
align 16
|
|
||||||
@@:
|
|
||||||
i = 0
|
|
||||||
rept UNROLL_CNT
|
|
||||||
if (i and 1) eq 0
|
|
||||||
ITER_12 i, x0, x2, x1, x3
|
|
||||||
else
|
|
||||||
ITER_12 i, x1, x3, x0, x2
|
|
||||||
endif
|
|
||||||
i = i + 1
|
|
||||||
endm
|
|
||||||
|
|
||||||
if (UNROLL_CNT and 1)
|
|
||||||
mov x0, x1
|
|
||||||
mov x2, x3
|
|
||||||
endif
|
|
||||||
add rD, STEP_SIZE * UNROLL_CNT
|
|
||||||
cmp rD, num_VAR
|
|
||||||
jb @B
|
|
||||||
|
|
||||||
mov rN, num_VAR
|
|
||||||
add rN, NUM_BYTES_LIMIT - 1
|
|
||||||
sub rN, rD
|
|
||||||
sub rD, src_rD_offset
|
|
||||||
xor x0, [rD]
|
|
||||||
xor x2, [rD + 4]
|
|
||||||
|
|
||||||
MY_EPILOG_BASE crc_end_12, func_end_12
|
|
||||||
MY_ENDP
|
|
||||||
|
|
||||||
endif ; (NUM_WORDS > 1)
|
|
||||||
endif ; ! x64
|
|
||||||
end
|
|
||||||
@@ -1,204 +0,0 @@
|
|||||||
/* 7z.h -- 7z interface
|
|
||||||
2023-04-02 : Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#ifndef ZIP7_INC_7Z_H
|
|
||||||
#define ZIP7_INC_7Z_H
|
|
||||||
|
|
||||||
#include "7zTypes.h"
|
|
||||||
|
|
||||||
EXTERN_C_BEGIN
|
|
||||||
|
|
||||||
#define k7zStartHeaderSize 0x20
|
|
||||||
#define k7zSignatureSize 6
|
|
||||||
|
|
||||||
extern const Byte k7zSignature[k7zSignatureSize];
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
const Byte *Data;
|
|
||||||
size_t Size;
|
|
||||||
} CSzData;
|
|
||||||
|
|
||||||
/* CSzCoderInfo & CSzFolder support only default methods */
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
size_t PropsOffset;
|
|
||||||
UInt32 MethodID;
|
|
||||||
Byte NumStreams;
|
|
||||||
Byte PropsSize;
|
|
||||||
} CSzCoderInfo;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
UInt32 InIndex;
|
|
||||||
UInt32 OutIndex;
|
|
||||||
} CSzBond;
|
|
||||||
|
|
||||||
#define SZ_NUM_CODERS_IN_FOLDER_MAX 4
|
|
||||||
#define SZ_NUM_BONDS_IN_FOLDER_MAX 3
|
|
||||||
#define SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX 4
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
UInt32 NumCoders;
|
|
||||||
UInt32 NumBonds;
|
|
||||||
UInt32 NumPackStreams;
|
|
||||||
UInt32 UnpackStream;
|
|
||||||
UInt32 PackStreams[SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX];
|
|
||||||
CSzBond Bonds[SZ_NUM_BONDS_IN_FOLDER_MAX];
|
|
||||||
CSzCoderInfo Coders[SZ_NUM_CODERS_IN_FOLDER_MAX];
|
|
||||||
} CSzFolder;
|
|
||||||
|
|
||||||
|
|
||||||
SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd);
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
UInt32 Low;
|
|
||||||
UInt32 High;
|
|
||||||
} CNtfsFileTime;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
Byte *Defs; /* MSB 0 bit numbering */
|
|
||||||
UInt32 *Vals;
|
|
||||||
} CSzBitUi32s;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
Byte *Defs; /* MSB 0 bit numbering */
|
|
||||||
// UInt64 *Vals;
|
|
||||||
CNtfsFileTime *Vals;
|
|
||||||
} CSzBitUi64s;
|
|
||||||
|
|
||||||
#define SzBitArray_Check(p, i) (((p)[(i) >> 3] & (0x80 >> ((i) & 7))) != 0)
|
|
||||||
|
|
||||||
#define SzBitWithVals_Check(p, i) ((p)->Defs && ((p)->Defs[(i) >> 3] & (0x80 >> ((i) & 7))) != 0)
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
UInt32 NumPackStreams;
|
|
||||||
UInt32 NumFolders;
|
|
||||||
|
|
||||||
UInt64 *PackPositions; // NumPackStreams + 1
|
|
||||||
CSzBitUi32s FolderCRCs; // NumFolders
|
|
||||||
|
|
||||||
size_t *FoCodersOffsets; // NumFolders + 1
|
|
||||||
UInt32 *FoStartPackStreamIndex; // NumFolders + 1
|
|
||||||
UInt32 *FoToCoderUnpackSizes; // NumFolders + 1
|
|
||||||
Byte *FoToMainUnpackSizeIndex; // NumFolders
|
|
||||||
UInt64 *CoderUnpackSizes; // for all coders in all folders
|
|
||||||
|
|
||||||
Byte *CodersData;
|
|
||||||
|
|
||||||
UInt64 RangeLimit;
|
|
||||||
} CSzAr;
|
|
||||||
|
|
||||||
UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex);
|
|
||||||
|
|
||||||
SRes SzAr_DecodeFolder(const CSzAr *p, UInt32 folderIndex,
|
|
||||||
ILookInStreamPtr stream, UInt64 startPos,
|
|
||||||
Byte *outBuffer, size_t outSize,
|
|
||||||
ISzAllocPtr allocMain);
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
CSzAr db;
|
|
||||||
|
|
||||||
UInt64 startPosAfterHeader;
|
|
||||||
UInt64 dataPos;
|
|
||||||
|
|
||||||
UInt32 NumFiles;
|
|
||||||
|
|
||||||
UInt64 *UnpackPositions; // NumFiles + 1
|
|
||||||
// Byte *IsEmptyFiles;
|
|
||||||
Byte *IsDirs;
|
|
||||||
CSzBitUi32s CRCs;
|
|
||||||
|
|
||||||
CSzBitUi32s Attribs;
|
|
||||||
// CSzBitUi32s Parents;
|
|
||||||
CSzBitUi64s MTime;
|
|
||||||
CSzBitUi64s CTime;
|
|
||||||
|
|
||||||
UInt32 *FolderToFile; // NumFolders + 1
|
|
||||||
UInt32 *FileToFolder; // NumFiles
|
|
||||||
|
|
||||||
size_t *FileNameOffsets; /* in 2-byte steps */
|
|
||||||
Byte *FileNames; /* UTF-16-LE */
|
|
||||||
} CSzArEx;
|
|
||||||
|
|
||||||
#define SzArEx_IsDir(p, i) (SzBitArray_Check((p)->IsDirs, i))
|
|
||||||
|
|
||||||
#define SzArEx_GetFileSize(p, i) ((p)->UnpackPositions[(i) + 1] - (p)->UnpackPositions[i])
|
|
||||||
|
|
||||||
void SzArEx_Init(CSzArEx *p);
|
|
||||||
void SzArEx_Free(CSzArEx *p, ISzAllocPtr alloc);
|
|
||||||
UInt64 SzArEx_GetFolderStreamPos(const CSzArEx *p, UInt32 folderIndex, UInt32 indexInFolder);
|
|
||||||
int SzArEx_GetFolderFullPackSize(const CSzArEx *p, UInt32 folderIndex, UInt64 *resSize);
|
|
||||||
|
|
||||||
/*
|
|
||||||
if dest == NULL, the return value specifies the required size of the buffer,
|
|
||||||
in 16-bit characters, including the null-terminating character.
|
|
||||||
if dest != NULL, the return value specifies the number of 16-bit characters that
|
|
||||||
are written to the dest, including the null-terminating character. */
|
|
||||||
|
|
||||||
size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest);
|
|
||||||
|
|
||||||
/*
|
|
||||||
size_t SzArEx_GetFullNameLen(const CSzArEx *p, size_t fileIndex);
|
|
||||||
UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16 *dest);
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
SzArEx_Extract extracts file from archive
|
|
||||||
|
|
||||||
*outBuffer must be 0 before first call for each new archive.
|
|
||||||
|
|
||||||
Extracting cache:
|
|
||||||
If you need to decompress more than one file, you can send
|
|
||||||
these values from previous call:
|
|
||||||
*blockIndex,
|
|
||||||
*outBuffer,
|
|
||||||
*outBufferSize
|
|
||||||
You can consider "*outBuffer" as cache of solid block. If your archive is solid,
|
|
||||||
it will increase decompression speed.
|
|
||||||
|
|
||||||
If you use external function, you can declare these 3 cache variables
|
|
||||||
(blockIndex, outBuffer, outBufferSize) as static in that external function.
|
|
||||||
|
|
||||||
Free *outBuffer and set *outBuffer to 0, if you want to flush cache.
|
|
||||||
*/
|
|
||||||
|
|
||||||
SRes SzArEx_Extract(
|
|
||||||
const CSzArEx *db,
|
|
||||||
ILookInStreamPtr inStream,
|
|
||||||
UInt32 fileIndex, /* index of file */
|
|
||||||
UInt32 *blockIndex, /* index of solid block */
|
|
||||||
Byte **outBuffer, /* pointer to pointer to output buffer (allocated with allocMain) */
|
|
||||||
size_t *outBufferSize, /* buffer size for output buffer */
|
|
||||||
size_t *offset, /* offset of stream for required file in *outBuffer */
|
|
||||||
size_t *outSizeProcessed, /* size of file in *outBuffer */
|
|
||||||
ISzAllocPtr allocMain,
|
|
||||||
ISzAllocPtr allocTemp);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
SzArEx_Open Errors:
|
|
||||||
SZ_ERROR_NO_ARCHIVE
|
|
||||||
SZ_ERROR_ARCHIVE
|
|
||||||
SZ_ERROR_UNSUPPORTED
|
|
||||||
SZ_ERROR_MEM
|
|
||||||
SZ_ERROR_CRC
|
|
||||||
SZ_ERROR_INPUT_EOF
|
|
||||||
SZ_ERROR_FAIL
|
|
||||||
*/
|
|
||||||
|
|
||||||
SRes SzArEx_Open(CSzArEx *p, ILookInStreamPtr inStream,
|
|
||||||
ISzAllocPtr allocMain, ISzAllocPtr allocTemp);
|
|
||||||
|
|
||||||
EXTERN_C_END
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
/* 7zAlloc.c -- Allocation functions for 7z processing
|
|
||||||
2023-03-04 : Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#include "Precomp.h"
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "7zAlloc.h"
|
|
||||||
|
|
||||||
/* #define SZ_ALLOC_DEBUG */
|
|
||||||
/* use SZ_ALLOC_DEBUG to debug alloc/free operations */
|
|
||||||
|
|
||||||
#ifdef SZ_ALLOC_DEBUG
|
|
||||||
|
|
||||||
/*
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include "7zWindows.h"
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
static int g_allocCount = 0;
|
|
||||||
static int g_allocCountTemp = 0;
|
|
||||||
|
|
||||||
static void Print_Alloc(const char *s, size_t size, int *counter)
|
|
||||||
{
|
|
||||||
const unsigned size2 = (unsigned)size;
|
|
||||||
fprintf(stderr, "\n%s count = %10d : %10u bytes; ", s, *counter, size2);
|
|
||||||
(*counter)++;
|
|
||||||
}
|
|
||||||
static void Print_Free(const char *s, int *counter)
|
|
||||||
{
|
|
||||||
(*counter)--;
|
|
||||||
fprintf(stderr, "\n%s count = %10d", s, *counter);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void *SzAlloc(ISzAllocPtr p, size_t size)
|
|
||||||
{
|
|
||||||
UNUSED_VAR(p)
|
|
||||||
if (size == 0)
|
|
||||||
return 0;
|
|
||||||
#ifdef SZ_ALLOC_DEBUG
|
|
||||||
Print_Alloc("Alloc", size, &g_allocCount);
|
|
||||||
#endif
|
|
||||||
return malloc(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SzFree(ISzAllocPtr p, void *address)
|
|
||||||
{
|
|
||||||
UNUSED_VAR(p)
|
|
||||||
#ifdef SZ_ALLOC_DEBUG
|
|
||||||
if (address)
|
|
||||||
Print_Free("Free ", &g_allocCount);
|
|
||||||
#endif
|
|
||||||
free(address);
|
|
||||||
}
|
|
||||||
|
|
||||||
void *SzAllocTemp(ISzAllocPtr p, size_t size)
|
|
||||||
{
|
|
||||||
UNUSED_VAR(p)
|
|
||||||
if (size == 0)
|
|
||||||
return 0;
|
|
||||||
#ifdef SZ_ALLOC_DEBUG
|
|
||||||
Print_Alloc("Alloc_temp", size, &g_allocCountTemp);
|
|
||||||
/*
|
|
||||||
#ifdef _WIN32
|
|
||||||
return HeapAlloc(GetProcessHeap(), 0, size);
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
return malloc(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SzFreeTemp(ISzAllocPtr p, void *address)
|
|
||||||
{
|
|
||||||
UNUSED_VAR(p)
|
|
||||||
#ifdef SZ_ALLOC_DEBUG
|
|
||||||
if (address)
|
|
||||||
Print_Free("Free_temp ", &g_allocCountTemp);
|
|
||||||
/*
|
|
||||||
#ifdef _WIN32
|
|
||||||
HeapFree(GetProcessHeap(), 0, address);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
free(address);
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
/* 7zAlloc.h -- Allocation functions
|
|
||||||
2023-03-04 : Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#ifndef ZIP7_INC_7Z_ALLOC_H
|
|
||||||
#define ZIP7_INC_7Z_ALLOC_H
|
|
||||||
|
|
||||||
#include "7zTypes.h"
|
|
||||||
|
|
||||||
EXTERN_C_BEGIN
|
|
||||||
|
|
||||||
void *SzAlloc(ISzAllocPtr p, size_t size);
|
|
||||||
void SzFree(ISzAllocPtr p, void *address);
|
|
||||||
|
|
||||||
void *SzAllocTemp(ISzAllocPtr p, size_t size);
|
|
||||||
void SzFreeTemp(ISzAllocPtr p, void *address);
|
|
||||||
|
|
||||||
EXTERN_C_END
|
|
||||||
|
|
||||||
#endif
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,36 +0,0 @@
|
|||||||
/* 7zBuf.c -- Byte Buffer
|
|
||||||
2017-04-03 : Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#include "Precomp.h"
|
|
||||||
|
|
||||||
#include "7zBuf.h"
|
|
||||||
|
|
||||||
void Buf_Init(CBuf *p)
|
|
||||||
{
|
|
||||||
p->data = 0;
|
|
||||||
p->size = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Buf_Create(CBuf *p, size_t size, ISzAllocPtr alloc)
|
|
||||||
{
|
|
||||||
p->size = 0;
|
|
||||||
if (size == 0)
|
|
||||||
{
|
|
||||||
p->data = 0;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
p->data = (Byte *)ISzAlloc_Alloc(alloc, size);
|
|
||||||
if (p->data)
|
|
||||||
{
|
|
||||||
p->size = size;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Buf_Free(CBuf *p, ISzAllocPtr alloc)
|
|
||||||
{
|
|
||||||
ISzAlloc_Free(alloc, p->data);
|
|
||||||
p->data = 0;
|
|
||||||
p->size = 0;
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
/* 7zBuf.h -- Byte Buffer
|
|
||||||
2023-03-04 : Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#ifndef ZIP7_INC_7Z_BUF_H
|
|
||||||
#define ZIP7_INC_7Z_BUF_H
|
|
||||||
|
|
||||||
#include "7zTypes.h"
|
|
||||||
|
|
||||||
EXTERN_C_BEGIN
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
Byte *data;
|
|
||||||
size_t size;
|
|
||||||
} CBuf;
|
|
||||||
|
|
||||||
void Buf_Init(CBuf *p);
|
|
||||||
int Buf_Create(CBuf *p, size_t size, ISzAllocPtr alloc);
|
|
||||||
void Buf_Free(CBuf *p, ISzAllocPtr alloc);
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
Byte *data;
|
|
||||||
size_t size;
|
|
||||||
size_t pos;
|
|
||||||
} CDynBuf;
|
|
||||||
|
|
||||||
void DynBuf_Construct(CDynBuf *p);
|
|
||||||
void DynBuf_SeekToBeg(CDynBuf *p);
|
|
||||||
int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAllocPtr alloc);
|
|
||||||
void DynBuf_Free(CDynBuf *p, ISzAllocPtr alloc);
|
|
||||||
|
|
||||||
EXTERN_C_END
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
/* 7zBuf2.c -- Byte Buffer
|
|
||||||
2017-04-03 : Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#include "Precomp.h"
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "7zBuf.h"
|
|
||||||
|
|
||||||
void DynBuf_Construct(CDynBuf *p)
|
|
||||||
{
|
|
||||||
p->data = 0;
|
|
||||||
p->size = 0;
|
|
||||||
p->pos = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DynBuf_SeekToBeg(CDynBuf *p)
|
|
||||||
{
|
|
||||||
p->pos = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAllocPtr alloc)
|
|
||||||
{
|
|
||||||
if (size > p->size - p->pos)
|
|
||||||
{
|
|
||||||
size_t newSize = p->pos + size;
|
|
||||||
Byte *data;
|
|
||||||
newSize += newSize / 4;
|
|
||||||
data = (Byte *)ISzAlloc_Alloc(alloc, newSize);
|
|
||||||
if (!data)
|
|
||||||
return 0;
|
|
||||||
p->size = newSize;
|
|
||||||
if (p->pos != 0)
|
|
||||||
memcpy(data, p->data, p->pos);
|
|
||||||
ISzAlloc_Free(alloc, p->data);
|
|
||||||
p->data = data;
|
|
||||||
}
|
|
||||||
if (size != 0)
|
|
||||||
{
|
|
||||||
memcpy(p->data + p->pos, buf, size);
|
|
||||||
p->pos += size;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DynBuf_Free(CDynBuf *p, ISzAllocPtr alloc)
|
|
||||||
{
|
|
||||||
ISzAlloc_Free(alloc, p->data);
|
|
||||||
p->data = 0;
|
|
||||||
p->size = 0;
|
|
||||||
p->pos = 0;
|
|
||||||
}
|
|
||||||
@@ -1,420 +0,0 @@
|
|||||||
/* 7zCrc.c -- CRC32 calculation and init
|
|
||||||
2024-03-01 : Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#include "Precomp.h"
|
|
||||||
|
|
||||||
#include "7zCrc.h"
|
|
||||||
#include "CpuArch.h"
|
|
||||||
|
|
||||||
// for debug:
|
|
||||||
// #define __ARM_FEATURE_CRC32 1
|
|
||||||
|
|
||||||
#ifdef __ARM_FEATURE_CRC32
|
|
||||||
// #pragma message("__ARM_FEATURE_CRC32")
|
|
||||||
#define Z7_CRC_HW_FORCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// #define Z7_CRC_DEBUG_BE
|
|
||||||
#ifdef Z7_CRC_DEBUG_BE
|
|
||||||
#undef MY_CPU_LE
|
|
||||||
#define MY_CPU_BE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef Z7_CRC_HW_FORCE
|
|
||||||
#define Z7_CRC_NUM_TABLES_USE 1
|
|
||||||
#else
|
|
||||||
#ifdef Z7_CRC_NUM_TABLES
|
|
||||||
#define Z7_CRC_NUM_TABLES_USE Z7_CRC_NUM_TABLES
|
|
||||||
#else
|
|
||||||
#define Z7_CRC_NUM_TABLES_USE 12
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE < 1
|
|
||||||
#error Stop_Compiling_Bad_Z7_CRC_NUM_TABLES
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(MY_CPU_LE) || (Z7_CRC_NUM_TABLES_USE == 1)
|
|
||||||
#define Z7_CRC_NUM_TABLES_TOTAL Z7_CRC_NUM_TABLES_USE
|
|
||||||
#else
|
|
||||||
#define Z7_CRC_NUM_TABLES_TOTAL (Z7_CRC_NUM_TABLES_USE + 1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef Z7_CRC_HW_FORCE
|
|
||||||
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE == 1 \
|
|
||||||
|| (!defined(MY_CPU_LE) && !defined(MY_CPU_BE))
|
|
||||||
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
|
||||||
#define Z7_CRC_UPDATE_T1_FUNC_NAME CrcUpdateGT1
|
|
||||||
static UInt32 Z7_FASTCALL Z7_CRC_UPDATE_T1_FUNC_NAME(UInt32 v, const void *data, size_t size)
|
|
||||||
{
|
|
||||||
const UInt32 *table = g_CrcTable;
|
|
||||||
const Byte *p = (const Byte *)data;
|
|
||||||
const Byte *lim = p + size;
|
|
||||||
for (; p != lim; p++)
|
|
||||||
v = CRC_UPDATE_BYTE_2(v, *p);
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE != 1
|
|
||||||
#ifndef MY_CPU_BE
|
|
||||||
#define FUNC_NAME_LE_2(s) CrcUpdateT ## s
|
|
||||||
#define FUNC_NAME_LE_1(s) FUNC_NAME_LE_2(s)
|
|
||||||
#define FUNC_NAME_LE FUNC_NAME_LE_1(Z7_CRC_NUM_TABLES_USE)
|
|
||||||
UInt32 Z7_FASTCALL FUNC_NAME_LE (UInt32 v, const void *data, size_t size, const UInt32 *table);
|
|
||||||
#endif
|
|
||||||
#ifndef MY_CPU_LE
|
|
||||||
#define FUNC_NAME_BE_2(s) CrcUpdateT1_BeT ## s
|
|
||||||
#define FUNC_NAME_BE_1(s) FUNC_NAME_BE_2(s)
|
|
||||||
#define FUNC_NAME_BE FUNC_NAME_BE_1(Z7_CRC_NUM_TABLES_USE)
|
|
||||||
UInt32 Z7_FASTCALL FUNC_NAME_BE (UInt32 v, const void *data, size_t size, const UInt32 *table);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // Z7_CRC_HW_FORCE
|
|
||||||
|
|
||||||
/* ---------- hardware CRC ---------- */
|
|
||||||
|
|
||||||
#ifdef MY_CPU_LE
|
|
||||||
|
|
||||||
#if defined(MY_CPU_ARM_OR_ARM64)
|
|
||||||
// #pragma message("ARM*")
|
|
||||||
|
|
||||||
#if (defined(__clang__) && (__clang_major__ >= 3)) \
|
|
||||||
|| defined(__GNUC__) && (__GNUC__ >= 6) && defined(MY_CPU_ARM64) \
|
|
||||||
|| defined(__GNUC__) && (__GNUC__ >= 8)
|
|
||||||
#if !defined(__ARM_FEATURE_CRC32)
|
|
||||||
// #pragma message("!defined(__ARM_FEATURE_CRC32)")
|
|
||||||
Z7_DIAGNOSTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER
|
|
||||||
#define __ARM_FEATURE_CRC32 1
|
|
||||||
Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER
|
|
||||||
#define Z7_ARM_FEATURE_CRC32_WAS_SET
|
|
||||||
#if defined(__clang__)
|
|
||||||
#if defined(MY_CPU_ARM64)
|
|
||||||
#define ATTRIB_CRC __attribute__((__target__("crc")))
|
|
||||||
#else
|
|
||||||
#define ATTRIB_CRC __attribute__((__target__("armv8-a,crc")))
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#if defined(MY_CPU_ARM64)
|
|
||||||
#if !defined(Z7_GCC_VERSION) || (Z7_GCC_VERSION >= 60000)
|
|
||||||
#define ATTRIB_CRC __attribute__((__target__("+crc")))
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#if !defined(Z7_GCC_VERSION) || (__GNUC__ >= 8)
|
|
||||||
#if defined(__ARM_FP) && __GNUC__ >= 8
|
|
||||||
// for -mfloat-abi=hard: similar to <arm_acle.h>
|
|
||||||
#define ATTRIB_CRC __attribute__((__target__("arch=armv8-a+crc+simd")))
|
|
||||||
#else
|
|
||||||
#define ATTRIB_CRC __attribute__((__target__("arch=armv8-a+crc")))
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#if defined(__ARM_FEATURE_CRC32)
|
|
||||||
// #pragma message("<arm_acle.h>")
|
|
||||||
/*
|
|
||||||
arm_acle.h (GGC):
|
|
||||||
before Nov 17, 2017:
|
|
||||||
#ifdef __ARM_FEATURE_CRC32
|
|
||||||
|
|
||||||
Nov 17, 2017: gcc10.0 (gcc 9.2.0) checked"
|
|
||||||
#if __ARM_ARCH >= 8
|
|
||||||
#pragma GCC target ("arch=armv8-a+crc")
|
|
||||||
|
|
||||||
Aug 22, 2019: GCC 8.4?, 9.2.1, 10.1:
|
|
||||||
#ifdef __ARM_FEATURE_CRC32
|
|
||||||
#ifdef __ARM_FP
|
|
||||||
#pragma GCC target ("arch=armv8-a+crc+simd")
|
|
||||||
#else
|
|
||||||
#pragma GCC target ("arch=armv8-a+crc")
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
#if defined(__ARM_ARCH) && __ARM_ARCH < 8
|
|
||||||
#if defined(Z7_GCC_VERSION) && (__GNUC__ == 8) && (Z7_GCC_VERSION < 80400) \
|
|
||||||
|| defined(Z7_GCC_VERSION) && (__GNUC__ == 9) && (Z7_GCC_VERSION < 90201) \
|
|
||||||
|| defined(Z7_GCC_VERSION) && (__GNUC__ == 10) && (Z7_GCC_VERSION < 100100)
|
|
||||||
Z7_DIAGNOSTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER
|
|
||||||
// #pragma message("#define __ARM_ARCH 8")
|
|
||||||
#undef __ARM_ARCH
|
|
||||||
#define __ARM_ARCH 8
|
|
||||||
Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#define Z7_CRC_HW_USE
|
|
||||||
#include <arm_acle.h>
|
|
||||||
#endif
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#if defined(MY_CPU_ARM64)
|
|
||||||
#if (_MSC_VER >= 1910)
|
|
||||||
#ifdef __clang__
|
|
||||||
// #define Z7_CRC_HW_USE
|
|
||||||
// #include <arm_acle.h>
|
|
||||||
#else
|
|
||||||
#define Z7_CRC_HW_USE
|
|
||||||
#include <intrin.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else // non-ARM*
|
|
||||||
|
|
||||||
// #define Z7_CRC_HW_USE // for debug : we can test HW-branch of code
|
|
||||||
#ifdef Z7_CRC_HW_USE
|
|
||||||
#include "7zCrcEmu.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // non-ARM*
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(Z7_CRC_HW_USE)
|
|
||||||
|
|
||||||
// #pragma message("USE ARM HW CRC")
|
|
||||||
|
|
||||||
#ifdef MY_CPU_64BIT
|
|
||||||
#define CRC_HW_WORD_TYPE UInt64
|
|
||||||
#define CRC_HW_WORD_FUNC __crc32d
|
|
||||||
#else
|
|
||||||
#define CRC_HW_WORD_TYPE UInt32
|
|
||||||
#define CRC_HW_WORD_FUNC __crc32w
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CRC_HW_UNROLL_BYTES (sizeof(CRC_HW_WORD_TYPE) * 4)
|
|
||||||
|
|
||||||
#ifdef ATTRIB_CRC
|
|
||||||
ATTRIB_CRC
|
|
||||||
#endif
|
|
||||||
Z7_NO_INLINE
|
|
||||||
#ifdef Z7_CRC_HW_FORCE
|
|
||||||
UInt32 Z7_FASTCALL CrcUpdate
|
|
||||||
#else
|
|
||||||
static UInt32 Z7_FASTCALL CrcUpdate_HW
|
|
||||||
#endif
|
|
||||||
(UInt32 v, const void *data, size_t size)
|
|
||||||
{
|
|
||||||
const Byte *p = (const Byte *)data;
|
|
||||||
for (; size != 0 && ((unsigned)(ptrdiff_t)p & (CRC_HW_UNROLL_BYTES - 1)) != 0; size--)
|
|
||||||
v = __crc32b(v, *p++);
|
|
||||||
if (size >= CRC_HW_UNROLL_BYTES)
|
|
||||||
{
|
|
||||||
const Byte *lim = p + size;
|
|
||||||
size &= CRC_HW_UNROLL_BYTES - 1;
|
|
||||||
lim -= size;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
v = CRC_HW_WORD_FUNC(v, *(const CRC_HW_WORD_TYPE *)(const void *)(p));
|
|
||||||
v = CRC_HW_WORD_FUNC(v, *(const CRC_HW_WORD_TYPE *)(const void *)(p + sizeof(CRC_HW_WORD_TYPE)));
|
|
||||||
p += 2 * sizeof(CRC_HW_WORD_TYPE);
|
|
||||||
v = CRC_HW_WORD_FUNC(v, *(const CRC_HW_WORD_TYPE *)(const void *)(p));
|
|
||||||
v = CRC_HW_WORD_FUNC(v, *(const CRC_HW_WORD_TYPE *)(const void *)(p + sizeof(CRC_HW_WORD_TYPE)));
|
|
||||||
p += 2 * sizeof(CRC_HW_WORD_TYPE);
|
|
||||||
}
|
|
||||||
while (p != lim);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; size != 0; size--)
|
|
||||||
v = __crc32b(v, *p++);
|
|
||||||
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef Z7_ARM_FEATURE_CRC32_WAS_SET
|
|
||||||
Z7_DIAGNOSTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER
|
|
||||||
#undef __ARM_FEATURE_CRC32
|
|
||||||
Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER
|
|
||||||
#undef Z7_ARM_FEATURE_CRC32_WAS_SET
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // defined(Z7_CRC_HW_USE)
|
|
||||||
#endif // MY_CPU_LE
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef Z7_CRC_HW_FORCE
|
|
||||||
|
|
||||||
#if defined(Z7_CRC_HW_USE) || defined(Z7_CRC_UPDATE_T1_FUNC_NAME)
|
|
||||||
/*
|
|
||||||
typedef UInt32 (Z7_FASTCALL *Z7_CRC_UPDATE_WITH_TABLE_FUNC)
|
|
||||||
(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
|
||||||
Z7_CRC_UPDATE_WITH_TABLE_FUNC g_CrcUpdate;
|
|
||||||
*/
|
|
||||||
static unsigned g_Crc_Algo;
|
|
||||||
#if (!defined(MY_CPU_LE) && !defined(MY_CPU_BE))
|
|
||||||
static unsigned g_Crc_Be;
|
|
||||||
#endif
|
|
||||||
#endif // defined(Z7_CRC_HW_USE) || defined(Z7_CRC_UPDATE_T1_FUNC_NAME)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Z7_NO_INLINE
|
|
||||||
#ifdef Z7_CRC_HW_USE
|
|
||||||
static UInt32 Z7_FASTCALL CrcUpdate_Base
|
|
||||||
#else
|
|
||||||
UInt32 Z7_FASTCALL CrcUpdate
|
|
||||||
#endif
|
|
||||||
(UInt32 crc, const void *data, size_t size)
|
|
||||||
{
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE == 1
|
|
||||||
return Z7_CRC_UPDATE_T1_FUNC_NAME(crc, data, size);
|
|
||||||
#else // Z7_CRC_NUM_TABLES_USE != 1
|
|
||||||
#ifdef Z7_CRC_UPDATE_T1_FUNC_NAME
|
|
||||||
if (g_Crc_Algo == 1)
|
|
||||||
return Z7_CRC_UPDATE_T1_FUNC_NAME(crc, data, size);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MY_CPU_LE
|
|
||||||
return FUNC_NAME_LE(crc, data, size, g_CrcTable);
|
|
||||||
#elif defined(MY_CPU_BE)
|
|
||||||
return FUNC_NAME_BE(crc, data, size, g_CrcTable);
|
|
||||||
#else
|
|
||||||
if (g_Crc_Be)
|
|
||||||
return FUNC_NAME_BE(crc, data, size, g_CrcTable);
|
|
||||||
else
|
|
||||||
return FUNC_NAME_LE(crc, data, size, g_CrcTable);
|
|
||||||
#endif
|
|
||||||
#endif // Z7_CRC_NUM_TABLES_USE != 1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef Z7_CRC_HW_USE
|
|
||||||
Z7_NO_INLINE
|
|
||||||
UInt32 Z7_FASTCALL CrcUpdate(UInt32 crc, const void *data, size_t size)
|
|
||||||
{
|
|
||||||
if (g_Crc_Algo == 0)
|
|
||||||
return CrcUpdate_HW(crc, data, size);
|
|
||||||
return CrcUpdate_Base(crc, data, size);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // !defined(Z7_CRC_HW_FORCE)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UInt32 Z7_FASTCALL CrcCalc(const void *data, size_t size)
|
|
||||||
{
|
|
||||||
return CrcUpdate(CRC_INIT_VAL, data, size) ^ CRC_INIT_VAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
MY_ALIGN(64)
|
|
||||||
UInt32 g_CrcTable[256 * Z7_CRC_NUM_TABLES_TOTAL];
|
|
||||||
|
|
||||||
|
|
||||||
void Z7_FASTCALL CrcGenerateTable(void)
|
|
||||||
{
|
|
||||||
UInt32 i;
|
|
||||||
for (i = 0; i < 256; i++)
|
|
||||||
{
|
|
||||||
#if defined(Z7_CRC_HW_FORCE)
|
|
||||||
g_CrcTable[i] = __crc32b(i, 0);
|
|
||||||
#else
|
|
||||||
#define kCrcPoly 0xEDB88320
|
|
||||||
UInt32 r = i;
|
|
||||||
unsigned j;
|
|
||||||
for (j = 0; j < 8; j++)
|
|
||||||
r = (r >> 1) ^ (kCrcPoly & ((UInt32)0 - (r & 1)));
|
|
||||||
g_CrcTable[i] = r;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
for (i = 256; i < 256 * Z7_CRC_NUM_TABLES_USE; i++)
|
|
||||||
{
|
|
||||||
const UInt32 r = g_CrcTable[(size_t)i - 256];
|
|
||||||
g_CrcTable[i] = g_CrcTable[r & 0xFF] ^ (r >> 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !defined(Z7_CRC_HW_FORCE) && \
|
|
||||||
(defined(Z7_CRC_HW_USE) || defined(Z7_CRC_UPDATE_T1_FUNC_NAME) || defined(MY_CPU_BE))
|
|
||||||
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE <= 1
|
|
||||||
g_Crc_Algo = 1;
|
|
||||||
#else // Z7_CRC_NUM_TABLES_USE <= 1
|
|
||||||
|
|
||||||
#if defined(MY_CPU_LE)
|
|
||||||
g_Crc_Algo = Z7_CRC_NUM_TABLES_USE;
|
|
||||||
#else // !defined(MY_CPU_LE)
|
|
||||||
{
|
|
||||||
#ifndef MY_CPU_BE
|
|
||||||
UInt32 k = 0x01020304;
|
|
||||||
const Byte *p = (const Byte *)&k;
|
|
||||||
if (p[0] == 4 && p[1] == 3)
|
|
||||||
g_Crc_Algo = Z7_CRC_NUM_TABLES_USE;
|
|
||||||
else if (p[0] != 1 || p[1] != 2)
|
|
||||||
g_Crc_Algo = 1;
|
|
||||||
else
|
|
||||||
#endif // MY_CPU_BE
|
|
||||||
{
|
|
||||||
for (i = 256 * Z7_CRC_NUM_TABLES_TOTAL - 1; i >= 256; i--)
|
|
||||||
{
|
|
||||||
const UInt32 x = g_CrcTable[(size_t)i - 256];
|
|
||||||
g_CrcTable[i] = Z7_BSWAP32(x);
|
|
||||||
}
|
|
||||||
#if defined(Z7_CRC_UPDATE_T1_FUNC_NAME)
|
|
||||||
g_Crc_Algo = Z7_CRC_NUM_TABLES_USE;
|
|
||||||
#endif
|
|
||||||
#if (!defined(MY_CPU_LE) && !defined(MY_CPU_BE))
|
|
||||||
g_Crc_Be = 1;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // !defined(MY_CPU_LE)
|
|
||||||
|
|
||||||
#ifdef MY_CPU_LE
|
|
||||||
#ifdef Z7_CRC_HW_USE
|
|
||||||
if (CPU_IsSupported_CRC32())
|
|
||||||
g_Crc_Algo = 0;
|
|
||||||
#endif // Z7_CRC_HW_USE
|
|
||||||
#endif // MY_CPU_LE
|
|
||||||
|
|
||||||
#endif // Z7_CRC_NUM_TABLES_USE <= 1
|
|
||||||
#endif // g_Crc_Algo was declared
|
|
||||||
}
|
|
||||||
|
|
||||||
Z7_CRC_UPDATE_FUNC z7_GetFunc_CrcUpdate(unsigned algo)
|
|
||||||
{
|
|
||||||
if (algo == 0)
|
|
||||||
return &CrcUpdate;
|
|
||||||
|
|
||||||
#if defined(Z7_CRC_HW_USE)
|
|
||||||
if (algo == sizeof(CRC_HW_WORD_TYPE) * 8)
|
|
||||||
{
|
|
||||||
#ifdef Z7_CRC_HW_FORCE
|
|
||||||
return &CrcUpdate;
|
|
||||||
#else
|
|
||||||
if (g_Crc_Algo == 0)
|
|
||||||
return &CrcUpdate_HW;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef Z7_CRC_HW_FORCE
|
|
||||||
if (algo == Z7_CRC_NUM_TABLES_USE)
|
|
||||||
return
|
|
||||||
#ifdef Z7_CRC_HW_USE
|
|
||||||
&CrcUpdate_Base;
|
|
||||||
#else
|
|
||||||
&CrcUpdate;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef kCrcPoly
|
|
||||||
#undef Z7_CRC_NUM_TABLES_USE
|
|
||||||
#undef Z7_CRC_NUM_TABLES_TOTAL
|
|
||||||
#undef CRC_UPDATE_BYTE_2
|
|
||||||
#undef FUNC_NAME_LE_2
|
|
||||||
#undef FUNC_NAME_LE_1
|
|
||||||
#undef FUNC_NAME_LE
|
|
||||||
#undef FUNC_NAME_BE_2
|
|
||||||
#undef FUNC_NAME_BE_1
|
|
||||||
#undef FUNC_NAME_BE
|
|
||||||
|
|
||||||
#undef CRC_HW_UNROLL_BYTES
|
|
||||||
#undef CRC_HW_WORD_FUNC
|
|
||||||
#undef CRC_HW_WORD_TYPE
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
/* 7zCrc.h -- CRC32 calculation
|
|
||||||
2024-01-22 : Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#ifndef ZIP7_INC_7Z_CRC_H
|
|
||||||
#define ZIP7_INC_7Z_CRC_H
|
|
||||||
|
|
||||||
#include "7zTypes.h"
|
|
||||||
|
|
||||||
EXTERN_C_BEGIN
|
|
||||||
|
|
||||||
extern UInt32 g_CrcTable[];
|
|
||||||
|
|
||||||
/* Call CrcGenerateTable one time before other CRC functions */
|
|
||||||
void Z7_FASTCALL CrcGenerateTable(void);
|
|
||||||
|
|
||||||
#define CRC_INIT_VAL 0xFFFFFFFF
|
|
||||||
#define CRC_GET_DIGEST(crc) ((crc) ^ CRC_INIT_VAL)
|
|
||||||
#define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
|
||||||
|
|
||||||
UInt32 Z7_FASTCALL CrcUpdate(UInt32 crc, const void *data, size_t size);
|
|
||||||
UInt32 Z7_FASTCALL CrcCalc(const void *data, size_t size);
|
|
||||||
|
|
||||||
typedef UInt32 (Z7_FASTCALL *Z7_CRC_UPDATE_FUNC)(UInt32 v, const void *data, size_t size);
|
|
||||||
Z7_CRC_UPDATE_FUNC z7_GetFunc_CrcUpdate(unsigned algo);
|
|
||||||
|
|
||||||
EXTERN_C_END
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,199 +0,0 @@
|
|||||||
/* 7zCrcOpt.c -- CRC32 calculation (optimized functions)
|
|
||||||
2023-12-07 : Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#include "Precomp.h"
|
|
||||||
|
|
||||||
#include "CpuArch.h"
|
|
||||||
|
|
||||||
#if !defined(Z7_CRC_NUM_TABLES) || Z7_CRC_NUM_TABLES > 1
|
|
||||||
|
|
||||||
// for debug only : define Z7_CRC_DEBUG_BE to test big-endian code in little-endian cpu
|
|
||||||
// #define Z7_CRC_DEBUG_BE
|
|
||||||
#ifdef Z7_CRC_DEBUG_BE
|
|
||||||
#undef MY_CPU_LE
|
|
||||||
#define MY_CPU_BE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// the value Z7_CRC_NUM_TABLES_USE must be defined to same value as in 7zCrc.c
|
|
||||||
#ifdef Z7_CRC_NUM_TABLES
|
|
||||||
#define Z7_CRC_NUM_TABLES_USE Z7_CRC_NUM_TABLES
|
|
||||||
#else
|
|
||||||
#define Z7_CRC_NUM_TABLES_USE 12
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE % 4 || \
|
|
||||||
Z7_CRC_NUM_TABLES_USE < 4 * 1 || \
|
|
||||||
Z7_CRC_NUM_TABLES_USE > 4 * 6
|
|
||||||
#error Stop_Compiling_Bad_Z7_CRC_NUM_TABLES
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef MY_CPU_BE
|
|
||||||
|
|
||||||
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
|
||||||
|
|
||||||
#define Q(n, d) \
|
|
||||||
( (table + ((n) * 4 + 3) * 0x100)[(Byte)(d)] \
|
|
||||||
^ (table + ((n) * 4 + 2) * 0x100)[((d) >> 1 * 8) & 0xFF] \
|
|
||||||
^ (table + ((n) * 4 + 1) * 0x100)[((d) >> 2 * 8) & 0xFF] \
|
|
||||||
^ (table + ((n) * 4 + 0) * 0x100)[((d) >> 3 * 8)] )
|
|
||||||
|
|
||||||
#define R(a) *((const UInt32 *)(const void *)p + (a))
|
|
||||||
|
|
||||||
#define CRC_FUNC_PRE_LE2(step) \
|
|
||||||
UInt32 Z7_FASTCALL CrcUpdateT ## step (UInt32 v, const void *data, size_t size, const UInt32 *table)
|
|
||||||
|
|
||||||
#define CRC_FUNC_PRE_LE(step) \
|
|
||||||
CRC_FUNC_PRE_LE2(step); \
|
|
||||||
CRC_FUNC_PRE_LE2(step)
|
|
||||||
|
|
||||||
CRC_FUNC_PRE_LE(Z7_CRC_NUM_TABLES_USE)
|
|
||||||
{
|
|
||||||
const Byte *p = (const Byte *)data;
|
|
||||||
const Byte *lim;
|
|
||||||
for (; size && ((unsigned)(ptrdiff_t)p & (7 - (Z7_CRC_NUM_TABLES_USE & 4))) != 0; size--, p++)
|
|
||||||
v = CRC_UPDATE_BYTE_2(v, *p);
|
|
||||||
lim = p + size;
|
|
||||||
if (size >= Z7_CRC_NUM_TABLES_USE)
|
|
||||||
{
|
|
||||||
lim -= Z7_CRC_NUM_TABLES_USE;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
v ^= R(0);
|
|
||||||
{
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE == 1 * 4
|
|
||||||
v = Q(0, v);
|
|
||||||
#else
|
|
||||||
#define U2(r, op) \
|
|
||||||
{ d = R(r); x op Q(Z7_CRC_NUM_TABLES_USE / 4 - 1 - (r), d); }
|
|
||||||
UInt32 d, x;
|
|
||||||
U2(1, =)
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE >= 3 * 4
|
|
||||||
#define U(r) U2(r, ^=)
|
|
||||||
U(2)
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE >= 4 * 4
|
|
||||||
U(3)
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE >= 5 * 4
|
|
||||||
U(4)
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE >= 6 * 4
|
|
||||||
U(5)
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE >= 7 * 4
|
|
||||||
#error Stop_Compiling_Bad_Z7_CRC_NUM_TABLES
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#undef U
|
|
||||||
#undef U2
|
|
||||||
v = x ^ Q(Z7_CRC_NUM_TABLES_USE / 4 - 1, v);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
p += Z7_CRC_NUM_TABLES_USE;
|
|
||||||
}
|
|
||||||
while (p <= lim);
|
|
||||||
lim += Z7_CRC_NUM_TABLES_USE;
|
|
||||||
}
|
|
||||||
for (; p < lim; p++)
|
|
||||||
v = CRC_UPDATE_BYTE_2(v, *p);
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef CRC_UPDATE_BYTE_2
|
|
||||||
#undef R
|
|
||||||
#undef Q
|
|
||||||
#undef CRC_FUNC_PRE_LE
|
|
||||||
#undef CRC_FUNC_PRE_LE2
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef MY_CPU_LE
|
|
||||||
|
|
||||||
#define CRC_UPDATE_BYTE_2_BE(crc, b) (table[((crc) >> 24) ^ (b)] ^ ((crc) << 8))
|
|
||||||
|
|
||||||
#define Q(n, d) \
|
|
||||||
( (table + ((n) * 4 + 0) * 0x100)[((d)) & 0xFF] \
|
|
||||||
^ (table + ((n) * 4 + 1) * 0x100)[((d) >> 1 * 8) & 0xFF] \
|
|
||||||
^ (table + ((n) * 4 + 2) * 0x100)[((d) >> 2 * 8) & 0xFF] \
|
|
||||||
^ (table + ((n) * 4 + 3) * 0x100)[((d) >> 3 * 8)] )
|
|
||||||
|
|
||||||
#ifdef Z7_CRC_DEBUG_BE
|
|
||||||
#define R(a) GetBe32a((const UInt32 *)(const void *)p + (a))
|
|
||||||
#else
|
|
||||||
#define R(a) *((const UInt32 *)(const void *)p + (a))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define CRC_FUNC_PRE_BE2(step) \
|
|
||||||
UInt32 Z7_FASTCALL CrcUpdateT1_BeT ## step (UInt32 v, const void *data, size_t size, const UInt32 *table)
|
|
||||||
|
|
||||||
#define CRC_FUNC_PRE_BE(step) \
|
|
||||||
CRC_FUNC_PRE_BE2(step); \
|
|
||||||
CRC_FUNC_PRE_BE2(step)
|
|
||||||
|
|
||||||
CRC_FUNC_PRE_BE(Z7_CRC_NUM_TABLES_USE)
|
|
||||||
{
|
|
||||||
const Byte *p = (const Byte *)data;
|
|
||||||
const Byte *lim;
|
|
||||||
table += 0x100;
|
|
||||||
v = Z7_BSWAP32(v);
|
|
||||||
for (; size && ((unsigned)(ptrdiff_t)p & (7 - (Z7_CRC_NUM_TABLES_USE & 4))) != 0; size--, p++)
|
|
||||||
v = CRC_UPDATE_BYTE_2_BE(v, *p);
|
|
||||||
lim = p + size;
|
|
||||||
if (size >= Z7_CRC_NUM_TABLES_USE)
|
|
||||||
{
|
|
||||||
lim -= Z7_CRC_NUM_TABLES_USE;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
v ^= R(0);
|
|
||||||
{
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE == 1 * 4
|
|
||||||
v = Q(0, v);
|
|
||||||
#else
|
|
||||||
#define U2(r, op) \
|
|
||||||
{ d = R(r); x op Q(Z7_CRC_NUM_TABLES_USE / 4 - 1 - (r), d); }
|
|
||||||
UInt32 d, x;
|
|
||||||
U2(1, =)
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE >= 3 * 4
|
|
||||||
#define U(r) U2(r, ^=)
|
|
||||||
U(2)
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE >= 4 * 4
|
|
||||||
U(3)
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE >= 5 * 4
|
|
||||||
U(4)
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE >= 6 * 4
|
|
||||||
U(5)
|
|
||||||
#if Z7_CRC_NUM_TABLES_USE >= 7 * 4
|
|
||||||
#error Stop_Compiling_Bad_Z7_CRC_NUM_TABLES
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#undef U
|
|
||||||
#undef U2
|
|
||||||
v = x ^ Q(Z7_CRC_NUM_TABLES_USE / 4 - 1, v);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
p += Z7_CRC_NUM_TABLES_USE;
|
|
||||||
}
|
|
||||||
while (p <= lim);
|
|
||||||
lim += Z7_CRC_NUM_TABLES_USE;
|
|
||||||
}
|
|
||||||
for (; p < lim; p++)
|
|
||||||
v = CRC_UPDATE_BYTE_2_BE(v, *p);
|
|
||||||
return Z7_BSWAP32(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef CRC_UPDATE_BYTE_2_BE
|
|
||||||
#undef R
|
|
||||||
#undef Q
|
|
||||||
#undef CRC_FUNC_PRE_BE
|
|
||||||
#undef CRC_FUNC_PRE_BE2
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#undef Z7_CRC_NUM_TABLES_USE
|
|
||||||
#endif
|
|
||||||
@@ -1,673 +0,0 @@
|
|||||||
/* 7zDec.c -- Decoding from 7z folder
|
|
||||||
: Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#include "Precomp.h"
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
/* #define Z7_PPMD_SUPPORT */
|
|
||||||
|
|
||||||
#include "7z.h"
|
|
||||||
#include "7zCrc.h"
|
|
||||||
|
|
||||||
#include "Bcj2.h"
|
|
||||||
#include "Bra.h"
|
|
||||||
#include "CpuArch.h"
|
|
||||||
#include "Delta.h"
|
|
||||||
#include "LzmaDec.h"
|
|
||||||
#include "Lzma2Dec.h"
|
|
||||||
#ifdef Z7_PPMD_SUPPORT
|
|
||||||
#include "Ppmd7.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define k_Copy 0
|
|
||||||
#ifndef Z7_NO_METHOD_LZMA2
|
|
||||||
#define k_LZMA2 0x21
|
|
||||||
#endif
|
|
||||||
#define k_LZMA 0x30101
|
|
||||||
#define k_BCJ2 0x303011B
|
|
||||||
|
|
||||||
#if !defined(Z7_NO_METHODS_FILTERS)
|
|
||||||
#define Z7_USE_BRANCH_FILTER
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(Z7_NO_METHODS_FILTERS) || \
|
|
||||||
defined(Z7_USE_NATIVE_BRANCH_FILTER) && defined(MY_CPU_ARM64)
|
|
||||||
#define Z7_USE_FILTER_ARM64
|
|
||||||
#ifndef Z7_USE_BRANCH_FILTER
|
|
||||||
#define Z7_USE_BRANCH_FILTER
|
|
||||||
#endif
|
|
||||||
#define k_ARM64 0xa
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(Z7_NO_METHODS_FILTERS) || \
|
|
||||||
defined(Z7_USE_NATIVE_BRANCH_FILTER) && defined(MY_CPU_ARMT)
|
|
||||||
#define Z7_USE_FILTER_ARMT
|
|
||||||
#ifndef Z7_USE_BRANCH_FILTER
|
|
||||||
#define Z7_USE_BRANCH_FILTER
|
|
||||||
#endif
|
|
||||||
#define k_ARMT 0x3030701
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef Z7_NO_METHODS_FILTERS
|
|
||||||
#define k_Delta 3
|
|
||||||
#define k_RISCV 0xb
|
|
||||||
#define k_BCJ 0x3030103
|
|
||||||
#define k_PPC 0x3030205
|
|
||||||
#define k_IA64 0x3030401
|
|
||||||
#define k_ARM 0x3030501
|
|
||||||
#define k_SPARC 0x3030805
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef Z7_PPMD_SUPPORT
|
|
||||||
|
|
||||||
#define k_PPMD 0x30401
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
IByteIn vt;
|
|
||||||
const Byte *cur;
|
|
||||||
const Byte *end;
|
|
||||||
const Byte *begin;
|
|
||||||
UInt64 processed;
|
|
||||||
BoolInt extra;
|
|
||||||
SRes res;
|
|
||||||
ILookInStreamPtr inStream;
|
|
||||||
} CByteInToLook;
|
|
||||||
|
|
||||||
static Byte ReadByte(IByteInPtr pp)
|
|
||||||
{
|
|
||||||
Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR_pp_vt_p(CByteInToLook)
|
|
||||||
if (p->cur != p->end)
|
|
||||||
return *p->cur++;
|
|
||||||
if (p->res == SZ_OK)
|
|
||||||
{
|
|
||||||
size_t size = (size_t)(p->cur - p->begin);
|
|
||||||
p->processed += size;
|
|
||||||
p->res = ILookInStream_Skip(p->inStream, size);
|
|
||||||
size = (1 << 25);
|
|
||||||
p->res = ILookInStream_Look(p->inStream, (const void **)&p->begin, &size);
|
|
||||||
p->cur = p->begin;
|
|
||||||
p->end = p->begin + size;
|
|
||||||
if (size != 0)
|
|
||||||
return *p->cur++;
|
|
||||||
}
|
|
||||||
p->extra = True;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static SRes SzDecodePpmd(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStreamPtr inStream,
|
|
||||||
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
|
|
||||||
{
|
|
||||||
CPpmd7 ppmd;
|
|
||||||
CByteInToLook s;
|
|
||||||
SRes res = SZ_OK;
|
|
||||||
|
|
||||||
s.vt.Read = ReadByte;
|
|
||||||
s.inStream = inStream;
|
|
||||||
s.begin = s.end = s.cur = NULL;
|
|
||||||
s.extra = False;
|
|
||||||
s.res = SZ_OK;
|
|
||||||
s.processed = 0;
|
|
||||||
|
|
||||||
if (propsSize != 5)
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
|
|
||||||
{
|
|
||||||
unsigned order = props[0];
|
|
||||||
UInt32 memSize = GetUi32(props + 1);
|
|
||||||
if (order < PPMD7_MIN_ORDER ||
|
|
||||||
order > PPMD7_MAX_ORDER ||
|
|
||||||
memSize < PPMD7_MIN_MEM_SIZE ||
|
|
||||||
memSize > PPMD7_MAX_MEM_SIZE)
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
Ppmd7_Construct(&ppmd);
|
|
||||||
if (!Ppmd7_Alloc(&ppmd, memSize, allocMain))
|
|
||||||
return SZ_ERROR_MEM;
|
|
||||||
Ppmd7_Init(&ppmd, order);
|
|
||||||
}
|
|
||||||
{
|
|
||||||
ppmd.rc.dec.Stream = &s.vt;
|
|
||||||
if (!Ppmd7z_RangeDec_Init(&ppmd.rc.dec))
|
|
||||||
res = SZ_ERROR_DATA;
|
|
||||||
else if (!s.extra)
|
|
||||||
{
|
|
||||||
Byte *buf = outBuffer;
|
|
||||||
const Byte *lim = buf + outSize;
|
|
||||||
for (; buf != lim; buf++)
|
|
||||||
{
|
|
||||||
int sym = Ppmd7z_DecodeSymbol(&ppmd);
|
|
||||||
if (s.extra || sym < 0)
|
|
||||||
break;
|
|
||||||
*buf = (Byte)sym;
|
|
||||||
}
|
|
||||||
if (buf != lim)
|
|
||||||
res = SZ_ERROR_DATA;
|
|
||||||
else if (!Ppmd7z_RangeDec_IsFinishedOK(&ppmd.rc.dec))
|
|
||||||
{
|
|
||||||
/* if (Ppmd7z_DecodeSymbol(&ppmd) != PPMD7_SYM_END || !Ppmd7z_RangeDec_IsFinishedOK(&ppmd.rc.dec)) */
|
|
||||||
res = SZ_ERROR_DATA;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (s.extra)
|
|
||||||
res = (s.res != SZ_OK ? s.res : SZ_ERROR_DATA);
|
|
||||||
else if (s.processed + (size_t)(s.cur - s.begin) != inSize)
|
|
||||||
res = SZ_ERROR_DATA;
|
|
||||||
}
|
|
||||||
Ppmd7_Free(&ppmd, allocMain);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static SRes SzDecodeLzma(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStreamPtr inStream,
|
|
||||||
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
|
|
||||||
{
|
|
||||||
CLzmaDec state;
|
|
||||||
SRes res = SZ_OK;
|
|
||||||
|
|
||||||
LzmaDec_CONSTRUCT(&state)
|
|
||||||
RINOK(LzmaDec_AllocateProbs(&state, props, propsSize, allocMain))
|
|
||||||
state.dic = outBuffer;
|
|
||||||
state.dicBufSize = outSize;
|
|
||||||
LzmaDec_Init(&state);
|
|
||||||
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
const void *inBuf = NULL;
|
|
||||||
size_t lookahead = (1 << 18);
|
|
||||||
if (lookahead > inSize)
|
|
||||||
lookahead = (size_t)inSize;
|
|
||||||
res = ILookInStream_Look(inStream, &inBuf, &lookahead);
|
|
||||||
if (res != SZ_OK)
|
|
||||||
break;
|
|
||||||
|
|
||||||
{
|
|
||||||
SizeT inProcessed = (SizeT)lookahead, dicPos = state.dicPos;
|
|
||||||
ELzmaStatus status;
|
|
||||||
res = LzmaDec_DecodeToDic(&state, outSize, (const Byte *)inBuf, &inProcessed, LZMA_FINISH_END, &status);
|
|
||||||
lookahead -= inProcessed;
|
|
||||||
inSize -= inProcessed;
|
|
||||||
if (res != SZ_OK)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (status == LZMA_STATUS_FINISHED_WITH_MARK)
|
|
||||||
{
|
|
||||||
if (outSize != state.dicPos || inSize != 0)
|
|
||||||
res = SZ_ERROR_DATA;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (outSize == state.dicPos && inSize == 0 && status == LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (inProcessed == 0 && dicPos == state.dicPos)
|
|
||||||
{
|
|
||||||
res = SZ_ERROR_DATA;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
res = ILookInStream_Skip(inStream, inProcessed);
|
|
||||||
if (res != SZ_OK)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LzmaDec_FreeProbs(&state, allocMain);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef Z7_NO_METHOD_LZMA2
|
|
||||||
|
|
||||||
static SRes SzDecodeLzma2(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStreamPtr inStream,
|
|
||||||
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
|
|
||||||
{
|
|
||||||
CLzma2Dec state;
|
|
||||||
SRes res = SZ_OK;
|
|
||||||
|
|
||||||
Lzma2Dec_CONSTRUCT(&state)
|
|
||||||
if (propsSize != 1)
|
|
||||||
return SZ_ERROR_DATA;
|
|
||||||
RINOK(Lzma2Dec_AllocateProbs(&state, props[0], allocMain))
|
|
||||||
state.decoder.dic = outBuffer;
|
|
||||||
state.decoder.dicBufSize = outSize;
|
|
||||||
Lzma2Dec_Init(&state);
|
|
||||||
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
const void *inBuf = NULL;
|
|
||||||
size_t lookahead = (1 << 18);
|
|
||||||
if (lookahead > inSize)
|
|
||||||
lookahead = (size_t)inSize;
|
|
||||||
res = ILookInStream_Look(inStream, &inBuf, &lookahead);
|
|
||||||
if (res != SZ_OK)
|
|
||||||
break;
|
|
||||||
|
|
||||||
{
|
|
||||||
SizeT inProcessed = (SizeT)lookahead, dicPos = state.decoder.dicPos;
|
|
||||||
ELzmaStatus status;
|
|
||||||
res = Lzma2Dec_DecodeToDic(&state, outSize, (const Byte *)inBuf, &inProcessed, LZMA_FINISH_END, &status);
|
|
||||||
lookahead -= inProcessed;
|
|
||||||
inSize -= inProcessed;
|
|
||||||
if (res != SZ_OK)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (status == LZMA_STATUS_FINISHED_WITH_MARK)
|
|
||||||
{
|
|
||||||
if (outSize != state.decoder.dicPos || inSize != 0)
|
|
||||||
res = SZ_ERROR_DATA;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inProcessed == 0 && dicPos == state.decoder.dicPos)
|
|
||||||
{
|
|
||||||
res = SZ_ERROR_DATA;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
res = ILookInStream_Skip(inStream, inProcessed);
|
|
||||||
if (res != SZ_OK)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Lzma2Dec_FreeProbs(&state, allocMain);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static SRes SzDecodeCopy(UInt64 inSize, ILookInStreamPtr inStream, Byte *outBuffer)
|
|
||||||
{
|
|
||||||
while (inSize > 0)
|
|
||||||
{
|
|
||||||
const void *inBuf;
|
|
||||||
size_t curSize = (1 << 18);
|
|
||||||
if (curSize > inSize)
|
|
||||||
curSize = (size_t)inSize;
|
|
||||||
RINOK(ILookInStream_Look(inStream, &inBuf, &curSize))
|
|
||||||
if (curSize == 0)
|
|
||||||
return SZ_ERROR_INPUT_EOF;
|
|
||||||
memcpy(outBuffer, inBuf, curSize);
|
|
||||||
outBuffer += curSize;
|
|
||||||
inSize -= curSize;
|
|
||||||
RINOK(ILookInStream_Skip(inStream, curSize))
|
|
||||||
}
|
|
||||||
return SZ_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BoolInt IS_MAIN_METHOD(UInt32 m)
|
|
||||||
{
|
|
||||||
switch (m)
|
|
||||||
{
|
|
||||||
case k_Copy:
|
|
||||||
case k_LZMA:
|
|
||||||
#ifndef Z7_NO_METHOD_LZMA2
|
|
||||||
case k_LZMA2:
|
|
||||||
#endif
|
|
||||||
#ifdef Z7_PPMD_SUPPORT
|
|
||||||
case k_PPMD:
|
|
||||||
#endif
|
|
||||||
return True;
|
|
||||||
default:
|
|
||||||
return False;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static BoolInt IS_SUPPORTED_CODER(const CSzCoderInfo *c)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
c->NumStreams == 1
|
|
||||||
/* && c->MethodID <= (UInt32)0xFFFFFFFF */
|
|
||||||
&& IS_MAIN_METHOD((UInt32)c->MethodID);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define IS_BCJ2(c) ((c)->MethodID == k_BCJ2 && (c)->NumStreams == 4)
|
|
||||||
|
|
||||||
static SRes CheckSupportedFolder(const CSzFolder *f)
|
|
||||||
{
|
|
||||||
if (f->NumCoders < 1 || f->NumCoders > 4)
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
if (!IS_SUPPORTED_CODER(&f->Coders[0]))
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
if (f->NumCoders == 1)
|
|
||||||
{
|
|
||||||
if (f->NumPackStreams != 1 || f->PackStreams[0] != 0 || f->NumBonds != 0)
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
return SZ_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(Z7_USE_BRANCH_FILTER)
|
|
||||||
|
|
||||||
if (f->NumCoders == 2)
|
|
||||||
{
|
|
||||||
const CSzCoderInfo *c = &f->Coders[1];
|
|
||||||
if (
|
|
||||||
/* c->MethodID > (UInt32)0xFFFFFFFF || */
|
|
||||||
c->NumStreams != 1
|
|
||||||
|| f->NumPackStreams != 1
|
|
||||||
|| f->PackStreams[0] != 0
|
|
||||||
|| f->NumBonds != 1
|
|
||||||
|| f->Bonds[0].InIndex != 1
|
|
||||||
|| f->Bonds[0].OutIndex != 0)
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
switch ((UInt32)c->MethodID)
|
|
||||||
{
|
|
||||||
#if !defined(Z7_NO_METHODS_FILTERS)
|
|
||||||
case k_Delta:
|
|
||||||
case k_BCJ:
|
|
||||||
case k_PPC:
|
|
||||||
case k_IA64:
|
|
||||||
case k_SPARC:
|
|
||||||
case k_ARM:
|
|
||||||
case k_RISCV:
|
|
||||||
#endif
|
|
||||||
#ifdef Z7_USE_FILTER_ARM64
|
|
||||||
case k_ARM64:
|
|
||||||
#endif
|
|
||||||
#ifdef Z7_USE_FILTER_ARMT
|
|
||||||
case k_ARMT:
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
return SZ_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
if (f->NumCoders == 4)
|
|
||||||
{
|
|
||||||
if (!IS_SUPPORTED_CODER(&f->Coders[1])
|
|
||||||
|| !IS_SUPPORTED_CODER(&f->Coders[2])
|
|
||||||
|| !IS_BCJ2(&f->Coders[3]))
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
if (f->NumPackStreams != 4
|
|
||||||
|| f->PackStreams[0] != 2
|
|
||||||
|| f->PackStreams[1] != 6
|
|
||||||
|| f->PackStreams[2] != 1
|
|
||||||
|| f->PackStreams[3] != 0
|
|
||||||
|| f->NumBonds != 3
|
|
||||||
|| f->Bonds[0].InIndex != 5 || f->Bonds[0].OutIndex != 0
|
|
||||||
|| f->Bonds[1].InIndex != 4 || f->Bonds[1].OutIndex != 1
|
|
||||||
|| f->Bonds[2].InIndex != 3 || f->Bonds[2].OutIndex != 2)
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
return SZ_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static SRes SzFolder_Decode2(const CSzFolder *folder,
|
|
||||||
const Byte *propsData,
|
|
||||||
const UInt64 *unpackSizes,
|
|
||||||
const UInt64 *packPositions,
|
|
||||||
ILookInStreamPtr inStream, UInt64 startPos,
|
|
||||||
Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain,
|
|
||||||
Byte *tempBuf[])
|
|
||||||
{
|
|
||||||
UInt32 ci;
|
|
||||||
SizeT tempSizes[3] = { 0, 0, 0};
|
|
||||||
SizeT tempSize3 = 0;
|
|
||||||
Byte *tempBuf3 = 0;
|
|
||||||
|
|
||||||
RINOK(CheckSupportedFolder(folder))
|
|
||||||
|
|
||||||
for (ci = 0; ci < folder->NumCoders; ci++)
|
|
||||||
{
|
|
||||||
const CSzCoderInfo *coder = &folder->Coders[ci];
|
|
||||||
|
|
||||||
if (IS_MAIN_METHOD((UInt32)coder->MethodID))
|
|
||||||
{
|
|
||||||
UInt32 si = 0;
|
|
||||||
UInt64 offset;
|
|
||||||
UInt64 inSize;
|
|
||||||
Byte *outBufCur = outBuffer;
|
|
||||||
SizeT outSizeCur = outSize;
|
|
||||||
if (folder->NumCoders == 4)
|
|
||||||
{
|
|
||||||
const UInt32 indices[] = { 3, 2, 0 };
|
|
||||||
const UInt64 unpackSize = unpackSizes[ci];
|
|
||||||
si = indices[ci];
|
|
||||||
if (ci < 2)
|
|
||||||
{
|
|
||||||
Byte *temp;
|
|
||||||
outSizeCur = (SizeT)unpackSize;
|
|
||||||
if (outSizeCur != unpackSize)
|
|
||||||
return SZ_ERROR_MEM;
|
|
||||||
temp = (Byte *)ISzAlloc_Alloc(allocMain, outSizeCur);
|
|
||||||
if (!temp && outSizeCur != 0)
|
|
||||||
return SZ_ERROR_MEM;
|
|
||||||
outBufCur = tempBuf[1 - ci] = temp;
|
|
||||||
tempSizes[1 - ci] = outSizeCur;
|
|
||||||
}
|
|
||||||
else if (ci == 2)
|
|
||||||
{
|
|
||||||
if (unpackSize > outSize) /* check it */
|
|
||||||
return SZ_ERROR_PARAM;
|
|
||||||
tempBuf3 = outBufCur = outBuffer + (outSize - (size_t)unpackSize);
|
|
||||||
tempSize3 = outSizeCur = (SizeT)unpackSize;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
offset = packPositions[si];
|
|
||||||
inSize = packPositions[(size_t)si + 1] - offset;
|
|
||||||
RINOK(LookInStream_SeekTo(inStream, startPos + offset))
|
|
||||||
|
|
||||||
if (coder->MethodID == k_Copy)
|
|
||||||
{
|
|
||||||
if (inSize != outSizeCur) /* check it */
|
|
||||||
return SZ_ERROR_DATA;
|
|
||||||
RINOK(SzDecodeCopy(inSize, inStream, outBufCur))
|
|
||||||
}
|
|
||||||
else if (coder->MethodID == k_LZMA)
|
|
||||||
{
|
|
||||||
RINOK(SzDecodeLzma(propsData + coder->PropsOffset, coder->PropsSize, inSize, inStream, outBufCur, outSizeCur, allocMain))
|
|
||||||
}
|
|
||||||
#ifndef Z7_NO_METHOD_LZMA2
|
|
||||||
else if (coder->MethodID == k_LZMA2)
|
|
||||||
{
|
|
||||||
RINOK(SzDecodeLzma2(propsData + coder->PropsOffset, coder->PropsSize, inSize, inStream, outBufCur, outSizeCur, allocMain))
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#ifdef Z7_PPMD_SUPPORT
|
|
||||||
else if (coder->MethodID == k_PPMD)
|
|
||||||
{
|
|
||||||
RINOK(SzDecodePpmd(propsData + coder->PropsOffset, coder->PropsSize, inSize, inStream, outBufCur, outSizeCur, allocMain))
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
else if (coder->MethodID == k_BCJ2)
|
|
||||||
{
|
|
||||||
const UInt64 offset = packPositions[1];
|
|
||||||
const UInt64 s3Size = packPositions[2] - offset;
|
|
||||||
|
|
||||||
if (ci != 3)
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
|
|
||||||
tempSizes[2] = (SizeT)s3Size;
|
|
||||||
if (tempSizes[2] != s3Size)
|
|
||||||
return SZ_ERROR_MEM;
|
|
||||||
tempBuf[2] = (Byte *)ISzAlloc_Alloc(allocMain, tempSizes[2]);
|
|
||||||
if (!tempBuf[2] && tempSizes[2] != 0)
|
|
||||||
return SZ_ERROR_MEM;
|
|
||||||
|
|
||||||
RINOK(LookInStream_SeekTo(inStream, startPos + offset))
|
|
||||||
RINOK(SzDecodeCopy(s3Size, inStream, tempBuf[2]))
|
|
||||||
|
|
||||||
if ((tempSizes[0] & 3) != 0 ||
|
|
||||||
(tempSizes[1] & 3) != 0 ||
|
|
||||||
tempSize3 + tempSizes[0] + tempSizes[1] != outSize)
|
|
||||||
return SZ_ERROR_DATA;
|
|
||||||
|
|
||||||
{
|
|
||||||
CBcj2Dec p;
|
|
||||||
|
|
||||||
p.bufs[0] = tempBuf3; p.lims[0] = tempBuf3 + tempSize3;
|
|
||||||
p.bufs[1] = tempBuf[0]; p.lims[1] = tempBuf[0] + tempSizes[0];
|
|
||||||
p.bufs[2] = tempBuf[1]; p.lims[2] = tempBuf[1] + tempSizes[1];
|
|
||||||
p.bufs[3] = tempBuf[2]; p.lims[3] = tempBuf[2] + tempSizes[2];
|
|
||||||
|
|
||||||
p.dest = outBuffer;
|
|
||||||
p.destLim = outBuffer + outSize;
|
|
||||||
|
|
||||||
Bcj2Dec_Init(&p);
|
|
||||||
RINOK(Bcj2Dec_Decode(&p))
|
|
||||||
|
|
||||||
{
|
|
||||||
unsigned i;
|
|
||||||
for (i = 0; i < 4; i++)
|
|
||||||
if (p.bufs[i] != p.lims[i])
|
|
||||||
return SZ_ERROR_DATA;
|
|
||||||
if (p.dest != p.destLim || !Bcj2Dec_IsMaybeFinished(&p))
|
|
||||||
return SZ_ERROR_DATA;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#if defined(Z7_USE_BRANCH_FILTER)
|
|
||||||
else if (ci == 1)
|
|
||||||
{
|
|
||||||
#if !defined(Z7_NO_METHODS_FILTERS)
|
|
||||||
if (coder->MethodID == k_Delta)
|
|
||||||
{
|
|
||||||
if (coder->PropsSize != 1)
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
{
|
|
||||||
Byte state[DELTA_STATE_SIZE];
|
|
||||||
Delta_Init(state);
|
|
||||||
Delta_Decode(state, (unsigned)(propsData[coder->PropsOffset]) + 1, outBuffer, outSize);
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef Z7_USE_FILTER_ARM64
|
|
||||||
if (coder->MethodID == k_ARM64)
|
|
||||||
{
|
|
||||||
UInt32 pc = 0;
|
|
||||||
if (coder->PropsSize == 4)
|
|
||||||
{
|
|
||||||
pc = GetUi32(propsData + coder->PropsOffset);
|
|
||||||
if (pc & 3)
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
else if (coder->PropsSize != 0)
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
z7_BranchConv_ARM64_Dec(outBuffer, outSize, pc);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(Z7_NO_METHODS_FILTERS)
|
|
||||||
if (coder->MethodID == k_RISCV)
|
|
||||||
{
|
|
||||||
UInt32 pc = 0;
|
|
||||||
if (coder->PropsSize == 4)
|
|
||||||
{
|
|
||||||
pc = GetUi32(propsData + coder->PropsOffset);
|
|
||||||
if (pc & 1)
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
else if (coder->PropsSize != 0)
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
z7_BranchConv_RISCV_Dec(outBuffer, outSize, pc);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(Z7_NO_METHODS_FILTERS) || defined(Z7_USE_FILTER_ARMT)
|
|
||||||
{
|
|
||||||
if (coder->PropsSize != 0)
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
#define CASE_BRA_CONV(isa) case k_ ## isa: Z7_BRANCH_CONV_DEC(isa)(outBuffer, outSize, 0); break; // pc = 0;
|
|
||||||
switch (coder->MethodID)
|
|
||||||
{
|
|
||||||
#if !defined(Z7_NO_METHODS_FILTERS)
|
|
||||||
case k_BCJ:
|
|
||||||
{
|
|
||||||
UInt32 state = Z7_BRANCH_CONV_ST_X86_STATE_INIT_VAL;
|
|
||||||
z7_BranchConvSt_X86_Dec(outBuffer, outSize, 0, &state); // pc = 0
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case k_PPC: Z7_BRANCH_CONV_DEC_2(BranchConv_PPC)(outBuffer, outSize, 0); break; // pc = 0;
|
|
||||||
// CASE_BRA_CONV(PPC)
|
|
||||||
CASE_BRA_CONV(IA64)
|
|
||||||
CASE_BRA_CONV(SPARC)
|
|
||||||
CASE_BRA_CONV(ARM)
|
|
||||||
#endif
|
|
||||||
#if !defined(Z7_NO_METHODS_FILTERS) || defined(Z7_USE_FILTER_ARMT)
|
|
||||||
CASE_BRA_CONV(ARMT)
|
|
||||||
#endif
|
|
||||||
default:
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
} // (c == 1)
|
|
||||||
#endif // Z7_USE_BRANCH_FILTER
|
|
||||||
else
|
|
||||||
return SZ_ERROR_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SZ_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SRes SzAr_DecodeFolder(const CSzAr *p, UInt32 folderIndex,
|
|
||||||
ILookInStreamPtr inStream, UInt64 startPos,
|
|
||||||
Byte *outBuffer, size_t outSize,
|
|
||||||
ISzAllocPtr allocMain)
|
|
||||||
{
|
|
||||||
SRes res;
|
|
||||||
CSzFolder folder;
|
|
||||||
CSzData sd;
|
|
||||||
|
|
||||||
const Byte *data = p->CodersData + p->FoCodersOffsets[folderIndex];
|
|
||||||
sd.Data = data;
|
|
||||||
sd.Size = p->FoCodersOffsets[(size_t)folderIndex + 1] - p->FoCodersOffsets[folderIndex];
|
|
||||||
|
|
||||||
res = SzGetNextFolderItem(&folder, &sd);
|
|
||||||
|
|
||||||
if (res != SZ_OK)
|
|
||||||
return res;
|
|
||||||
|
|
||||||
if (sd.Size != 0
|
|
||||||
|| folder.UnpackStream != p->FoToMainUnpackSizeIndex[folderIndex]
|
|
||||||
|| outSize != SzAr_GetFolderUnpackSize(p, folderIndex))
|
|
||||||
return SZ_ERROR_FAIL;
|
|
||||||
{
|
|
||||||
unsigned i;
|
|
||||||
Byte *tempBuf[3] = { 0, 0, 0};
|
|
||||||
|
|
||||||
res = SzFolder_Decode2(&folder, data,
|
|
||||||
&p->CoderUnpackSizes[p->FoToCoderUnpackSizes[folderIndex]],
|
|
||||||
p->PackPositions + p->FoStartPackStreamIndex[folderIndex],
|
|
||||||
inStream, startPos,
|
|
||||||
outBuffer, (SizeT)outSize, allocMain, tempBuf);
|
|
||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
|
||||||
ISzAlloc_Free(allocMain, tempBuf[i]);
|
|
||||||
|
|
||||||
if (res == SZ_OK)
|
|
||||||
if (SzBitWithVals_Check(&p->FolderCRCs, folderIndex))
|
|
||||||
if (CrcCalc(outBuffer, outSize) != p->FolderCRCs.Vals[folderIndex])
|
|
||||||
res = SZ_ERROR_CRC;
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,443 +0,0 @@
|
|||||||
/* 7zFile.c -- File IO
|
|
||||||
2023-04-02 : Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#include "Precomp.h"
|
|
||||||
|
|
||||||
#include "7zFile.h"
|
|
||||||
|
|
||||||
#ifndef USE_WINDOWS_FILE
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#ifndef USE_FOPEN
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <io.h>
|
|
||||||
typedef int ssize_t;
|
|
||||||
typedef int off_t;
|
|
||||||
#else
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/*
|
|
||||||
ReadFile and WriteFile functions in Windows have BUG:
|
|
||||||
If you Read or Write 64MB or more (probably min_failure_size = 64MB - 32KB + 1)
|
|
||||||
from/to Network file, it returns ERROR_NO_SYSTEM_RESOURCES
|
|
||||||
(Insufficient system resources exist to complete the requested service).
|
|
||||||
Probably in some version of Windows there are problems with other sizes:
|
|
||||||
for 32 MB (maybe also for 16 MB).
|
|
||||||
And message can be "Network connection was lost"
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define kChunkSizeMax (1 << 22)
|
|
||||||
|
|
||||||
void File_Construct(CSzFile *p)
|
|
||||||
{
|
|
||||||
#ifdef USE_WINDOWS_FILE
|
|
||||||
p->handle = INVALID_HANDLE_VALUE;
|
|
||||||
#elif defined(USE_FOPEN)
|
|
||||||
p->file = NULL;
|
|
||||||
#else
|
|
||||||
p->fd = -1;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)
|
|
||||||
|
|
||||||
static WRes File_Open(CSzFile *p, const char *name, int writeMode)
|
|
||||||
{
|
|
||||||
#ifdef USE_WINDOWS_FILE
|
|
||||||
|
|
||||||
p->handle = CreateFileA(name,
|
|
||||||
writeMode ? GENERIC_WRITE : GENERIC_READ,
|
|
||||||
FILE_SHARE_READ, NULL,
|
|
||||||
writeMode ? CREATE_ALWAYS : OPEN_EXISTING,
|
|
||||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
|
||||||
return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError();
|
|
||||||
|
|
||||||
#elif defined(USE_FOPEN)
|
|
||||||
|
|
||||||
p->file = fopen(name, writeMode ? "wb+" : "rb");
|
|
||||||
return (p->file != 0) ? 0 :
|
|
||||||
#ifdef UNDER_CE
|
|
||||||
2; /* ENOENT */
|
|
||||||
#else
|
|
||||||
errno;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
int flags = (writeMode ? (O_CREAT | O_EXCL | O_WRONLY) : O_RDONLY);
|
|
||||||
#ifdef O_BINARY
|
|
||||||
flags |= O_BINARY;
|
|
||||||
#endif
|
|
||||||
p->fd = open(name, flags, 0666);
|
|
||||||
return (p->fd != -1) ? 0 : errno;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
WRes InFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 0); }
|
|
||||||
|
|
||||||
WRes OutFile_Open(CSzFile *p, const char *name)
|
|
||||||
{
|
|
||||||
#if defined(USE_WINDOWS_FILE) || defined(USE_FOPEN)
|
|
||||||
return File_Open(p, name, 1);
|
|
||||||
#else
|
|
||||||
p->fd = creat(name, 0666);
|
|
||||||
return (p->fd != -1) ? 0 : errno;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_WINDOWS_FILE
|
|
||||||
static WRes File_OpenW(CSzFile *p, const WCHAR *name, int writeMode)
|
|
||||||
{
|
|
||||||
p->handle = CreateFileW(name,
|
|
||||||
writeMode ? GENERIC_WRITE : GENERIC_READ,
|
|
||||||
FILE_SHARE_READ, NULL,
|
|
||||||
writeMode ? CREATE_ALWAYS : OPEN_EXISTING,
|
|
||||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
|
||||||
return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError();
|
|
||||||
}
|
|
||||||
WRes InFile_OpenW(CSzFile *p, const WCHAR *name) { return File_OpenW(p, name, 0); }
|
|
||||||
WRes OutFile_OpenW(CSzFile *p, const WCHAR *name) { return File_OpenW(p, name, 1); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
WRes File_Close(CSzFile *p)
|
|
||||||
{
|
|
||||||
#ifdef USE_WINDOWS_FILE
|
|
||||||
|
|
||||||
if (p->handle != INVALID_HANDLE_VALUE)
|
|
||||||
{
|
|
||||||
if (!CloseHandle(p->handle))
|
|
||||||
return GetLastError();
|
|
||||||
p->handle = INVALID_HANDLE_VALUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(USE_FOPEN)
|
|
||||||
|
|
||||||
if (p->file != NULL)
|
|
||||||
{
|
|
||||||
int res = fclose(p->file);
|
|
||||||
if (res != 0)
|
|
||||||
{
|
|
||||||
if (res == EOF)
|
|
||||||
return errno;
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
p->file = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
if (p->fd != -1)
|
|
||||||
{
|
|
||||||
if (close(p->fd) != 0)
|
|
||||||
return errno;
|
|
||||||
p->fd = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WRes File_Read(CSzFile *p, void *data, size_t *size)
|
|
||||||
{
|
|
||||||
size_t originalSize = *size;
|
|
||||||
*size = 0;
|
|
||||||
if (originalSize == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#ifdef USE_WINDOWS_FILE
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
const DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize;
|
|
||||||
DWORD processed = 0;
|
|
||||||
const BOOL res = ReadFile(p->handle, data, curSize, &processed, NULL);
|
|
||||||
data = (void *)((Byte *)data + processed);
|
|
||||||
originalSize -= processed;
|
|
||||||
*size += processed;
|
|
||||||
if (!res)
|
|
||||||
return GetLastError();
|
|
||||||
// debug : we can break here for partial reading mode
|
|
||||||
if (processed == 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
while (originalSize > 0);
|
|
||||||
|
|
||||||
#elif defined(USE_FOPEN)
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
const size_t curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : originalSize;
|
|
||||||
const size_t processed = fread(data, 1, curSize, p->file);
|
|
||||||
data = (void *)((Byte *)data + (size_t)processed);
|
|
||||||
originalSize -= processed;
|
|
||||||
*size += processed;
|
|
||||||
if (processed != curSize)
|
|
||||||
return ferror(p->file);
|
|
||||||
// debug : we can break here for partial reading mode
|
|
||||||
if (processed == 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
while (originalSize > 0);
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
const size_t curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : originalSize;
|
|
||||||
const ssize_t processed = read(p->fd, data, curSize);
|
|
||||||
if (processed == -1)
|
|
||||||
return errno;
|
|
||||||
if (processed == 0)
|
|
||||||
break;
|
|
||||||
data = (void *)((Byte *)data + (size_t)processed);
|
|
||||||
originalSize -= (size_t)processed;
|
|
||||||
*size += (size_t)processed;
|
|
||||||
// debug : we can break here for partial reading mode
|
|
||||||
// break;
|
|
||||||
}
|
|
||||||
while (originalSize > 0);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WRes File_Write(CSzFile *p, const void *data, size_t *size)
|
|
||||||
{
|
|
||||||
size_t originalSize = *size;
|
|
||||||
*size = 0;
|
|
||||||
if (originalSize == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#ifdef USE_WINDOWS_FILE
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
const DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize;
|
|
||||||
DWORD processed = 0;
|
|
||||||
const BOOL res = WriteFile(p->handle, data, curSize, &processed, NULL);
|
|
||||||
data = (const void *)((const Byte *)data + processed);
|
|
||||||
originalSize -= processed;
|
|
||||||
*size += processed;
|
|
||||||
if (!res)
|
|
||||||
return GetLastError();
|
|
||||||
if (processed == 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
while (originalSize > 0);
|
|
||||||
|
|
||||||
#elif defined(USE_FOPEN)
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
const size_t curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : originalSize;
|
|
||||||
const size_t processed = fwrite(data, 1, curSize, p->file);
|
|
||||||
data = (void *)((Byte *)data + (size_t)processed);
|
|
||||||
originalSize -= processed;
|
|
||||||
*size += processed;
|
|
||||||
if (processed != curSize)
|
|
||||||
return ferror(p->file);
|
|
||||||
if (processed == 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
while (originalSize > 0);
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
const size_t curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : originalSize;
|
|
||||||
const ssize_t processed = write(p->fd, data, curSize);
|
|
||||||
if (processed == -1)
|
|
||||||
return errno;
|
|
||||||
if (processed == 0)
|
|
||||||
break;
|
|
||||||
data = (const void *)((const Byte *)data + (size_t)processed);
|
|
||||||
originalSize -= (size_t)processed;
|
|
||||||
*size += (size_t)processed;
|
|
||||||
}
|
|
||||||
while (originalSize > 0);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)
|
|
||||||
{
|
|
||||||
#ifdef USE_WINDOWS_FILE
|
|
||||||
|
|
||||||
DWORD moveMethod;
|
|
||||||
UInt32 low = (UInt32)*pos;
|
|
||||||
LONG high = (LONG)((UInt64)*pos >> 16 >> 16); /* for case when UInt64 is 32-bit only */
|
|
||||||
// (int) to eliminate clang warning
|
|
||||||
switch ((int)origin)
|
|
||||||
{
|
|
||||||
case SZ_SEEK_SET: moveMethod = FILE_BEGIN; break;
|
|
||||||
case SZ_SEEK_CUR: moveMethod = FILE_CURRENT; break;
|
|
||||||
case SZ_SEEK_END: moveMethod = FILE_END; break;
|
|
||||||
default: return ERROR_INVALID_PARAMETER;
|
|
||||||
}
|
|
||||||
low = SetFilePointer(p->handle, (LONG)low, &high, moveMethod);
|
|
||||||
if (low == (UInt32)0xFFFFFFFF)
|
|
||||||
{
|
|
||||||
WRes res = GetLastError();
|
|
||||||
if (res != NO_ERROR)
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
*pos = ((Int64)high << 32) | low;
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
int moveMethod; // = origin;
|
|
||||||
|
|
||||||
switch ((int)origin)
|
|
||||||
{
|
|
||||||
case SZ_SEEK_SET: moveMethod = SEEK_SET; break;
|
|
||||||
case SZ_SEEK_CUR: moveMethod = SEEK_CUR; break;
|
|
||||||
case SZ_SEEK_END: moveMethod = SEEK_END; break;
|
|
||||||
default: return EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(USE_FOPEN)
|
|
||||||
{
|
|
||||||
int res = fseek(p->file, (long)*pos, moveMethod);
|
|
||||||
if (res == -1)
|
|
||||||
return errno;
|
|
||||||
*pos = ftell(p->file);
|
|
||||||
if (*pos == -1)
|
|
||||||
return errno;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
off_t res = lseek(p->fd, (off_t)*pos, moveMethod);
|
|
||||||
if (res == -1)
|
|
||||||
return errno;
|
|
||||||
*pos = res;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // USE_FOPEN
|
|
||||||
#endif // USE_WINDOWS_FILE
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
WRes File_GetLength(CSzFile *p, UInt64 *length)
|
|
||||||
{
|
|
||||||
#ifdef USE_WINDOWS_FILE
|
|
||||||
|
|
||||||
DWORD sizeHigh;
|
|
||||||
DWORD sizeLow = GetFileSize(p->handle, &sizeHigh);
|
|
||||||
if (sizeLow == 0xFFFFFFFF)
|
|
||||||
{
|
|
||||||
DWORD res = GetLastError();
|
|
||||||
if (res != NO_ERROR)
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
*length = (((UInt64)sizeHigh) << 32) + sizeLow;
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#elif defined(USE_FOPEN)
|
|
||||||
|
|
||||||
long pos = ftell(p->file);
|
|
||||||
int res = fseek(p->file, 0, SEEK_END);
|
|
||||||
*length = ftell(p->file);
|
|
||||||
fseek(p->file, pos, SEEK_SET);
|
|
||||||
return res;
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
off_t pos;
|
|
||||||
*length = 0;
|
|
||||||
pos = lseek(p->fd, 0, SEEK_CUR);
|
|
||||||
if (pos != -1)
|
|
||||||
{
|
|
||||||
const off_t len2 = lseek(p->fd, 0, SEEK_END);
|
|
||||||
const off_t res2 = lseek(p->fd, pos, SEEK_SET);
|
|
||||||
if (len2 != -1)
|
|
||||||
{
|
|
||||||
*length = (UInt64)len2;
|
|
||||||
if (res2 != -1)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return errno;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ---------- FileSeqInStream ---------- */
|
|
||||||
|
|
||||||
static SRes FileSeqInStream_Read(ISeqInStreamPtr pp, void *buf, size_t *size)
|
|
||||||
{
|
|
||||||
Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR_pp_vt_p(CFileSeqInStream)
|
|
||||||
const WRes wres = File_Read(&p->file, buf, size);
|
|
||||||
p->wres = wres;
|
|
||||||
return (wres == 0) ? SZ_OK : SZ_ERROR_READ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FileSeqInStream_CreateVTable(CFileSeqInStream *p)
|
|
||||||
{
|
|
||||||
p->vt.Read = FileSeqInStream_Read;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ---------- FileInStream ---------- */
|
|
||||||
|
|
||||||
static SRes FileInStream_Read(ISeekInStreamPtr pp, void *buf, size_t *size)
|
|
||||||
{
|
|
||||||
Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR_pp_vt_p(CFileInStream)
|
|
||||||
const WRes wres = File_Read(&p->file, buf, size);
|
|
||||||
p->wres = wres;
|
|
||||||
return (wres == 0) ? SZ_OK : SZ_ERROR_READ;
|
|
||||||
}
|
|
||||||
|
|
||||||
static SRes FileInStream_Seek(ISeekInStreamPtr pp, Int64 *pos, ESzSeek origin)
|
|
||||||
{
|
|
||||||
Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR_pp_vt_p(CFileInStream)
|
|
||||||
const WRes wres = File_Seek(&p->file, pos, origin);
|
|
||||||
p->wres = wres;
|
|
||||||
return (wres == 0) ? SZ_OK : SZ_ERROR_READ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FileInStream_CreateVTable(CFileInStream *p)
|
|
||||||
{
|
|
||||||
p->vt.Read = FileInStream_Read;
|
|
||||||
p->vt.Seek = FileInStream_Seek;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ---------- FileOutStream ---------- */
|
|
||||||
|
|
||||||
static size_t FileOutStream_Write(ISeqOutStreamPtr pp, const void *data, size_t size)
|
|
||||||
{
|
|
||||||
Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR_pp_vt_p(CFileOutStream)
|
|
||||||
const WRes wres = File_Write(&p->file, data, &size);
|
|
||||||
p->wres = wres;
|
|
||||||
return size;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FileOutStream_CreateVTable(CFileOutStream *p)
|
|
||||||
{
|
|
||||||
p->vt.Write = FileOutStream_Write;
|
|
||||||
}
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
/* 7zFile.h -- File IO
|
|
||||||
2023-03-05 : Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#ifndef ZIP7_INC_FILE_H
|
|
||||||
#define ZIP7_INC_FILE_H
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define USE_WINDOWS_FILE
|
|
||||||
// #include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_WINDOWS_FILE
|
|
||||||
#include "7zWindows.h"
|
|
||||||
|
|
||||||
#else
|
|
||||||
// note: USE_FOPEN mode is limited to 32-bit file size
|
|
||||||
// #define USE_FOPEN
|
|
||||||
// #include <stdio.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "7zTypes.h"
|
|
||||||
|
|
||||||
EXTERN_C_BEGIN
|
|
||||||
|
|
||||||
/* ---------- File ---------- */
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
#ifdef USE_WINDOWS_FILE
|
|
||||||
HANDLE handle;
|
|
||||||
#elif defined(USE_FOPEN)
|
|
||||||
FILE *file;
|
|
||||||
#else
|
|
||||||
int fd;
|
|
||||||
#endif
|
|
||||||
} CSzFile;
|
|
||||||
|
|
||||||
void File_Construct(CSzFile *p);
|
|
||||||
#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)
|
|
||||||
WRes InFile_Open(CSzFile *p, const char *name);
|
|
||||||
WRes OutFile_Open(CSzFile *p, const char *name);
|
|
||||||
#endif
|
|
||||||
#ifdef USE_WINDOWS_FILE
|
|
||||||
WRes InFile_OpenW(CSzFile *p, const WCHAR *name);
|
|
||||||
WRes OutFile_OpenW(CSzFile *p, const WCHAR *name);
|
|
||||||
#endif
|
|
||||||
WRes File_Close(CSzFile *p);
|
|
||||||
|
|
||||||
/* reads max(*size, remain file's size) bytes */
|
|
||||||
WRes File_Read(CSzFile *p, void *data, size_t *size);
|
|
||||||
|
|
||||||
/* writes *size bytes */
|
|
||||||
WRes File_Write(CSzFile *p, const void *data, size_t *size);
|
|
||||||
|
|
||||||
WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin);
|
|
||||||
WRes File_GetLength(CSzFile *p, UInt64 *length);
|
|
||||||
|
|
||||||
|
|
||||||
/* ---------- FileInStream ---------- */
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
ISeqInStream vt;
|
|
||||||
CSzFile file;
|
|
||||||
WRes wres;
|
|
||||||
} CFileSeqInStream;
|
|
||||||
|
|
||||||
void FileSeqInStream_CreateVTable(CFileSeqInStream *p);
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
ISeekInStream vt;
|
|
||||||
CSzFile file;
|
|
||||||
WRes wres;
|
|
||||||
} CFileInStream;
|
|
||||||
|
|
||||||
void FileInStream_CreateVTable(CFileInStream *p);
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
ISeqOutStream vt;
|
|
||||||
CSzFile file;
|
|
||||||
WRes wres;
|
|
||||||
} CFileOutStream;
|
|
||||||
|
|
||||||
void FileOutStream_CreateVTable(CFileOutStream *p);
|
|
||||||
|
|
||||||
EXTERN_C_END
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,199 +0,0 @@
|
|||||||
/* 7zStream.c -- 7z Stream functions
|
|
||||||
2023-04-02 : Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#include "Precomp.h"
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "7zTypes.h"
|
|
||||||
|
|
||||||
|
|
||||||
SRes SeqInStream_ReadMax(ISeqInStreamPtr stream, void *buf, size_t *processedSize)
|
|
||||||
{
|
|
||||||
size_t size = *processedSize;
|
|
||||||
*processedSize = 0;
|
|
||||||
while (size != 0)
|
|
||||||
{
|
|
||||||
size_t cur = size;
|
|
||||||
const SRes res = ISeqInStream_Read(stream, buf, &cur);
|
|
||||||
*processedSize += cur;
|
|
||||||
buf = (void *)((Byte *)buf + cur);
|
|
||||||
size -= cur;
|
|
||||||
if (res != SZ_OK)
|
|
||||||
return res;
|
|
||||||
if (cur == 0)
|
|
||||||
return SZ_OK;
|
|
||||||
}
|
|
||||||
return SZ_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
SRes SeqInStream_Read2(ISeqInStreamPtr stream, void *buf, size_t size, SRes errorType)
|
|
||||||
{
|
|
||||||
while (size != 0)
|
|
||||||
{
|
|
||||||
size_t processed = size;
|
|
||||||
RINOK(ISeqInStream_Read(stream, buf, &processed))
|
|
||||||
if (processed == 0)
|
|
||||||
return errorType;
|
|
||||||
buf = (void *)((Byte *)buf + processed);
|
|
||||||
size -= processed;
|
|
||||||
}
|
|
||||||
return SZ_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
SRes SeqInStream_Read(ISeqInStreamPtr stream, void *buf, size_t size)
|
|
||||||
{
|
|
||||||
return SeqInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
SRes SeqInStream_ReadByte(ISeqInStreamPtr stream, Byte *buf)
|
|
||||||
{
|
|
||||||
size_t processed = 1;
|
|
||||||
RINOK(ISeqInStream_Read(stream, buf, &processed))
|
|
||||||
return (processed == 1) ? SZ_OK : SZ_ERROR_INPUT_EOF;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SRes LookInStream_SeekTo(ILookInStreamPtr stream, UInt64 offset)
|
|
||||||
{
|
|
||||||
Int64 t = (Int64)offset;
|
|
||||||
return ILookInStream_Seek(stream, &t, SZ_SEEK_SET);
|
|
||||||
}
|
|
||||||
|
|
||||||
SRes LookInStream_LookRead(ILookInStreamPtr stream, void *buf, size_t *size)
|
|
||||||
{
|
|
||||||
const void *lookBuf;
|
|
||||||
if (*size == 0)
|
|
||||||
return SZ_OK;
|
|
||||||
RINOK(ILookInStream_Look(stream, &lookBuf, size))
|
|
||||||
memcpy(buf, lookBuf, *size);
|
|
||||||
return ILookInStream_Skip(stream, *size);
|
|
||||||
}
|
|
||||||
|
|
||||||
SRes LookInStream_Read2(ILookInStreamPtr stream, void *buf, size_t size, SRes errorType)
|
|
||||||
{
|
|
||||||
while (size != 0)
|
|
||||||
{
|
|
||||||
size_t processed = size;
|
|
||||||
RINOK(ILookInStream_Read(stream, buf, &processed))
|
|
||||||
if (processed == 0)
|
|
||||||
return errorType;
|
|
||||||
buf = (void *)((Byte *)buf + processed);
|
|
||||||
size -= processed;
|
|
||||||
}
|
|
||||||
return SZ_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
SRes LookInStream_Read(ILookInStreamPtr stream, void *buf, size_t size)
|
|
||||||
{
|
|
||||||
return LookInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define GET_LookToRead2 Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR_pp_vt_p(CLookToRead2)
|
|
||||||
|
|
||||||
static SRes LookToRead2_Look_Lookahead(ILookInStreamPtr pp, const void **buf, size_t *size)
|
|
||||||
{
|
|
||||||
SRes res = SZ_OK;
|
|
||||||
GET_LookToRead2
|
|
||||||
size_t size2 = p->size - p->pos;
|
|
||||||
if (size2 == 0 && *size != 0)
|
|
||||||
{
|
|
||||||
p->pos = 0;
|
|
||||||
p->size = 0;
|
|
||||||
size2 = p->bufSize;
|
|
||||||
res = ISeekInStream_Read(p->realStream, p->buf, &size2);
|
|
||||||
p->size = size2;
|
|
||||||
}
|
|
||||||
if (*size > size2)
|
|
||||||
*size = size2;
|
|
||||||
*buf = p->buf + p->pos;
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static SRes LookToRead2_Look_Exact(ILookInStreamPtr pp, const void **buf, size_t *size)
|
|
||||||
{
|
|
||||||
SRes res = SZ_OK;
|
|
||||||
GET_LookToRead2
|
|
||||||
size_t size2 = p->size - p->pos;
|
|
||||||
if (size2 == 0 && *size != 0)
|
|
||||||
{
|
|
||||||
p->pos = 0;
|
|
||||||
p->size = 0;
|
|
||||||
if (*size > p->bufSize)
|
|
||||||
*size = p->bufSize;
|
|
||||||
res = ISeekInStream_Read(p->realStream, p->buf, size);
|
|
||||||
size2 = p->size = *size;
|
|
||||||
}
|
|
||||||
if (*size > size2)
|
|
||||||
*size = size2;
|
|
||||||
*buf = p->buf + p->pos;
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static SRes LookToRead2_Skip(ILookInStreamPtr pp, size_t offset)
|
|
||||||
{
|
|
||||||
GET_LookToRead2
|
|
||||||
p->pos += offset;
|
|
||||||
return SZ_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static SRes LookToRead2_Read(ILookInStreamPtr pp, void *buf, size_t *size)
|
|
||||||
{
|
|
||||||
GET_LookToRead2
|
|
||||||
size_t rem = p->size - p->pos;
|
|
||||||
if (rem == 0)
|
|
||||||
return ISeekInStream_Read(p->realStream, buf, size);
|
|
||||||
if (rem > *size)
|
|
||||||
rem = *size;
|
|
||||||
memcpy(buf, p->buf + p->pos, rem);
|
|
||||||
p->pos += rem;
|
|
||||||
*size = rem;
|
|
||||||
return SZ_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static SRes LookToRead2_Seek(ILookInStreamPtr pp, Int64 *pos, ESzSeek origin)
|
|
||||||
{
|
|
||||||
GET_LookToRead2
|
|
||||||
p->pos = p->size = 0;
|
|
||||||
return ISeekInStream_Seek(p->realStream, pos, origin);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LookToRead2_CreateVTable(CLookToRead2 *p, int lookahead)
|
|
||||||
{
|
|
||||||
p->vt.Look = lookahead ?
|
|
||||||
LookToRead2_Look_Lookahead :
|
|
||||||
LookToRead2_Look_Exact;
|
|
||||||
p->vt.Skip = LookToRead2_Skip;
|
|
||||||
p->vt.Read = LookToRead2_Read;
|
|
||||||
p->vt.Seek = LookToRead2_Seek;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static SRes SecToLook_Read(ISeqInStreamPtr pp, void *buf, size_t *size)
|
|
||||||
{
|
|
||||||
Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR_pp_vt_p(CSecToLook)
|
|
||||||
return LookInStream_LookRead(p->realStream, buf, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SecToLook_CreateVTable(CSecToLook *p)
|
|
||||||
{
|
|
||||||
p->vt.Read = SecToLook_Read;
|
|
||||||
}
|
|
||||||
|
|
||||||
static SRes SecToRead_Read(ISeqInStreamPtr pp, void *buf, size_t *size)
|
|
||||||
{
|
|
||||||
Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR_pp_vt_p(CSecToRead)
|
|
||||||
return ILookInStream_Read(p->realStream, buf, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SecToRead_CreateVTable(CSecToRead *p)
|
|
||||||
{
|
|
||||||
p->vt.Read = SecToRead_Read;
|
|
||||||
}
|
|
||||||
@@ -1,597 +0,0 @@
|
|||||||
/* 7zTypes.h -- Basic types
|
|
||||||
2024-01-24 : Igor Pavlov : Public domain */
|
|
||||||
|
|
||||||
#ifndef ZIP7_7Z_TYPES_H
|
|
||||||
#define ZIP7_7Z_TYPES_H
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
/* #include <windows.h> */
|
|
||||||
#else
|
|
||||||
#include <errno.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
#ifndef EXTERN_C_BEGIN
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#define EXTERN_C_BEGIN extern "C" {
|
|
||||||
#define EXTERN_C_END }
|
|
||||||
#else
|
|
||||||
#define EXTERN_C_BEGIN
|
|
||||||
#define EXTERN_C_END
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
EXTERN_C_BEGIN
|
|
||||||
|
|
||||||
#define SZ_OK 0
|
|
||||||
|
|
||||||
#define SZ_ERROR_DATA 1
|
|
||||||
#define SZ_ERROR_MEM 2
|
|
||||||
#define SZ_ERROR_CRC 3
|
|
||||||
#define SZ_ERROR_UNSUPPORTED 4
|
|
||||||
#define SZ_ERROR_PARAM 5
|
|
||||||
#define SZ_ERROR_INPUT_EOF 6
|
|
||||||
#define SZ_ERROR_OUTPUT_EOF 7
|
|
||||||
#define SZ_ERROR_READ 8
|
|
||||||
#define SZ_ERROR_WRITE 9
|
|
||||||
#define SZ_ERROR_PROGRESS 10
|
|
||||||
#define SZ_ERROR_FAIL 11
|
|
||||||
#define SZ_ERROR_THREAD 12
|
|
||||||
|
|
||||||
#define SZ_ERROR_ARCHIVE 16
|
|
||||||
#define SZ_ERROR_NO_ARCHIVE 17
|
|
||||||
|
|
||||||
typedef int SRes;
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#if _MSC_VER > 1200
|
|
||||||
#define MY_ALIGN(n) __declspec(align(n))
|
|
||||||
#else
|
|
||||||
#define MY_ALIGN(n)
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
/*
|
|
||||||
// C11/C++11:
|
|
||||||
#include <stdalign.h>
|
|
||||||
#define MY_ALIGN(n) alignas(n)
|
|
||||||
*/
|
|
||||||
#define MY_ALIGN(n) __attribute__ ((aligned(n)))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
|
|
||||||
/* typedef DWORD WRes; */
|
|
||||||
typedef unsigned WRes;
|
|
||||||
#define MY_SRes_HRESULT_FROM_WRes(x) HRESULT_FROM_WIN32(x)
|
|
||||||
|
|
||||||
// #define MY_HRES_ERROR_INTERNAL_ERROR MY_SRes_HRESULT_FROM_WRes(ERROR_INTERNAL_ERROR)
|
|
||||||
|
|
||||||
#else // _WIN32
|
|
||||||
|
|
||||||
// #define ENV_HAVE_LSTAT
|
|
||||||
typedef int WRes;
|
|
||||||
|
|
||||||
// (FACILITY_ERRNO = 0x800) is 7zip's FACILITY constant to represent (errno) errors in HRESULT
|
|
||||||
#define MY_FACILITY_ERRNO 0x800
|
|
||||||
#define MY_FACILITY_WIN32 7
|
|
||||||
#define MY_FACILITY_WRes MY_FACILITY_ERRNO
|
|
||||||
|
|
||||||
#define MY_HRESULT_FROM_errno_CONST_ERROR(x) ((HRESULT)( \
|
|
||||||
( (HRESULT)(x) & 0x0000FFFF) \
|
|
||||||
| (MY_FACILITY_WRes << 16) \
|
|
||||||
| (HRESULT)0x80000000 ))
|
|
||||||
|
|
||||||
#define MY_SRes_HRESULT_FROM_WRes(x) \
|
|
||||||
((HRESULT)(x) <= 0 ? ((HRESULT)(x)) : MY_HRESULT_FROM_errno_CONST_ERROR(x))
|
|
||||||
|
|
||||||
// we call macro HRESULT_FROM_WIN32 for system errors (WRes) that are (errno)
|
|
||||||
#define HRESULT_FROM_WIN32(x) MY_SRes_HRESULT_FROM_WRes(x)
|
|
||||||
|
|
||||||
/*
|
|
||||||
#define ERROR_FILE_NOT_FOUND 2L
|
|
||||||
#define ERROR_ACCESS_DENIED 5L
|
|
||||||
#define ERROR_NO_MORE_FILES 18L
|
|
||||||
#define ERROR_LOCK_VIOLATION 33L
|
|
||||||
#define ERROR_FILE_EXISTS 80L
|
|
||||||
#define ERROR_DISK_FULL 112L
|
|
||||||
#define ERROR_NEGATIVE_SEEK 131L
|
|
||||||
#define ERROR_ALREADY_EXISTS 183L
|
|
||||||
#define ERROR_DIRECTORY 267L
|
|
||||||
#define ERROR_TOO_MANY_POSTS 298L
|
|
||||||
|
|
||||||
#define ERROR_INTERNAL_ERROR 1359L
|
|
||||||
#define ERROR_INVALID_REPARSE_DATA 4392L
|
|
||||||
#define ERROR_REPARSE_TAG_INVALID 4393L
|
|
||||||
#define ERROR_REPARSE_TAG_MISMATCH 4394L
|
|
||||||
*/
|
|
||||||
|
|
||||||
// we use errno equivalents for some WIN32 errors:
|
|
||||||
|
|
||||||
#define ERROR_INVALID_PARAMETER EINVAL
|
|
||||||
#define ERROR_INVALID_FUNCTION EINVAL
|
|
||||||
#define ERROR_ALREADY_EXISTS EEXIST
|
|
||||||
#define ERROR_FILE_EXISTS EEXIST
|
|
||||||
#define ERROR_PATH_NOT_FOUND ENOENT
|
|
||||||
#define ERROR_FILE_NOT_FOUND ENOENT
|
|
||||||
#define ERROR_DISK_FULL ENOSPC
|
|
||||||
// #define ERROR_INVALID_HANDLE EBADF
|
|
||||||
|
|
||||||
// we use FACILITY_WIN32 for errors that has no errno equivalent
|
|
||||||
// Too many posts were made to a semaphore.
|
|
||||||
#define ERROR_TOO_MANY_POSTS ((HRESULT)0x8007012AL)
|
|
||||||
#define ERROR_INVALID_REPARSE_DATA ((HRESULT)0x80071128L)
|
|
||||||
#define ERROR_REPARSE_TAG_INVALID ((HRESULT)0x80071129L)
|
|
||||||
|
|
||||||
// if (MY_FACILITY_WRes != FACILITY_WIN32),
|
|
||||||
// we use FACILITY_WIN32 for COM errors:
|
|
||||||
#define E_OUTOFMEMORY ((HRESULT)0x8007000EL)
|
|
||||||
#define E_INVALIDARG ((HRESULT)0x80070057L)
|
|
||||||
#define MY_E_ERROR_NEGATIVE_SEEK ((HRESULT)0x80070083L)
|
|
||||||
|
|
||||||
/*
|
|
||||||
// we can use FACILITY_ERRNO for some COM errors, that have errno equivalents:
|
|
||||||
#define E_OUTOFMEMORY MY_HRESULT_FROM_errno_CONST_ERROR(ENOMEM)
|
|
||||||
#define E_INVALIDARG MY_HRESULT_FROM_errno_CONST_ERROR(EINVAL)
|
|
||||||
#define MY_E_ERROR_NEGATIVE_SEEK MY_HRESULT_FROM_errno_CONST_ERROR(EINVAL)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define TEXT(quote) quote
|
|
||||||
|
|
||||||
#define FILE_ATTRIBUTE_READONLY 0x0001
|
|
||||||
#define FILE_ATTRIBUTE_HIDDEN 0x0002
|
|
||||||
#define FILE_ATTRIBUTE_SYSTEM 0x0004
|
|
||||||
#define FILE_ATTRIBUTE_DIRECTORY 0x0010
|
|
||||||
#define FILE_ATTRIBUTE_ARCHIVE 0x0020
|
|
||||||
#define FILE_ATTRIBUTE_DEVICE 0x0040
|
|
||||||
#define FILE_ATTRIBUTE_NORMAL 0x0080
|
|
||||||
#define FILE_ATTRIBUTE_TEMPORARY 0x0100
|
|
||||||
#define FILE_ATTRIBUTE_SPARSE_FILE 0x0200
|
|
||||||
#define FILE_ATTRIBUTE_REPARSE_POINT 0x0400
|
|
||||||
#define FILE_ATTRIBUTE_COMPRESSED 0x0800
|
|
||||||
#define FILE_ATTRIBUTE_OFFLINE 0x1000
|
|
||||||
#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x2000
|
|
||||||
#define FILE_ATTRIBUTE_ENCRYPTED 0x4000
|
|
||||||
|
|
||||||
#define FILE_ATTRIBUTE_UNIX_EXTENSION 0x8000 /* trick for Unix */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef RINOK
|
|
||||||
#define RINOK(x) { const int _result_ = (x); if (_result_ != 0) return _result_; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef RINOK_WRes
|
|
||||||
#define RINOK_WRes(x) { const WRes _result_ = (x); if (_result_ != 0) return _result_; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef unsigned char Byte;
|
|
||||||
typedef short Int16;
|
|
||||||
typedef unsigned short UInt16;
|
|
||||||
|
|
||||||
#ifdef Z7_DECL_Int32_AS_long
|
|
||||||
typedef long Int32;
|
|
||||||
typedef unsigned long UInt32;
|
|
||||||
#else
|
|
||||||
typedef int Int32;
|
|
||||||
typedef unsigned int UInt32;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _WIN32
|
|
||||||
|
|
||||||
typedef int INT;
|
|
||||||
typedef Int32 INT32;
|
|
||||||
typedef unsigned int UINT;
|
|
||||||
typedef UInt32 UINT32;
|
|
||||||
typedef INT32 LONG; // LONG, ULONG and DWORD must be 32-bit for _WIN32 compatibility
|
|
||||||
typedef UINT32 ULONG;
|
|
||||||
|
|
||||||
#undef DWORD
|
|
||||||
typedef UINT32 DWORD;
|
|
||||||
|
|
||||||
#define VOID void
|
|
||||||
|
|
||||||
#define HRESULT LONG
|
|
||||||
|
|
||||||
typedef void *LPVOID;
|
|
||||||
// typedef void VOID;
|
|
||||||
// typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR;
|
|
||||||
// gcc / clang on Unix : sizeof(long==sizeof(void*) in 32 or 64 bits)
|
|
||||||
typedef long INT_PTR;
|
|
||||||
typedef unsigned long UINT_PTR;
|
|
||||||
typedef long LONG_PTR;
|
|
||||||
typedef unsigned long DWORD_PTR;
|
|
||||||
|
|
||||||
typedef size_t SIZE_T;
|
|
||||||
|
|
||||||
#endif // _WIN32
|
|
||||||
|
|
||||||
|
|
||||||
#define MY_HRES_ERROR_INTERNAL_ERROR ((HRESULT)0x8007054FL)
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef Z7_DECL_Int64_AS_long
|
|
||||||
|
|
||||||
typedef long Int64;
|
|
||||||
typedef unsigned long UInt64;
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(__clang__)
|
|
||||||
typedef __int64 Int64;
|
|
||||||
typedef unsigned __int64 UInt64;
|
|
||||||
#else
|
|
||||||
#if defined(__clang__) || defined(__GNUC__)
|
|
||||||
#include <stdint.h>
|
|
||||||
typedef int64_t Int64;
|
|
||||||
typedef uint64_t UInt64;
|
|
||||||
#else
|
|
||||||
typedef long long int Int64;
|
|
||||||
typedef unsigned long long int UInt64;
|
|
||||||
// #define UINT64_CONST(n) n ## ULL
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define UINT64_CONST(n) n
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef Z7_DECL_SizeT_AS_unsigned_int
|
|
||||||
typedef unsigned int SizeT;
|
|
||||||
#else
|
|
||||||
typedef size_t SizeT;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
#if (defined(_MSC_VER) && _MSC_VER <= 1200)
|
|
||||||
typedef size_t MY_uintptr_t;
|
|
||||||
#else
|
|
||||||
#include <stdint.h>
|
|
||||||
typedef uintptr_t MY_uintptr_t;
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef int BoolInt;
|
|
||||||
/* typedef BoolInt Bool; */
|
|
||||||
#define True 1
|
|
||||||
#define False 0
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define Z7_STDCALL __stdcall
|
|
||||||
#else
|
|
||||||
#define Z7_STDCALL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
|
|
||||||
#if _MSC_VER >= 1300
|
|
||||||
#define Z7_NO_INLINE __declspec(noinline)
|
|
||||||
#else
|
|
||||||
#define Z7_NO_INLINE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define Z7_FORCE_INLINE __forceinline
|
|
||||||
|
|
||||||
#define Z7_CDECL __cdecl
|
|
||||||
#define Z7_FASTCALL __fastcall
|
|
||||||
|
|
||||||
#else // _MSC_VER
|
|
||||||
|
|
||||||
#if (defined(__GNUC__) && (__GNUC__ >= 4)) \
|
|
||||||
|| (defined(__clang__) && (__clang_major__ >= 4)) \
|
|
||||||
|| defined(__INTEL_COMPILER) \
|
|
||||||
|| defined(__xlC__)
|
|
||||||
#define Z7_NO_INLINE __attribute__((noinline))
|
|
||||||
#define Z7_FORCE_INLINE __attribute__((always_inline)) inline
|
|
||||||
#else
|
|
||||||
#define Z7_NO_INLINE
|
|
||||||
#define Z7_FORCE_INLINE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define Z7_CDECL
|
|
||||||
|
|
||||||
#if defined(_M_IX86) \
|
|
||||||
|| defined(__i386__)
|
|
||||||
// #define Z7_FASTCALL __attribute__((fastcall))
|
|
||||||
// #define Z7_FASTCALL __attribute__((cdecl))
|
|
||||||
#define Z7_FASTCALL
|
|
||||||
#elif defined(MY_CPU_AMD64)
|
|
||||||
// #define Z7_FASTCALL __attribute__((ms_abi))
|
|
||||||
#define Z7_FASTCALL
|
|
||||||
#else
|
|
||||||
#define Z7_FASTCALL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // _MSC_VER
|
|
||||||
|
|
||||||
|
|
||||||
/* The following interfaces use first parameter as pointer to structure */
|
|
||||||
|
|
||||||
// #define Z7_C_IFACE_CONST_QUAL
|
|
||||||
#define Z7_C_IFACE_CONST_QUAL const
|
|
||||||
|
|
||||||
#define Z7_C_IFACE_DECL(a) \
|
|
||||||
struct a ## _; \
|
|
||||||
typedef Z7_C_IFACE_CONST_QUAL struct a ## _ * a ## Ptr; \
|
|
||||||
typedef struct a ## _ a; \
|
|
||||||
struct a ## _
|
|
||||||
|
|
||||||
|
|
||||||
Z7_C_IFACE_DECL (IByteIn)
|
|
||||||
{
|
|
||||||
Byte (*Read)(IByteInPtr p); /* reads one byte, returns 0 in case of EOF or error */
|
|
||||||
};
|
|
||||||
#define IByteIn_Read(p) (p)->Read(p)
|
|
||||||
|
|
||||||
|
|
||||||
Z7_C_IFACE_DECL (IByteOut)
|
|
||||||
{
|
|
||||||
void (*Write)(IByteOutPtr p, Byte b);
|
|
||||||
};
|
|
||||||
#define IByteOut_Write(p, b) (p)->Write(p, b)
|
|
||||||
|
|
||||||
|
|
||||||
Z7_C_IFACE_DECL (ISeqInStream)
|
|
||||||
{
|
|
||||||
SRes (*Read)(ISeqInStreamPtr p, void *buf, size_t *size);
|
|
||||||
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
|
|
||||||
(output(*size) < input(*size)) is allowed */
|
|
||||||
};
|
|
||||||
#define ISeqInStream_Read(p, buf, size) (p)->Read(p, buf, size)
|
|
||||||
|
|
||||||
/* try to read as much as avail in stream and limited by (*processedSize) */
|
|
||||||
SRes SeqInStream_ReadMax(ISeqInStreamPtr stream, void *buf, size_t *processedSize);
|
|
||||||
/* it can return SZ_ERROR_INPUT_EOF */
|
|
||||||
// SRes SeqInStream_Read(ISeqInStreamPtr stream, void *buf, size_t size);
|
|
||||||
// SRes SeqInStream_Read2(ISeqInStreamPtr stream, void *buf, size_t size, SRes errorType);
|
|
||||||
SRes SeqInStream_ReadByte(ISeqInStreamPtr stream, Byte *buf);
|
|
||||||
|
|
||||||
|
|
||||||
Z7_C_IFACE_DECL (ISeqOutStream)
|
|
||||||
{
|
|
||||||
size_t (*Write)(ISeqOutStreamPtr p, const void *buf, size_t size);
|
|
||||||
/* Returns: result - the number of actually written bytes.
|
|
||||||
(result < size) means error */
|
|
||||||
};
|
|
||||||
#define ISeqOutStream_Write(p, buf, size) (p)->Write(p, buf, size)
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
SZ_SEEK_SET = 0,
|
|
||||||
SZ_SEEK_CUR = 1,
|
|
||||||
SZ_SEEK_END = 2
|
|
||||||
} ESzSeek;
|
|
||||||
|
|
||||||
|
|
||||||
Z7_C_IFACE_DECL (ISeekInStream)
|
|
||||||
{
|
|
||||||
SRes (*Read)(ISeekInStreamPtr p, void *buf, size_t *size); /* same as ISeqInStream::Read */
|
|
||||||
SRes (*Seek)(ISeekInStreamPtr p, Int64 *pos, ESzSeek origin);
|
|
||||||
};
|
|
||||||
#define ISeekInStream_Read(p, buf, size) (p)->Read(p, buf, size)
|
|
||||||
#define ISeekInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin)
|
|
||||||
|
|
||||||
|
|
||||||
Z7_C_IFACE_DECL (ILookInStream)
|
|
||||||
{
|
|
||||||
SRes (*Look)(ILookInStreamPtr p, const void **buf, size_t *size);
|
|
||||||
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
|
|
||||||
(output(*size) > input(*size)) is not allowed
|
|
||||||
(output(*size) < input(*size)) is allowed */
|
|
||||||
SRes (*Skip)(ILookInStreamPtr p, size_t offset);
|
|
||||||
/* offset must be <= output(*size) of Look */
|
|
||||||
SRes (*Read)(ILookInStreamPtr p, void *buf, size_t *size);
|
|
||||||
/* reads directly (without buffer). It's same as ISeqInStream::Read */
|
|
||||||
SRes (*Seek)(ILookInStreamPtr p, Int64 *pos, ESzSeek origin);
|
|
||||||
};
|
|
||||||
|
|
||||||
#define ILookInStream_Look(p, buf, size) (p)->Look(p, buf, size)
|
|
||||||
#define ILookInStream_Skip(p, offset) (p)->Skip(p, offset)
|
|
||||||
#define ILookInStream_Read(p, buf, size) (p)->Read(p, buf, size)
|
|
||||||
#define ILookInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin)
|
|
||||||
|
|
||||||
|
|
||||||
SRes LookInStream_LookRead(ILookInStreamPtr stream, void *buf, size_t *size);
|
|
||||||
SRes LookInStream_SeekTo(ILookInStreamPtr stream, UInt64 offset);
|
|
||||||
|
|
||||||
/* reads via ILookInStream::Read */
|
|
||||||
SRes LookInStream_Read2(ILookInStreamPtr stream, void *buf, size_t size, SRes errorType);
|
|
||||||
SRes LookInStream_Read(ILookInStreamPtr stream, void *buf, size_t size);
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
ILookInStream vt;
|
|
||||||
ISeekInStreamPtr realStream;
|
|
||||||
|
|
||||||
size_t pos;
|
|
||||||
size_t size; /* it's data size */
|
|
||||||
|
|
||||||
/* the following variables must be set outside */
|
|
||||||
Byte *buf;
|
|
||||||
size_t bufSize;
|
|
||||||
} CLookToRead2;
|
|
||||||
|
|
||||||
void LookToRead2_CreateVTable(CLookToRead2 *p, int lookahead);
|
|
||||||
|
|
||||||
#define LookToRead2_INIT(p) { (p)->pos = (p)->size = 0; }
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
ISeqInStream vt;
|
|
||||||
ILookInStreamPtr realStream;
|
|
||||||
} CSecToLook;
|
|
||||||
|
|
||||||
void SecToLook_CreateVTable(CSecToLook *p);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
ISeqInStream vt;
|
|
||||||
ILookInStreamPtr realStream;
|
|
||||||
} CSecToRead;
|
|
||||||
|
|
||||||
void SecToRead_CreateVTable(CSecToRead *p);
|
|
||||||
|
|
||||||
|
|
||||||
Z7_C_IFACE_DECL (ICompressProgress)
|
|
||||||
{
|
|
||||||
SRes (*Progress)(ICompressProgressPtr p, UInt64 inSize, UInt64 outSize);
|
|
||||||
/* Returns: result. (result != SZ_OK) means break.
|
|
||||||
Value (UInt64)(Int64)-1 for size means unknown value. */
|
|
||||||
};
|
|
||||||
|
|
||||||
#define ICompressProgress_Progress(p, inSize, outSize) (p)->Progress(p, inSize, outSize)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct ISzAlloc ISzAlloc;
|
|
||||||
typedef const ISzAlloc * ISzAllocPtr;
|
|
||||||
|
|
||||||
struct ISzAlloc
|
|
||||||
{
|
|
||||||
void *(*Alloc)(ISzAllocPtr p, size_t size);
|
|
||||||
void (*Free)(ISzAllocPtr p, void *address); /* address can be 0 */
|
|
||||||
};
|
|
||||||
|
|
||||||
#define ISzAlloc_Alloc(p, size) (p)->Alloc(p, size)
|
|
||||||
#define ISzAlloc_Free(p, a) (p)->Free(p, a)
|
|
||||||
|
|
||||||
/* deprecated */
|
|
||||||
#define IAlloc_Alloc(p, size) ISzAlloc_Alloc(p, size)
|
|
||||||
#define IAlloc_Free(p, a) ISzAlloc_Free(p, a)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef MY_offsetof
|
|
||||||
#ifdef offsetof
|
|
||||||
#define MY_offsetof(type, m) offsetof(type, m)
|
|
||||||
/*
|
|
||||||
#define MY_offsetof(type, m) FIELD_OFFSET(type, m)
|
|
||||||
*/
|
|
||||||
#else
|
|
||||||
#define MY_offsetof(type, m) ((size_t)&(((type *)0)->m))
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef Z7_container_of
|
|
||||||
|
|
||||||
/*
|
|
||||||
#define Z7_container_of(ptr, type, m) container_of(ptr, type, m)
|
|
||||||
#define Z7_container_of(ptr, type, m) CONTAINING_RECORD(ptr, type, m)
|
|
||||||
#define Z7_container_of(ptr, type, m) ((type *)((char *)(ptr) - offsetof(type, m)))
|
|
||||||
#define Z7_container_of(ptr, type, m) (&((type *)0)->m == (ptr), ((type *)(((char *)(ptr)) - MY_offsetof(type, m))))
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
GCC shows warning: "perhaps the 'offsetof' macro was used incorrectly"
|
|
||||||
GCC 3.4.4 : classes with constructor
|
|
||||||
GCC 4.8.1 : classes with non-public variable members"
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define Z7_container_of(ptr, type, m) \
|
|
||||||
((type *)(void *)((char *)(void *) \
|
|
||||||
(1 ? (ptr) : &((type *)NULL)->m) - MY_offsetof(type, m)))
|
|
||||||
|
|
||||||
#define Z7_container_of_CONST(ptr, type, m) \
|
|
||||||
((const type *)(const void *)((const char *)(const void *) \
|
|
||||||
(1 ? (ptr) : &((type *)NULL)->m) - MY_offsetof(type, m)))
|
|
||||||
|
|
||||||
/*
|
|
||||||
#define Z7_container_of_NON_CONST_FROM_CONST(ptr, type, m) \
|
|
||||||
((type *)(void *)(const void *)((const char *)(const void *) \
|
|
||||||
(1 ? (ptr) : &((type *)NULL)->m) - MY_offsetof(type, m)))
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define Z7_CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m) ((type *)(void *)(ptr))
|
|
||||||
|
|
||||||
// #define Z7_CONTAINER_FROM_VTBL(ptr, type, m) Z7_CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m)
|
|
||||||
#define Z7_CONTAINER_FROM_VTBL(ptr, type, m) Z7_container_of(ptr, type, m)
|
|
||||||
// #define Z7_CONTAINER_FROM_VTBL(ptr, type, m) Z7_container_of_NON_CONST_FROM_CONST(ptr, type, m)
|
|
||||||
|
|
||||||
#define Z7_CONTAINER_FROM_VTBL_CONST(ptr, type, m) Z7_container_of_CONST(ptr, type, m)
|
|
||||||
|
|
||||||
#define Z7_CONTAINER_FROM_VTBL_CLS(ptr, type, m) Z7_CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m)
|
|
||||||
/*
|
|
||||||
#define Z7_CONTAINER_FROM_VTBL_CLS(ptr, type, m) Z7_CONTAINER_FROM_VTBL(ptr, type, m)
|
|
||||||
*/
|
|
||||||
#if defined (__clang__) || defined(__GNUC__)
|
|
||||||
#define Z7_DIAGNOSTIC_IGNORE_BEGIN_CAST_QUAL \
|
|
||||||
_Pragma("GCC diagnostic push") \
|
|
||||||
_Pragma("GCC diagnostic ignored \"-Wcast-qual\"")
|
|
||||||
#define Z7_DIAGNOSTIC_IGNORE_END_CAST_QUAL \
|
|
||||||
_Pragma("GCC diagnostic pop")
|
|
||||||
#else
|
|
||||||
#define Z7_DIAGNOSTIC_IGNORE_BEGIN_CAST_QUAL
|
|
||||||
#define Z7_DIAGNOSTIC_IGNORE_END_CAST_QUAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR(ptr, type, m, p) \
|
|
||||||
Z7_DIAGNOSTIC_IGNORE_BEGIN_CAST_QUAL \
|
|
||||||
type *p = Z7_CONTAINER_FROM_VTBL(ptr, type, m); \
|
|
||||||
Z7_DIAGNOSTIC_IGNORE_END_CAST_QUAL
|
|
||||||
|
|
||||||
#define Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR_pp_vt_p(type) \
|
|
||||||
Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR(pp, type, vt, p)
|
|
||||||
|
|
||||||
|
|
||||||
// #define ZIP7_DECLARE_HANDLE(name) typedef void *name;
|
|
||||||
#define Z7_DECLARE_HANDLE(name) struct name##_dummy{int unused;}; typedef struct name##_dummy *name;
|
|
||||||
|
|
||||||
|
|
||||||
#define Z7_memset_0_ARRAY(a) memset((a), 0, sizeof(a))
|
|
||||||
|
|
||||||
#ifndef Z7_ARRAY_SIZE
|
|
||||||
#define Z7_ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
|
|
||||||
#define CHAR_PATH_SEPARATOR '\\'
|
|
||||||
#define WCHAR_PATH_SEPARATOR L'\\'
|
|
||||||
#define STRING_PATH_SEPARATOR "\\"
|
|
||||||
#define WSTRING_PATH_SEPARATOR L"\\"
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define CHAR_PATH_SEPARATOR '/'
|
|
||||||
#define WCHAR_PATH_SEPARATOR L'/'
|
|
||||||
#define STRING_PATH_SEPARATOR "/"
|
|
||||||
#define WSTRING_PATH_SEPARATOR L"/"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define k_PropVar_TimePrec_0 0
|
|
||||||
#define k_PropVar_TimePrec_Unix 1
|
|
||||||
#define k_PropVar_TimePrec_DOS 2
|
|
||||||
#define k_PropVar_TimePrec_HighPrec 3
|
|
||||||
#define k_PropVar_TimePrec_Base 16
|
|
||||||
#define k_PropVar_TimePrec_100ns (k_PropVar_TimePrec_Base + 7)
|
|
||||||
#define k_PropVar_TimePrec_1ns (k_PropVar_TimePrec_Base + 9)
|
|
||||||
|
|
||||||
EXTERN_C_END
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
#ifndef Z7_ST
|
|
||||||
#ifdef _7ZIP_ST
|
|
||||||
#define Z7_ST
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
#define MY_VER_MAJOR 25
|
|
||||||
#define MY_VER_MINOR 1
|
|
||||||
#define MY_VER_BUILD 0
|
|
||||||
#define MY_VERSION_NUMBERS "25.01"
|
|
||||||
#define MY_VERSION MY_VERSION_NUMBERS
|
|
||||||
|
|
||||||
#ifdef MY_CPU_NAME
|
|
||||||
#define MY_VERSION_CPU MY_VERSION " (" MY_CPU_NAME ")"
|
|
||||||
#else
|
|
||||||
#define MY_VERSION_CPU MY_VERSION
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MY_DATE "2025-08-03"
|
|
||||||
#undef MY_COPYRIGHT
|
|
||||||
#undef MY_VERSION_COPYRIGHT_DATE
|
|
||||||
#define MY_AUTHOR_NAME "Igor Pavlov"
|
|
||||||
#define MY_COPYRIGHT_PD "Igor Pavlov : Public domain"
|
|
||||||
#define MY_COPYRIGHT_CR "Copyright (c) 1999-2025 Igor Pavlov"
|
|
||||||
|
|
||||||
#ifdef USE_COPYRIGHT_CR
|
|
||||||
#define MY_COPYRIGHT MY_COPYRIGHT_CR
|
|
||||||
#else
|
|
||||||
#define MY_COPYRIGHT MY_COPYRIGHT_PD
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MY_COPYRIGHT_DATE MY_COPYRIGHT " : " MY_DATE
|
|
||||||
#define MY_VERSION_COPYRIGHT_DATE MY_VERSION_CPU " : " MY_COPYRIGHT " : " MY_DATE
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user